Equalizer logo
Collage logo
GPU-SD logo

OpenGL Object Manager

Author: eilemann@gmail.com
State:

Overview

The purpose of the object manager is to facilitate the management of OpenGL objects, e.g., texture IDs and display lists, in a multipipe application. Objects are allocated and queried using a key. Windows sharing the same OpenGL context will use the same object manager.

Objects

The API will be created as needed. Possible object types are: display lists, textures, GLSL shaders, VBO's, etc. See the header file (src/lib/util/objectManager.h) for the currently implemented types.

eq::Window Object Manager

Each window has an object manager with the key type const void* for as long as it has an OpenGL context. The OM is shared between all windows of a pipe, if the windows are created using the default configInit functions. If the window is created by the application, the OM is not shared since no assumption can be made about OpenGL context sharing.

API

For each type of object, the following functions are available:

Example API for display list management:

  template< typename T >
  class ObjectManager : public eq::base::NonCopyable
  {
  public:
      GLuint getList( const T& key );
      GLuint newList( const T& key );
      GLuint obtainList( const T& key );
      void releaseList( const T& key );
      void releaseList( const GLuint id );
      void deleteList( const T& key );
      void deleteList( const GLuint list );
  }

  typedef ObjectManager< const char* > ObjectManagerS;
  ObjectManagerS& eq::Window::getObjectManager();