#pragma once #include "raylib.h" #include #include struct MaterialData { unsigned int shaderId; Color albedo; MaterialData() : shaderId(0), albedo(WHITE) {} }; class MaterialManager { public: MaterialManager(); ~MaterialManager(); // Create a material with a shader ID // Returns a unique ID for the material unsigned int Create(unsigned int shaderId, Color albedo = WHITE); // Remove a material by ID void Remove(unsigned int id); // Get material data by ID (returns nullptr if not found) MaterialData* Get(unsigned int id); // Update material shader void SetShader(unsigned int id, unsigned int shaderId); // Update material albedo void SetAlbedo(unsigned int id, Color albedo); // Clear all materials void Clear(); private: std::unordered_map materials; unsigned int nextId; bool cleared; };