Added releaseGLObjects to NodeCallbacks, Drawable::DrawCallbacks and wired up

osgProducer to use it when doing cleanup_frame.
This commit is contained in:
Robert Osfield
2006-10-02 15:38:31 +00:00
parent 02783e1dfd
commit e0599f652e
12 changed files with 81 additions and 8 deletions

View File

@@ -276,20 +276,29 @@ void SimpleViewer::frameDrawTraversal()
}
}
void SimpleViewer::cleanup()
void SimpleViewer::releaseAllGLObjects()
{
for(EventHandlers::iterator hitr = _eventHandlers.begin();
hitr != _eventHandlers.end();
++hitr)
{
(*hitr)->releaseGLObjects(_sceneView->getState());
}
if (_databasePager.valid())
{
// clear the database pager so its starts a fresh on the next update/cull/draw traversals
_databasePager->clear();
// release the GL objects stored in the scene graph.
_sceneView->releaseAllGLObjects();
// do a flush to delete all the OpenGL objects that have been deleted or released from the scene graph.
_sceneView->flushAllDeletedGLObjects();
}
// release the GL objects stored in the scene graph.
_sceneView->releaseAllGLObjects();
}
void SimpleViewer::cleanup()
{
releaseAllGLObjects();
// do a flush to delete all the OpenGL objects that have been deleted or released from the scene graph.
_sceneView->flushAllDeletedGLObjects();
}