VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtGlVaoManager Class Reference

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

DtDemyDe
 
DtSignalConnectionManager myConnections
 
std::unordered_map< const void
*, DtGlVaoAndContext
myGlContextToVao
 
DtOsgToGlContextTrackermyOsgToGlContextTracker
 
DtIndirectLogmyIndirectLog
 
DtGlDeleteObjectManagermyGlDeleteObjectManager
 

Private Member Functions

 DtGlVaoManager ()=delete
 
 DtGlVaoManager (const DtGlVaoManager &)=delete
 
DtGlVaoManageroperator= (const DtGlVaoManager &)=delete
 

Constructor & Destructor Documentation

makVrv::DtGlVaoManager::DtGlVaoManager ( makVrv::DtDe de)

CTOR.

virtual makVrv::DtGlVaoManager::~DtGlVaoManager ( )
virtual

DTOR.

makVrv::DtGlVaoManager::DtGlVaoManager ( )
privatedelete

not allowed

makVrv::DtGlVaoManager::DtGlVaoManager ( const DtGlVaoManager )
privatedelete

not allowed

Member Function Documentation

DtGlVaoManager& makVrv::DtGlVaoManager::operator= ( const DtGlVaoManager )
privatedelete

not allowed

virtual unsigned int makVrv::DtGlVaoManager::getOrCreateVao ( bool created)
virtual

get or create a vao for the current context

virtual void makVrv::DtGlVaoManager::clearVaos ( void  )
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.

virtual void makVrv::DtGlVaoManager::slot_contextAboutToBeDestroyed ( const void *  glContext)
protectedvirtual

slot for when a context is about to be destroyed This is used to delete the vao

virtual void makVrv::DtGlVaoManager::deleteVao ( const void *  glContext)
protectedvirtual

internal

Member Data Documentation

DtDe& makVrv::DtGlVaoManager::myDe
protected
DtSignalConnectionManager makVrv::DtGlVaoManager::myConnections
protected

for handling context destroyed event

std::unordered_map<const void*, DtGlVaoAndContext> makVrv::DtGlVaoManager::myGlContextToVao
protected
DtOsgToGlContextTracker& makVrv::DtGlVaoManager::myOsgToGlContextTracker
protected
DtIndirectLog& makVrv::DtGlVaoManager::myIndirectLog
protected
DtGlDeleteObjectManager& makVrv::DtGlVaoManager::myGlDeleteObjectManager
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)