This is an interface to the material manager. More...
#include "MaterialManager.hpp"
Public Member Functions | |
virtual ArrayT< MaterialT * > | RegisterMaterialScript (const std::string &FileName, const std::string &BaseDir)=0 |
Registers a material script file. More... | |
virtual ArrayT< MaterialT * > | RegisterMaterialScriptsInDir (const std::string &DirName, const std::string &BaseDir, const bool Recurse=true)=0 |
Registers all ".cmat" files in a directory as material script files. More... | |
virtual const std::map < std::string, MaterialT * > & | GetAllMaterials () const =0 |
Returns all the materials registered so far. More... | |
virtual bool | HasMaterial (const std::string &MaterialName) const =0 |
Returns whether the material with the given name is registered with the material manager, i.e. if a call to GetMaterial(MaterialName) will return successfully. More... | |
virtual MaterialT * | GetMaterial (const std::string &MaterialName) const =0 |
Returns a material by its name. More... | |
virtual | ~MaterialManagerI () |
Virtual destructor, so that nothing can go wrong and even g++ is happy. More... | |
This is an interface to the material manager.
A material manager keeps a set of materials and their related script state, and finds materials by name.
The interface is specified as ABC in order to be able to share the material manager across exe/dll boundaries. (Note that sharing across exe/dll boundaries is probably not needed: The MaterialManagerI is just a helper for getting MaterialTs from script files. Thus we could also share (pointers to) arrays of MaterialTs directly. (MODs should not register their own materials, as the engine registeres anything in the Materials dir. anyway.) It is just the GetMaterial() "search" function that makes sharing the MatMan interesting.)
|
inlinevirtual |
Virtual destructor, so that nothing can go wrong and even g++ is happy.
|
pure virtual |
Returns all the materials registered so far.
Implemented in MaterialManagerImplT.
|
pure virtual |
Returns a material by its name.
If the material is not found in the previously registered scripts, NULL is returned.
Implemented in MaterialManagerImplT.
|
pure virtual |
Returns whether the material with the given name is registered with the material manager, i.e. if a call to GetMaterial(MaterialName)
will return successfully.
Use this to avoid warning messages to the console if the material is not registered.
Implemented in MaterialManagerImplT.
|
pure virtual |
Registers a material script file.
The GetMaterial() function will look into the files registered here when looking for a material.
Implemented in MaterialManagerImplT.
|
pure virtual |
Registers all ".cmat" files in a directory as material script files.
Implemented in MaterialManagerImplT.