osg::GLBufferObjectManager Class Reference

`#include <BufferObject>`

Inheritance diagram for osg::GLBufferObjectManager:

## Public Member Functions

| GLBufferObjectManager (unsigned int contextID)
void | setNumberActiveGLBufferObjects (unsigned int size)
unsigned int & | getNumberActiveGLBufferObjects ()
unsigned int | getNumberActiveGLBufferObjects () const
void | setNumberOrphanedGLBufferObjects (unsigned int size)
unsigned int & | getNumberOrphanedGLBufferObjects ()
unsigned int | getNumberOrphanedGLBufferObjects () const
void | setCurrGLBufferObjectPoolSize (unsigned int size)
unsigned int & | getCurrGLBufferObjectPoolSize ()
unsigned int | getCurrGLBufferObjectPoolSize () const
void | setMaxGLBufferObjectPoolSize (unsigned int size)
unsigned int | getMaxGLBufferObjectPoolSize () const
bool | hasSpace (unsigned int size) const
bool | makeSpace (unsigned int size)
osg::ref_ptr< GLBufferObject > | generateGLBufferObject (const osg::BufferObject *bufferObject)
void | handlePendingOrphandedGLBufferObjects ()
void | deleteAllGLObjects ()
void | discardAllGLObjects ()
void | flushAllDeletedGLObjects ()
void | discardAllDeletedGLObjects ()
void | flushDeletedGLObjects (double currentTime, double &availableTime)
GLBufferObjectSet * | getGLBufferObjectSet (const BufferObjectProfile &profile)
void | newFrame (osg::FrameStamp *fs)
void | resetStats ()
void | reportStats (std::ostream &out)
void | recomputeStats (std::ostream &out) const
unsigned int & | getFrameNumber ()
unsigned int & | getNumberFrames ()
unsigned int & | getNumberDeleted ()
double & | getDeleteTime ()
unsigned int & | getNumberGenerated ()
double & | getGenerateTime ()
unsigned int & | getNumberApplied ()
double & | getApplyTime ()
Public Member Functions inherited from osg::GraphicsObjectManager
| GraphicsObjectManager (const std::string &name, unsigned int contextID)
unsigned int | getContextID () const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Types

typedef std::map< BufferObjectProfile, osg::ref_ptr< GLBufferObjectSet > > | GLBufferObjectSetMap

## Protected Member Functions

virtual | ~GLBufferObjectManager ()
Protected Member Functions inherited from osg::GraphicsObjectManager
virtual | ~GraphicsObjectManager ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

unsigned int | _numActiveGLBufferObjects
unsigned int | _numOrphanedGLBufferObjects
unsigned int | _currGLBufferObjectPoolSize
unsigned int | _maxGLBufferObjectPoolSize
GLBufferObjectSetMap | _glBufferObjectSetMap
unsigned int | _frameNumber
unsigned int | _numFrames
unsigned int | _numDeleted
double | _deleteTime
unsigned int | _numGenerated
double | _generateTime
unsigned int | _numApplied
double | _applyTime
Protected Attributes inherited from osg::GraphicsObjectManager
std::string | _name
unsigned int | _contextID
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Member Typedef Documentation

## GLBufferObjectSetMap

typedef std::map< BufferObjectProfile, osg::ref_ptr<GLBufferObjectSet> > osg::GLBufferObjectManager::GLBufferObjectSetMap

protected

## Constructor & Destructor Documentation

## GLBufferObjectManager()

osg::GLBufferObjectManager::GLBufferObjectManager | ( | unsigned int | contextID | ) |

## ~GLBufferObjectManager()

virtual osg::GLBufferObjectManager::~GLBufferObjectManager | ( |  | ) |

protected virtual

## Member Function Documentation

## deleteAllGLObjects()

void osg::GLBufferObjectManager::deleteAllGLObjects | ( |  | ) |

virtual

Do a GL delete all OpenGL objects. Note, must be called from a thread which has current the graphics context associated with contextID.

Implements osg::GraphicsObjectManager.

## discardAllDeletedGLObjects()

void osg::GLBufferObjectManager::discardAllDeletedGLObjects | ( |  | ) |

## discardAllGLObjects()

void osg::GLBufferObjectManager::discardAllGLObjects | ( |  | ) |

virtual

Discard all OpenGL objects. Note, unlike deleteAllGLjects discard does not do any OpenGL calls so can be called from any thread, but as a consequence it also doesn't remove the associated OpenGL resource so discard should only be called when the associated graphics context is being/has been closed.

Implements osg::GraphicsObjectManager.

## flushAllDeletedGLObjects()

void osg::GLBufferObjectManager::flushAllDeletedGLObjects | ( |  | ) |

virtual

Flush all deleted OpenGL objects. Note, must be called from a thread which has current the graphics context associated with contextID.

Implements osg::GraphicsObjectManager.

## flushDeletedGLObjects()

void osg::GLBufferObjectManager::flushDeletedGLObjects | ( | double | currentTime,
|  | double & | availableTime )

virtual

Flush all deleted OpenGL objects within the specified availableTime. Note, must be called from a thread which has current the graphics context associated with contextID.

Implements osg::GraphicsObjectManager.

## generateGLBufferObject()

osg::ref_ptr< GLBufferObject > osg::GLBufferObjectManager::generateGLBufferObject | ( | const osg::BufferObject * | bufferObject | ) |

## getApplyTime()

double & osg::GLBufferObjectManager::getApplyTime | ( |  | ) |

inline

References _applyTime.

## getCurrGLBufferObjectPoolSize() [1/2]

unsigned int & osg::GLBufferObjectManager::getCurrGLBufferObjectPoolSize | ( |  | ) |

inline

References _currGLBufferObjectPoolSize.

## getCurrGLBufferObjectPoolSize() [2/2]

unsigned int osg::GLBufferObjectManager::getCurrGLBufferObjectPoolSize | ( |  | ) | const

inline

References _currGLBufferObjectPoolSize.

## getDeleteTime()

double & osg::GLBufferObjectManager::getDeleteTime | ( |  | ) |

inline

References _deleteTime.

## getFrameNumber()

unsigned int & osg::GLBufferObjectManager::getFrameNumber | ( |  | ) |

inline

References _frameNumber.

## getGenerateTime()

double & osg::GLBufferObjectManager::getGenerateTime | ( |  | ) |

inline

References _generateTime.

## getGLBufferObjectSet()

GLBufferObjectSet * osg::GLBufferObjectManager::getGLBufferObjectSet | ( | const BufferObjectProfile & | profile | ) |

## getMaxGLBufferObjectPoolSize()

unsigned int osg::GLBufferObjectManager::getMaxGLBufferObjectPoolSize | ( |  | ) | const

inline

References _maxGLBufferObjectPoolSize.

## getNumberActiveGLBufferObjects() [1/2]

unsigned int & osg::GLBufferObjectManager::getNumberActiveGLBufferObjects | ( |  | ) |

inline

References _numActiveGLBufferObjects.

## getNumberActiveGLBufferObjects() [2/2]

unsigned int osg::GLBufferObjectManager::getNumberActiveGLBufferObjects | ( |  | ) | const

inline

References _numActiveGLBufferObjects.

## getNumberApplied()

unsigned int & osg::GLBufferObjectManager::getNumberApplied | ( |  | ) |

inline

References _numApplied.

## getNumberDeleted()

unsigned int & osg::GLBufferObjectManager::getNumberDeleted | ( |  | ) |

inline

References _numDeleted.

## getNumberFrames()

unsigned int & osg::GLBufferObjectManager::getNumberFrames | ( |  | ) |

inline

References _numFrames.

## getNumberGenerated()

unsigned int & osg::GLBufferObjectManager::getNumberGenerated | ( |  | ) |

inline

References _numGenerated.

## getNumberOrphanedGLBufferObjects() [1/2]

unsigned int & osg::GLBufferObjectManager::getNumberOrphanedGLBufferObjects | ( |  | ) |

inline

References _numOrphanedGLBufferObjects.

## getNumberOrphanedGLBufferObjects() [2/2]

unsigned int osg::GLBufferObjectManager::getNumberOrphanedGLBufferObjects | ( |  | ) | const

inline

References _numOrphanedGLBufferObjects.

## handlePendingOrphandedGLBufferObjects()

void osg::GLBufferObjectManager::handlePendingOrphandedGLBufferObjects | ( |  | ) |

## hasSpace()

bool osg::GLBufferObjectManager::hasSpace | ( | unsigned int | size | ) | const

inline

References _currGLBufferObjectPoolSize, and _maxGLBufferObjectPoolSize.

## makeSpace()

bool osg::GLBufferObjectManager::makeSpace | ( | unsigned int | size | ) |

## newFrame()

void osg::GLBufferObjectManager::newFrame | ( | osg::FrameStamp * |  | ) |

virtual

Signal that a new frame has started.

Reimplemented from osg::GraphicsObjectManager.

## recomputeStats()

void osg::GLBufferObjectManager::recomputeStats | ( | std::ostream & | out | ) | const

virtual

Reimplemented from osg::GraphicsObjectManager.

## reportStats()

void osg::GLBufferObjectManager::reportStats | ( | std::ostream & | out | ) |

virtual

Reimplemented from osg::GraphicsObjectManager.

## resetStats()

void osg::GLBufferObjectManager::resetStats | ( |  | ) |

virtual

Reimplemented from osg::GraphicsObjectManager.

## setCurrGLBufferObjectPoolSize()

void osg::GLBufferObjectManager::setCurrGLBufferObjectPoolSize | ( | unsigned int | size | ) |

inline

References _currGLBufferObjectPoolSize.

## setMaxGLBufferObjectPoolSize()

void osg::GLBufferObjectManager::setMaxGLBufferObjectPoolSize | ( | unsigned int | size | ) |

## setNumberActiveGLBufferObjects()

void osg::GLBufferObjectManager::setNumberActiveGLBufferObjects | ( | unsigned int | size | ) |

inline

References _numActiveGLBufferObjects.

## setNumberOrphanedGLBufferObjects()

void osg::GLBufferObjectManager::setNumberOrphanedGLBufferObjects | ( | unsigned int | size | ) |

inline

References _numOrphanedGLBufferObjects.

## Member Data Documentation

## _applyTime

double osg::GLBufferObjectManager::_applyTime

protected

Referenced by getApplyTime().

## _currGLBufferObjectPoolSize

unsigned int osg::GLBufferObjectManager::_currGLBufferObjectPoolSize

protected

Referenced by getCurrGLBufferObjectPoolSize(), getCurrGLBufferObjectPoolSize(), hasSpace(), and setCurrGLBufferObjectPoolSize().

## _deleteTime

double osg::GLBufferObjectManager::_deleteTime

protected

Referenced by getDeleteTime().

## _frameNumber

unsigned int osg::GLBufferObjectManager::_frameNumber

protected

Referenced by getFrameNumber().

## _generateTime

double osg::GLBufferObjectManager::_generateTime

protected

Referenced by getGenerateTime().

## _glBufferObjectSetMap

GLBufferObjectSetMap osg::GLBufferObjectManager::_glBufferObjectSetMap

protected

## _maxGLBufferObjectPoolSize

unsigned int osg::GLBufferObjectManager::_maxGLBufferObjectPoolSize

protected

Referenced by getMaxGLBufferObjectPoolSize(), and hasSpace().

## _numActiveGLBufferObjects

unsigned int osg::GLBufferObjectManager::_numActiveGLBufferObjects

protected

Referenced by getNumberActiveGLBufferObjects(), getNumberActiveGLBufferObjects(), and setNumberActiveGLBufferObjects().

## _numApplied

unsigned int osg::GLBufferObjectManager::_numApplied

protected

Referenced by getNumberApplied().

## _numDeleted

unsigned int osg::GLBufferObjectManager::_numDeleted

protected

Referenced by getNumberDeleted().

## _numFrames

unsigned int osg::GLBufferObjectManager::_numFrames

protected

Referenced by getNumberFrames().

## _numGenerated

unsigned int osg::GLBufferObjectManager::_numGenerated

protected

Referenced by getNumberGenerated().

## _numOrphanedGLBufferObjects

unsigned int osg::GLBufferObjectManager::_numOrphanedGLBufferObjects

protected

Referenced by getNumberOrphanedGLBufferObjects(), getNumberOrphanedGLBufferObjects(), and setNumberOrphanedGLBufferObjects().

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

- BufferObject