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:
@@ -101,6 +101,8 @@ public:
|
||||
|
||||
void flushAllTextureObjects(unsigned int contextID);
|
||||
|
||||
void discardAllTextureObjects(unsigned int contextID);
|
||||
|
||||
void flushTextureObjects(unsigned int contextID,double currentTime, double& availableTime);
|
||||
|
||||
void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; }
|
||||
@@ -238,6 +240,14 @@ void TextureObjectManager::flushAllTextureObjects(unsigned int contextID)
|
||||
tol.clear();
|
||||
}
|
||||
|
||||
void TextureObjectManager::discardAllTextureObjects(unsigned int contextID)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
|
||||
Texture::TextureObjectList& tol = _textureObjectListMap[contextID];
|
||||
tol.clear();
|
||||
}
|
||||
|
||||
void TextureObjectManager::flushTextureObjects(unsigned int contextID,double currentTime, double& availableTime)
|
||||
{
|
||||
// if no time available don't try to flush objects.
|
||||
@@ -334,6 +344,11 @@ void Texture::flushAllDeletedTextureObjects(unsigned int contextID)
|
||||
if (getTextureObjectManager()) getTextureObjectManager()->flushAllTextureObjects(contextID);
|
||||
}
|
||||
|
||||
void Texture::discardAllDeletedTextureObjects(unsigned int contextID)
|
||||
{
|
||||
if (getTextureObjectManager()) getTextureObjectManager()->discardAllTextureObjects(contextID);
|
||||
}
|
||||
|
||||
void Texture::flushDeletedTextureObjects(unsigned int contextID,double currentTime, double& availbleTime)
|
||||
{
|
||||
if (getTextureObjectManager()) getTextureObjectManager()->flushTextureObjects(contextID, currentTime, availbleTime);
|
||||
|
||||
Reference in New Issue
Block a user