Changed the return types of makeCurrent to bool, and added a bool GraphicsContext::releaseContext method

along with implementations in osgViewer.
This commit is contained in:
Robert Osfield
2007-01-08 19:29:59 +00:00
parent 4a5eda6522
commit 16d1c00a3d
18 changed files with 221 additions and 126 deletions

View File

@@ -218,13 +218,14 @@ void TextureObjectManager::flushAllTextureObjects(unsigned int contextID)
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
Texture::TextureObjectList& tol = _textureObjectListMap[contextID];
osg::notify(osg::NOTICE)<<"Flushing texture objects num="<<tol.size()<<" contextID="<<contextID<<std::endl;
// osg::notify(osg::INFO)<<"Flushing texture objects num="<<tol.size()<<" contextID="<<contextID<<std::endl;
for(Texture::TextureObjectList::iterator itr=tol.begin();
itr!=tol.end();
++itr)
{
osg::notify(osg::NOTICE)<<" deleting texture object "<<(*itr)->_id<<std::endl;
// osg::notify(osg::NOTICE)<<" deleting texture object "<<(*itr)->_id<<std::endl;
glDeleteTextures( 1L, &((*itr)->_id));
}
tol.clear();
@@ -1304,8 +1305,8 @@ void Texture::resizeGLObjectBuffers(unsigned int maxSize)
void Texture::releaseGLObjects(State* state) const
{
if (state) osg::notify(osg::NOTICE)<<"Texture::releaseGLObjects contextID="<<state->getContextID()<<std::endl;
else osg::notify(osg::NOTICE)<<"Texture::releaseGLObjects no State "<<std::endl;
// if (state) osg::notify(osg::NOTICE)<<"Texture::releaseGLObjects contextID="<<state->getContextID()<<std::endl;
// else osg::notify(osg::NOTICE)<<"Texture::releaseGLObjects no State "<<std::endl;
if (!state) const_cast<Texture*>(this)->dirtyTextureObject();
else