This class implements the MaterialManagerI interface. More...
#include "MaterialManagerImpl.hpp"
Public Member Functions | |
MaterialT * | RegisterMaterial (const MaterialT &Mat) |
Registers a copy of the given material Mat and returns a pointer to the registered copy. More... | |
ArrayT< MaterialT * > | RegisterMaterialScript (const std::string &FileName, const std::string &BaseDir) |
Registers a material script file. More... | |
ArrayT< MaterialT * > | RegisterMaterialScriptsInDir (const std::string &DirName, const std::string &BaseDir, const bool Recurse=true) |
Registers all ".cmat" files in a directory as material script files. More... | |
const std::map< std::string, MaterialT * > & | GetAllMaterials () const |
Returns all the materials registered so far. More... | |
bool | HasMaterial (const std::string &MaterialName) const |
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... | |
MaterialT * | GetMaterial (const std::string &MaterialName) const |
Returns a material by its name. More... | |
Public Member Functions inherited from MaterialManagerI | |
virtual | ~MaterialManagerI () |
Virtual destructor, so that nothing can go wrong and even g++ is happy. More... | |
This class implements the MaterialManagerI interface.
|
inlinevirtual |
Returns all the materials registered so far.
Implements MaterialManagerI.
|
virtual |
Returns a material by its name.
If the material is not found in the previously registered scripts, NULL is returned.
Implements MaterialManagerI.
|
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.
Implements MaterialManagerI.
Registers a copy of the given material Mat
and returns a pointer to the registered copy.
If a material with the same name Mat.Name
is already registered with the material manager, Mat
is not registered, but a pointer to the already registered instance with the same name is returned (use HasMaterial() in advance to unambigiously distingush between the two cases).
Mat | The material of which a copy is to be registered with the material manager. |
|
virtual |
Registers a material script file.
The GetMaterial() function will look into the files registered here when looking for a material.
Implements MaterialManagerI.
|
virtual |
Registers all ".cmat" files in a directory as material script files.
Implements MaterialManagerI.