xoreos
0.0.5
|
The surface manager. More...
#include <surfaceman.h>
Public Member Functions | |
SurfaceManager () | |
~SurfaceManager () | |
void | init () |
Initialise surface management, including default surface creation. More... | |
void | deinit () |
Deinitialise surface management subsystem. More... | |
void | cleanup () |
Remove any resource that has a usage count of zero. More... | |
void | addSurface (ShaderSurface *surface) |
Adds a surface to be managed. More... | |
void | delSurface (ShaderSurface *surface) |
Forcibly remove the surface from the map. More... | |
ShaderSurface * | getSurface (const Common::UString &name) |
Returns a surface with the given name, or zero if it does not exist. More... | |
Private Member Functions | |
std::map< Common::UString, ShaderSurface * >::iterator | delResource (std::map< Common::UString, ShaderSurface *>::iterator iter) |
Private Attributes | |
std::map< Common::UString, ShaderSurface * > | _resourceMap |
Additional Inherited Members | |
Static Public Member Functions inherited from Common::Singleton< SurfaceManager > | |
static SurfaceManager & | instance () |
static void | destroy () |
Protected Types inherited from Common::Singleton< SurfaceManager > | |
typedef SurfaceManager | SingletonBaseType |
Protected Member Functions inherited from Common::Singleton< SurfaceManager > | |
Singleton () | |
virtual | ~Singleton () |
The surface manager.
Definition at line 41 of file surfaceman.h.
Graphics::Shader::SurfaceManager::SurfaceManager | ( | ) |
Definition at line 35 of file surfaceman.cpp.
References _resourceMap, Graphics::Shader::ShaderSurface::getName(), Graphics::Shader::SHADER_VERTEX, and ShaderMan.
Graphics::Shader::SurfaceManager::~SurfaceManager | ( | ) |
Definition at line 46 of file surfaceman.cpp.
References deinit().
void Graphics::Shader::SurfaceManager::addSurface | ( | ShaderSurface * | surface | ) |
Adds a surface to be managed.
Cleanup will delete the surface if usage count is zero.
Definition at line 74 of file surfaceman.cpp.
References _resourceMap, and Graphics::Shader::ShaderSurface::getName().
void Graphics::Shader::SurfaceManager::cleanup | ( | ) |
Remove any resource that has a usage count of zero.
Definition at line 61 of file surfaceman.cpp.
References _resourceMap, delResource(), and Graphics::Shader::ShaderSurface::useCount().
void Graphics::Shader::SurfaceManager::deinit | ( | ) |
Deinitialise surface management subsystem.
Definition at line 54 of file surfaceman.cpp.
References _resourceMap.
Referenced by ~SurfaceManager().
|
private |
Definition at line 105 of file surfaceman.cpp.
References _resourceMap.
Referenced by cleanup(), and delSurface().
void Graphics::Shader::SurfaceManager::delSurface | ( | ShaderSurface * | surface | ) |
Forcibly remove the surface from the map.
Consider using cleanup instead.
Definition at line 85 of file surfaceman.cpp.
References _resourceMap, delResource(), and Graphics::Shader::ShaderSurface::getName().
ShaderSurface * Graphics::Shader::SurfaceManager::getSurface | ( | const Common::UString & | name | ) |
Returns a surface with the given name, or zero if it does not exist.
Definition at line 96 of file surfaceman.cpp.
References _resourceMap.
void Graphics::Shader::SurfaceManager::init | ( | ) |
Initialise surface management, including default surface creation.
Definition at line 50 of file surfaceman.cpp.
References status().
|
private |
Definition at line 64 of file surfaceman.h.
Referenced by addSurface(), cleanup(), deinit(), delResource(), delSurface(), getSurface(), and SurfaceManager().