Manages OpenGL resources.  
 More...
#include <mlGLResourceManager.h>
 | 
|   | GLResourceManager () | 
|   | 
| virtual  | ~GLResourceManager () | 
|   | 
| bool  | isContextActive () const | 
|   | Checks whether the current context is active.  
  | 
|   | 
| void  | destroyTextures (int num, GLuint *textures) | 
|   | Destroys the given texture IDs (destroys them later if no GL context is currently active).  
  | 
|   | 
| void  | destroyFragmentProgramARB (GLuint program) | 
|   | Destroys the given fragment program ID (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyRenderBuffer (GLuint id) | 
|   | Destroys the given render buffer (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyFrameBuffer (GLuint id) | 
|   | Destroys the given render buffer (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyBuffer (GLuint id) | 
|   | Destroys the given vertex buffer (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyPixelBuffer (GLuint id) | 
|   | Destroys the given pixel buffer (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyVertexBuffer (GLuint id) | 
|   | Destroys the given pixel buffer (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyGLSLShader (GLuint id) | 
|   | Destroys the given shader (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyGLSLProgram (GLuint id) | 
|   | Destroys the given program (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | destroyFTFont (FTFont *font) | 
|   | Destroys the given font (destroys it later if no GL context is currently active).  
  | 
|   | 
| void  | detachGLSLShader (GLuint program, GLuint shader) | 
|   | Detaches the given shader from the program (this is done later of the GL context is not currently active).  
  | 
|   | 
| void  | disableGLSLProgram () | 
|   | Removes currently active program.  
  | 
|   | 
| void  | unlockContext (unsigned int cacheContextId) | 
|   | Sets that the context is active.  
  | 
|   | 
| void  | lockContext () | 
|   | Sets that the context is locked.  
  | 
|   | 
| unsigned int  | cacheContextID () | 
|   | Returns the current cache context ID.  
  | 
|   | 
| GLenum  | getGLError () const | 
|   | Checks for OpenGL error (returns GL_INVALID_OPERATION if there is no valid OpenGL context).  
  | 
|   | 
Manages OpenGL resources. 
Definition at line 28 of file mlGLResourceManager.h.
 
◆ GLSLProgramShaderPair
◆ GLResourceManager()
      
        
          | GLResourceManager::GLResourceManager  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ ~GLResourceManager()
  
  
      
        
          | virtual GLResourceManager::~GLResourceManager  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
 
◆ add()
◆ addResource()
  
  
      
        
          | void GLResourceManager::addResource  | 
          ( | 
          GLResource *  | 
          program | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ cacheContextID()
  
  
      
        
          | unsigned int GLResourceManager::cacheContextID  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ cleanup()
  
  
      
        
          | static void GLResourceManager::cleanup  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ contextDestroyed()
  
  
      
        
          | void GLResourceManager::contextDestroyed  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Forgets about all resources; the shared context was destroyed. 
 
 
◆ destroyBuffer()
      
        
          | void GLResourceManager::destroyBuffer  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
        
      
 
Destroys the given vertex buffer (destroys it later if no GL context is currently active). 
 
 
◆ destroyFragmentProgramARB()
      
        
          | void GLResourceManager::destroyFragmentProgramARB  | 
          ( | 
          GLuint  | 
          program | ) | 
           | 
        
      
 
Destroys the given fragment program ID (destroys it later if no GL context is currently active). 
 
 
◆ destroyFrameBuffer()
      
        
          | void GLResourceManager::destroyFrameBuffer  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
        
      
 
Destroys the given render buffer (destroys it later if no GL context is currently active). 
 
 
◆ destroyFTFont()
      
        
          | void GLResourceManager::destroyFTFont  | 
          ( | 
          FTFont *  | 
          font | ) | 
           | 
        
      
 
Destroys the given font (destroys it later if no GL context is currently active). 
 
 
◆ destroyGLSLProgram()
      
        
          | void GLResourceManager::destroyGLSLProgram  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
        
      
 
Destroys the given program (destroys it later if no GL context is currently active). 
 
 
◆ destroyGLSLShader()
      
        
          | void GLResourceManager::destroyGLSLShader  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
        
      
 
Destroys the given shader (destroys it later if no GL context is currently active). 
 
 
◆ destroyPixelBuffer()
  
  
      
        
          | void GLResourceManager::destroyPixelBuffer  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Destroys the given pixel buffer (destroys it later if no GL context is currently active). 
Definition at line 57 of file mlGLResourceManager.h.
 
 
◆ destroyRenderBuffer()
      
        
          | void GLResourceManager::destroyRenderBuffer  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
        
      
 
Destroys the given render buffer (destroys it later if no GL context is currently active). 
 
 
◆ destroyTextures()
      
        
          | void GLResourceManager::destroyTextures  | 
          ( | 
          int  | 
          num,  | 
        
        
           | 
           | 
          GLuint *  | 
          textures  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Destroys the given texture IDs (destroys them later if no GL context is currently active). 
 
 
◆ destroyVertexBuffer()
  
  
      
        
          | void GLResourceManager::destroyVertexBuffer  | 
          ( | 
          GLuint  | 
          id | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Destroys the given pixel buffer (destroys it later if no GL context is currently active). 
Definition at line 59 of file mlGLResourceManager.h.
 
 
◆ detachGLSLShader()
      
        
          | void GLResourceManager::detachGLSLShader  | 
          ( | 
          GLuint  | 
          program,  | 
        
        
           | 
           | 
          GLuint  | 
          shader  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Detaches the given shader from the program (this is done later of the GL context is not currently active). 
 
 
◆ disableGLSLProgram()
      
        
          | void GLResourceManager::disableGLSLProgram  | 
          ( | 
           | ) | 
           | 
        
      
 
Removes currently active program. 
 
 
◆ freeResources()
  
  
      
        
          | void GLResourceManager::freeResources  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Frees resources that could not be destroyed earlier. 
 
 
◆ getGLError()
      
        
          | GLenum GLResourceManager::getGLError  | 
          ( | 
           | ) | 
           const | 
        
      
 
Checks for OpenGL error (returns GL_INVALID_OPERATION if there is no valid OpenGL context). 
 
 
◆ init()
  
  
      
        
          | static void GLResourceManager::init  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ isContextActive()
  
  
      
        
          | bool GLResourceManager::isContextActive  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ lockContext()
      
        
          | void GLResourceManager::lockContext  | 
          ( | 
           | ) | 
           | 
        
      
 
Sets that the context is locked. 
 
 
◆ remove()
◆ removeResource()
  
  
      
        
          | void GLResourceManager::removeResource  | 
          ( | 
          GLResource *  | 
          program | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Removes the given resource. 
 
 
◆ self()
◆ unlockContext()
      
        
          | void GLResourceManager::unlockContext  | 
          ( | 
          unsigned int  | 
          cacheContextId | ) | 
           | 
        
      
 
Sets that the context is active. 
 
 
◆ GLResource
◆ _buffersToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_buffersToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _cacheContextID
  
  
      
        
          | unsigned int GLResourceManager::_cacheContextID | 
         
       
   | 
  
protected   | 
  
 
 
◆ _contextLocked
  
  
      
        
          | bool GLResourceManager::_contextLocked | 
         
       
   | 
  
protected   | 
  
 
 
◆ _frameBuffersToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_frameBuffersToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _FTFontsToFree
  
  
      
        
          | std::vector<FTFont*> GLResourceManager::_FTFontsToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _GLSLProgramsToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_GLSLProgramsToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _GLSLShadersToDetach
◆ _GLSLShadersToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_GLSLShadersToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _programsARBToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_programsARBToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _renderBuffersToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_renderBuffersToFree | 
         
       
   | 
  
protected   | 
  
 
 
◆ _resources
◆ _self
◆ _texturesToFree
  
  
      
        
          | std::vector<GLuint> GLResourceManager::_texturesToFree | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: