![]() |
VR-Forces Developer's Guide
|
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl contexts.
Background: VAO's cannot be shared between OpenGL contexts. This class helps manage that situation by creating and tracking VAO handles for each unique context.
Basically, the user should call getOrCreateVao with a graphics context active (typically during draw) to get a handle for a VAO for that specific graphics context.
getOrCreateVao will indicate if a new context was encountered and at that time the user should bind buffers associated with the VAO (to record the vao)
When the VAO is no longer needed (for example, during shutdown), clearVaos should be called See DtWeatherLightning, DtWeatherPrecipitationShaft for examples of how to use this class
Public Member Functions | |
| DtGlVaoManager (makVrv::DtDe &de) | |
| virtual | ~DtGlVaoManager () |
| virtual unsigned int | getOrCreateVao (bool &created) |
| virtual void | clearVaos (void) |
Protected Member Functions | |
| virtual void | slot_contextAboutToBeDestroyed (const void *glContext) |
| virtual void | deleteVao (const void *glContext) |
Protected Attributes | |
| DtDe & | myDe |
| DtSignalConnectionManager | myConnections |
| std::unordered_map< const void *, DtGlVaoAndContext > | myGlContextToVao |
| DtOsgToGlContextTracker & | myOsgToGlContextTracker |
| DtIndirectLog & | myIndirectLog |
| DtGlDeleteObjectManager & | myGlDeleteObjectManager |
Private Member Functions | |
| DtGlVaoManager ()=delete | |
| DtGlVaoManager (const DtGlVaoManager &)=delete | |
| DtGlVaoManager & | operator= (const DtGlVaoManager &)=delete |
| makVrv::DtGlVaoManager::DtGlVaoManager | ( | makVrv::DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
privatedelete |
not allowed
get or create a vao for the current context
|
virtual |
Clear vaos for all contexts This will: -immediately delete the vao in the current context -add the vaos in other contexts to the queue for delete manager.
|
protectedvirtual |
slot for when a context is about to be destroyed This is used to delete the vao
|
protectedvirtual |
internal
|
protected |
|
protected |
for handling context destroyed event
|
protected |
|
protected |
|
protected |
|
protected |