xoreos
0.0.5
|
The material manager. More...
#include <materialman.h>
Public Member Functions | |
MaterialManager () | |
~MaterialManager () | |
void | init () |
Initialise material management, including default material creation. More... | |
void | deinit () |
Deinitialise material management subsystem. More... | |
void | cleanup () |
Remove any resource that has a usage count of zero. More... | |
void | addMaterial (ShaderMaterial *material) |
Adds a material to be managed. More... | |
void | delMaterial (ShaderMaterial *material) |
Forcibly remove the material from the map. More... | |
ShaderMaterial * | getMaterial (const Common::UString &name) |
Returns a material with the given name, or zero if it does not exist. More... | |
Private Member Functions | |
std::map< Common::UString, ShaderMaterial * >::iterator | delResource (std::map< Common::UString, ShaderMaterial *>::iterator iter) |
Private Attributes | |
std::map< Common::UString, ShaderMaterial * > | _resourceMap |
Additional Inherited Members | |
Static Public Member Functions inherited from Common::Singleton< MaterialManager > | |
static MaterialManager & | instance () |
static void | destroy () |
Protected Types inherited from Common::Singleton< MaterialManager > | |
typedef MaterialManager | SingletonBaseType |
Protected Member Functions inherited from Common::Singleton< MaterialManager > | |
Singleton () | |
virtual | ~Singleton () |
The material manager.
Definition at line 41 of file materialman.h.
Graphics::Shader::MaterialManager::MaterialManager | ( | ) |
Definition at line 35 of file materialman.cpp.
Graphics::Shader::MaterialManager::~MaterialManager | ( | ) |
Definition at line 38 of file materialman.cpp.
References deinit().
void Graphics::Shader::MaterialManager::addMaterial | ( | ShaderMaterial * | material | ) |
Adds a material to be managed.
Cleanup will delete the material if usage count is zero.
Definition at line 85 of file materialman.cpp.
References _resourceMap, and Graphics::Shader::ShaderMaterial::getName().
void Graphics::Shader::MaterialManager::cleanup | ( | ) |
Remove any resource that has a usage count of zero.
Definition at line 73 of file materialman.cpp.
References _resourceMap, delResource(), and Graphics::Shader::ShaderMaterial::useCount().
void Graphics::Shader::MaterialManager::deinit | ( | ) |
Deinitialise material management subsystem.
Definition at line 66 of file materialman.cpp.
References _resourceMap.
Referenced by ~MaterialManager().
void Graphics::Shader::MaterialManager::delMaterial | ( | ShaderMaterial * | material | ) |
Forcibly remove the material from the map.
Consider using cleanup instead.
Definition at line 96 of file materialman.cpp.
References _resourceMap, delResource(), and Graphics::Shader::ShaderMaterial::getName().
|
private |
Definition at line 116 of file materialman.cpp.
References _resourceMap.
Referenced by cleanup(), and delMaterial().
ShaderMaterial * Graphics::Shader::MaterialManager::getMaterial | ( | const Common::UString & | name | ) |
Returns a material with the given name, or zero if it does not exist.
Definition at line 107 of file materialman.cpp.
References _resourceMap.
void Graphics::Shader::MaterialManager::init | ( | ) |
Initialise material management, including default material creation.
Definition at line 42 of file materialman.cpp.
References _resourceMap, Graphics::Shader::ShaderMaterial::getName(), Graphics::Shader::ShaderMaterial::getVariableData(), Graphics::Shader::SHADER_FRAGMENT, ShaderMan, and status().
|
private |
Definition at line 64 of file materialman.h.
Referenced by addMaterial(), cleanup(), deinit(), delMaterial(), delResource(), getMaterial(), and init().