Equalizer  2.0.0
Parallel Rendering Framework
eq::util::ObjectManager Class Reference

A facility class to manage OpenGL objects across shared contexts. More...

#include <objectManager.h>

+ Collaboration diagram for eq::util::ObjectManager:

Public Types

enum  { INVALID = 0 }
 

Public Member Functions

EQ_API ObjectManager (const GLEWContext *const glewContext)
 Construct a new object manager. More...
 
EQ_API ObjectManager (const ObjectManager &shared)
 Construct a new object manager sharing data with another manager. More...
 
virtual EQ_API ~ObjectManager ()
 Destruct this object manager. More...
 
ObjectManageroperator= (const ObjectManager &rhs)
 
EQ_API bool isShared () const
 
EQ_API void clear ()
 Reset the object manager. More...
 
EQ_API void deleteAll ()
 Delete all managed objects and associated GL objects. More...
 
EQ_API unsigned getList (const void *key) const
 
EQ_API unsigned newList (const void *key, const int num=1)
 
EQ_API unsigned obtainList (const void *key, const int num=1)
 
EQ_API void deleteList (const void *key)
 
EQ_API unsigned getVertexArray (const void *key) const
 
EQ_API unsigned newVertexArray (const void *key)
 
EQ_API unsigned obtainVertexArray (const void *key)
 
EQ_API void deleteVertexArray (const void *key)
 
EQ_API unsigned getTexture (const void *key) const
 
EQ_API unsigned newTexture (const void *key)
 
EQ_API unsigned obtainTexture (const void *key)
 
EQ_API void deleteTexture (const void *key)
 
EQ_API bool supportsBuffers () const
 
EQ_API unsigned getBuffer (const void *key) const
 
EQ_API unsigned newBuffer (const void *key)
 
EQ_API unsigned obtainBuffer (const void *key)
 
EQ_API void deleteBuffer (const void *key)
 
EQ_API bool supportsPrograms () const
 
EQ_API unsigned getProgram (const void *key) const
 
EQ_API unsigned newProgram (const void *key)
 
EQ_API unsigned obtainProgram (const void *key)
 
EQ_API void deleteProgram (const void *key)
 
EQ_API bool supportsShaders () const
 
EQ_API unsigned getShader (const void *key) const
 
EQ_API unsigned newShader (const void *key, const unsigned type)
 
EQ_API unsigned obtainShader (const void *key, const unsigned type)
 
EQ_API void deleteShader (const void *key)
 
EQ_API AccumgetEqAccum (const void *key) const
 
EQ_API AccumnewEqAccum (const void *key)
 
EQ_API AccumobtainEqAccum (const void *key)
 
EQ_API void deleteEqAccum (const void *key)
 
EQ_API pression::Uploader * getEqUploader (const void *key) const
 
EQ_API pression::Uploader * newEqUploader (const void *key)
 
EQ_API pression::Uploader * obtainEqUploader (const void *key)
 
EQ_API void deleteEqUploader (const void *key)
 
EQ_API bool supportsEqTexture () const
 
EQ_API TexturegetEqTexture (const void *key) const
 
EQ_API TexturenewEqTexture (const void *key, const unsigned target)
 
EQ_API TextureobtainEqTexture (const void *key, const unsigned target)
 
EQ_API void deleteEqTexture (const void *key)
 
EQ_API bool supportsEqFrameBufferObject () const
 
EQ_API FrameBufferObjectgetEqFrameBufferObject (const void *key) const
 
EQ_API FrameBufferObjectnewEqFrameBufferObject (const void *key)
 
EQ_API FrameBufferObjectobtainEqFrameBufferObject (const void *key)
 
EQ_API void deleteEqFrameBufferObject (const void *key)
 
EQ_API bool supportsEqPixelBufferObject () const
 
EQ_API PixelBufferObjectgetEqPixelBufferObject (const void *key) const
 
EQ_API PixelBufferObjectnewEqPixelBufferObject (const void *key, const bool threadSafe)
 
EQ_API PixelBufferObjectobtainEqPixelBufferObject (const void *key, const bool threadSafe)
 
EQ_API void deleteEqPixelBufferObject (const void *key)
 
EQ_API util::BitmapFontgetEqBitmapFont (const void *key) const
 
EQ_API util::BitmapFontnewEqBitmapFont (const void *key)
 
EQ_API util::BitmapFontobtainEqBitmapFont (const void *key)
 
EQ_API void deleteEqBitmapFont (const void *key)
 
EQ_API const GLEWContext * glewGetContext () const
 

Detailed Description

A facility class to manage OpenGL objects across shared contexts.

The object manager implements object sharing in the same way as OpenGL. During creation, a shared object manager may be given, causing the two (or more) object managers to allocate objects from the same namespace. The last object manager will delete all data allocated on the host. OpenGL objects have to be explictly deleted using deleteAll() to ensure an OpenGL context is still current during destruction.

For each type of OpenGL object supported the following methods are available:

  • supportsObject: Check if the necessary OpenGL version or extension is present
  • getObject: Lookup an existing object, may return 0
  • newObject: Allocate new object, returns false if key exists
  • obtainObject: Lookup or allocate an object for the given key
  • deleteObject: Delete the object of the given key and all associated OpenGL data
See also
http://www.equalizergraphics.com/documents/design/objectManager.html

Definition at line 53 of file objectManager.h.

Constructor & Destructor Documentation

EQ_API eq::util::ObjectManager::ObjectManager ( const GLEWContext *const  glewContext)
explicit

Construct a new object manager.

EQ_API eq::util::ObjectManager::ObjectManager ( const ObjectManager shared)

Construct a new object manager sharing data with another manager.

virtual EQ_API eq::util::ObjectManager::~ObjectManager ( )
virtual

Destruct this object manager.

Member Function Documentation

EQ_API void eq::util::ObjectManager::clear ( )

Reset the object manager.

deleteAll() should be called beforehand.

EQ_API void eq::util::ObjectManager::deleteAll ( )

Delete all managed objects and associated GL objects.

Requires current GL context.

EQ_API bool eq::util::ObjectManager::isShared ( ) const
Returns
true if more than one OM is using the same data.

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