xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Graphics::Shader::SurfaceManager Class Reference

The surface manager. More...

#include <surfaceman.h>

Inheritance diagram for Graphics::Shader::SurfaceManager:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Shader::SurfaceManager:
Collaboration graph
[legend]

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...
 
ShaderSurfacegetSurface (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 ()
 

Detailed Description

The surface manager.

Definition at line 41 of file surfaceman.h.

Constructor & Destructor Documentation

◆ SurfaceManager()

Graphics::Shader::SurfaceManager::SurfaceManager ( )

Definition at line 35 of file surfaceman.cpp.

References _resourceMap, Graphics::Shader::ShaderSurface::getName(), Graphics::Shader::SHADER_VERTEX, and ShaderMan.

Here is the call graph for this function:

◆ ~SurfaceManager()

Graphics::Shader::SurfaceManager::~SurfaceManager ( )

Definition at line 46 of file surfaceman.cpp.

References deinit().

Here is the call graph for this function:

Member Function Documentation

◆ addSurface()

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().

Here is the call graph for this function:

◆ cleanup()

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().

Here is the call graph for this function:

◆ deinit()

void Graphics::Shader::SurfaceManager::deinit ( )

Deinitialise surface management subsystem.

Definition at line 54 of file surfaceman.cpp.

References _resourceMap.

Referenced by ~SurfaceManager().

Here is the caller graph for this function:

◆ delResource()

std::map< Common::UString, ShaderSurface * >::iterator Graphics::Shader::SurfaceManager::delResource ( std::map< Common::UString, ShaderSurface *>::iterator  iter)
private

Definition at line 105 of file surfaceman.cpp.

References _resourceMap.

Referenced by cleanup(), and delSurface().

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:

◆ getSurface()

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.

◆ init()

void Graphics::Shader::SurfaceManager::init ( )

Initialise surface management, including default surface creation.

Definition at line 50 of file surfaceman.cpp.

References status().

Here is the call graph for this function:

Member Data Documentation

◆ _resourceMap

std::map<Common::UString, ShaderSurface *> Graphics::Shader::SurfaceManager::_resourceMap
private

The documentation for this class was generated from the following files: