Introduced new osg::discardDeletedOpenGLObjects() methods, and usage of it in

GrpahicsContext::close() to handle cases where deletingOpenGLObjects is no possible,
such as when GraphicsWindowEmbedded is used.
This commit is contained in:
Robert Osfield
2008-01-08 13:24:29 +00:00
parent f3448d3307
commit ff565128af
27 changed files with 216 additions and 29 deletions

View File

@@ -48,8 +48,6 @@ void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
}
}
/** flush all the cached display list which need to be deleted
* in the OpenGL context related to contextID.*/
void BufferObject::flushDeletedBufferObjects(unsigned int contextID,double /*currentTime*/, double& availableTime)
{
// if no time available don't try to flush objects.
@@ -86,6 +84,13 @@ void BufferObject::flushDeletedBufferObjects(unsigned int contextID,double /*cur
availableTime -= elapsedTime;
}
void BufferObject::discardDeletedBufferObjects(unsigned int contextID)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_mutex_deletedBufferObjectCache);
DisplayListMap& dll = s_deletedBufferObjectCache[contextID];
dll.clear();
}
BufferObject::BufferObject():
_target(0),