Changed the updating of the contextID so that the DisplaySetting::MaxNumberOfGrapicsContexts()

is updated on each new graphics context creation, in keeping with how osgProducer used to do things.
This commit is contained in:
Robert Osfield
2008-02-19 12:26:19 +00:00
parent 61223fa05f
commit 9c24dc7083

View File

@@ -214,8 +214,15 @@ unsigned int GraphicsContext::createNewContextID()
osg::notify(osg::INFO)<<"GraphicsContext::createNewContextID() creating contextID="<<contextID<<std::endl;
#if 1
// always update, consitent with how osgProducer used to work.
bool updateContextID = true;
#else
// update if new contextID exceeds only one.
bool updateContextID = (contextID+1) > osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts();
#endif
if ( (contextID+1) > osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts() )
if (updateContextID)
{
osg::notify(osg::INFO)<<"Updating the MaxNumberOfGraphicsContexts to "<<contextID+1<<std::endl;