#include <mlGLResourceManager.h>
Classes | |
| class | GLResourceList |
| Dynamic list of GLResource objects. More... | |
Public Member Functions | |
| GLResourceManager () | |
| virtual | ~GLResourceManager () |
| bool | isContextActive () const |
| check if the current context is ac | |
| void | destroyTextures (int num, GLuint *textures) |
| destroy the given texture ids (destroys them later if no GL context is currently active) | |
| void | destroyFragmentProgramARB (GLuint program) |
| destroy the given fragment program id (destroys it later if no GL context is currently active) | |
| void | destroyRenderBuffer (GLuint id) |
| destroy the given render buffer (destroys it later if no GL context is currently active) | |
| void | destroyFrameBuffer (GLuint id) |
| destroy the given render buffer (destroys it later if no GL context is currently active) | |
| void | destroyVertexBuffer (GLuint id) |
| destroy the given vertex buffer (destroys it later if no GL context is currently active) | |
| void | destroyPixelBuffer (GLuint id) |
| destroy the given pixel buffer (destroys it later if no GL context is currently active) | |
| void | destroyDisplayList (GLuint id) |
| destroy the given display list (destroys it later if no GL context is currently active) | |
| void | destroyGLSLShader (GLuint id) |
| destroy the given shader (destroys it later if no GL context is currently active) | |
| void | destroyGLSLProgram (GLuint id) |
| destroy the given program (destroys it later if no GL context is currently active) | |
| void | destroyFTFont (FTFont *font) |
| destroy the given font (destroys it later if no GL context is currently active) | |
| void | detachGLSLShader (GLuint program, GLuint shader) |
| detach the given shader from the program (this is done later of the GL context is not currently active) | |
| void | disableGLSLProgram () |
| remove currently active program | |
| void | unlockContext (unsigned int cacheContextId) |
| set that the context is active | |
| void | lockContext () |
| set that the context is locked | |
| GLenum | getGLError () const |
| check for OpenGL error (returns GL_INVALID_OPERATION if there is no valid OpenGL context) | |
Static Public Member Functions | |
| static void | init () |
| create singleton | |
| static void | cleanup () |
| destroy singleton | |
| static GLResourceManager * | self () |
| get singleton instance | |
Protected Types | |
| typedef std::pair< GLuint, GLuint > | GLSLProgramShaderPair |
Protected Member Functions | |
| void | addResource (GLResource *program) |
| add the given resource | |
| void | removeResource (GLResource *program) |
| remove the given resource | |
| void | contextDestroyed () |
| forget about all resources, the shared context was destroyed | |
| void | freeResources () |
| free resources that could not be destroyed earlier | |
| void | add (GLResourceList &list, GLResource *resource) |
| void | remove (GLResourceList &list, GLResource *resource) |
Protected Attributes | |
| bool | _contextLocked |
| unsigned int | _cacheContextID |
| GLResourceList | _resources |
| std::vector< GLuint > | _texturesToFree |
| std::vector< GLuint > | _programsARBToFree |
| std::vector< GLuint > | _frameBuffersToFree |
| std::vector< GLuint > | _renderBuffersToFree |
| std::vector< GLuint > | _vertexBuffersToFree |
| std::vector< GLuint > | _pixelBuffersToFree |
| std::vector< GLuint > | _displayListsToFree |
| std::vector< GLuint > | _GLSLProgramsToFree |
| std::vector< GLuint > | _GLSLShadersToFree |
| std::vector < GLSLProgramShaderPair > | _GLSLShadersToDetach |
| std::vector< FTFont * > | _FTFontsToFree |
Static Protected Attributes | |
| static GLResourceManager * | _self |
Friends | |
| class | GLResource |
Definition at line 24 of file mlGLResourceManager.h.
typedef std::pair<GLuint, GLuint> GLResourceManager::GLSLProgramShaderPair [protected] |
Definition at line 110 of file mlGLResourceManager.h.
| GLResourceManager::GLResourceManager | ( | ) |
| virtual GLResourceManager::~GLResourceManager | ( | ) | [virtual] |
| void GLResourceManager::add | ( | GLResourceList & | list, | |
| GLResource * | resource | |||
| ) | [protected] |
| void GLResourceManager::addResource | ( | GLResource * | program | ) | [protected] |
add the given resource
| static void GLResourceManager::cleanup | ( | ) | [static] |
destroy singleton
| void GLResourceManager::contextDestroyed | ( | ) | [protected] |
forget about all resources, the shared context was destroyed
| void GLResourceManager::destroyDisplayList | ( | GLuint | id | ) |
destroy the given display list (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyFragmentProgramARB | ( | GLuint | program | ) |
destroy the given fragment program id (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyFrameBuffer | ( | GLuint | id | ) |
destroy the given render buffer (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyFTFont | ( | FTFont * | font | ) |
destroy the given font (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyGLSLProgram | ( | GLuint | id | ) |
destroy the given program (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyGLSLShader | ( | GLuint | id | ) |
destroy the given shader (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyPixelBuffer | ( | GLuint | id | ) |
destroy the given pixel buffer (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyRenderBuffer | ( | GLuint | id | ) |
destroy the given render buffer (destroys it later if no GL context is currently active)
| void GLResourceManager::destroyTextures | ( | int | num, | |
| GLuint * | textures | |||
| ) |
destroy the given texture ids (destroys them later if no GL context is currently active)
| void GLResourceManager::destroyVertexBuffer | ( | GLuint | id | ) |
destroy the given vertex buffer (destroys it later if no GL context is currently active)
| void GLResourceManager::detachGLSLShader | ( | GLuint | program, | |
| GLuint | shader | |||
| ) |
detach the given shader from the program (this is done later of the GL context is not currently active)
| void GLResourceManager::disableGLSLProgram | ( | ) |
remove currently active program
| void GLResourceManager::freeResources | ( | ) | [protected] |
free resources that could not be destroyed earlier
| GLenum GLResourceManager::getGLError | ( | ) | const |
| static void GLResourceManager::init | ( | ) | [static] |
create singleton
| bool GLResourceManager::isContextActive | ( | ) | const [inline] |
| void GLResourceManager::lockContext | ( | ) |
set that the context is locked
| void GLResourceManager::remove | ( | GLResourceList & | list, | |
| GLResource * | resource | |||
| ) | [protected] |
| void GLResourceManager::removeResource | ( | GLResource * | program | ) | [protected] |
remove the given resource
| static GLResourceManager* GLResourceManager::self | ( | ) | [inline, static] |
| void GLResourceManager::unlockContext | ( | unsigned int | cacheContextId | ) |
set that the context is active
friend class GLResource [friend] |
Definition at line 103 of file mlGLResourceManager.h.
unsigned int GLResourceManager::_cacheContextID [protected] |
Definition at line 106 of file mlGLResourceManager.h.
bool GLResourceManager::_contextLocked [protected] |
Definition at line 105 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_displayListsToFree [protected] |
Definition at line 118 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_frameBuffersToFree [protected] |
Definition at line 114 of file mlGLResourceManager.h.
std::vector<FTFont*> GLResourceManager::_FTFontsToFree [protected] |
Definition at line 122 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_GLSLProgramsToFree [protected] |
Definition at line 119 of file mlGLResourceManager.h.
std::vector<GLSLProgramShaderPair> GLResourceManager::_GLSLShadersToDetach [protected] |
Definition at line 121 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_GLSLShadersToFree [protected] |
Definition at line 120 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_pixelBuffersToFree [protected] |
Definition at line 117 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_programsARBToFree [protected] |
Definition at line 113 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_renderBuffersToFree [protected] |
Definition at line 115 of file mlGLResourceManager.h.
GLResourceList GLResourceManager::_resources [protected] |
Definition at line 108 of file mlGLResourceManager.h.
GLResourceManager* GLResourceManager::_self [static, protected] |
Definition at line 124 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_texturesToFree [protected] |
Definition at line 112 of file mlGLResourceManager.h.
std::vector<GLuint> GLResourceManager::_vertexBuffersToFree [protected] |
Definition at line 116 of file mlGLResourceManager.h.
1.5.8