#ifndef BLUECORE_MODEL_MANAGER_H #define BLUECORE_MODEL_MANAGER_H // system includes #include #include // project includes #include "Utilities/Referenced.h" #include "Utilities/Named.h" #include "TextureManager.h" #include "ShaderManager.h" #include "MeshManager.h" #include "RenderQueue.h" // forward declaration class TiXmlElement; namespace BlueCore { class Model : public Named, public RenderItem { public: struct TextureUnit { std::string mName; ref_ptr mTexture; }; struct RenderPassDefinition { bool Enabled; std::vector Textures; ShaderProgram Program; bool Tangents; float Shininess; float Specular[4]; }; ref_ptr ModelMesh; ref_ptr ShadowMesh; RenderPassDefinition AmbientPass; RenderPassDefinition LitPass; RenderPassDefinition DefaultPass; void render(RenderDevice *) const; }; class ModelManager : public Referenced { private: typedef std::map< std::string, weak_ptr > ModelContainer; ModelContainer _Models; weak_ptr _TextureManager; weak_ptr _ShaderManager; weak_ptr _MeshManager; void parseRenderPassDefinition(Model::RenderPassDefinition &Definition, const TiXmlElement* DefinitionElement); void unload(); public: ModelManager(TextureManager *texturemanager, ShaderManager* shadermanager, MeshManager* meshmanager); ~ModelManager(); Model *loadModel(const std::string &name); }; } // namespace BlueCore #endif