#ifndef ASSET_MANAGER_H #define ASSET_MANAGER_H #include #include #include #include #include #include class SubMesh; // Structure holding raw model data (geometry and material information) without OpenGL buffers. struct ModelAsset { std::vector meshes; std::string modelPath; }; class AssetManager { public: // Get the singleton instance. static AssetManager& Get(); // Loads a model from file and caches the raw geometry and material data. // Returns true if successful, populating outAsset. bool LoadModel(const std::string &filepath, ModelAsset &outAsset); // Loads a texture from file and caches it. // textureID will be set to the loaded texture's OpenGL ID. bool LoadTexture(const std::string &filepath, GLuint &textureID); // Clears caches. (Optionally delete textures via glDeleteTextures if needed.) void Clear(); private: // Private constructor for singleton. AssetManager() {} // Disable copy constructor and assignment operator. AssetManager(const AssetManager&) = delete; AssetManager& operator=(const AssetManager&) = delete; // Caches. std::unordered_map modelCache; std::unordered_map textureCache; }; #endif // ASSET_MANAGER_H