Standardize the call to setUpThreading() in CompositeViewer/Viewer::realize().

Standardize the call to scene->resizeGLObjects().


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14945 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-07-13 16:04:38 +00:00
parent 2eff96d1a4
commit d221133728
3 changed files with 15 additions and 2 deletions

View File

@ -639,14 +639,15 @@ void CompositeViewer::realize()
} }
startThreading();
// initialize the global timer to be relative to the current time. // initialize the global timer to be relative to the current time.
osg::Timer::instance()->setStartTick(); osg::Timer::instance()->setStartTick();
// pass on the start tick to all the associated eventqueues // pass on the start tick to all the associated eventqueues
setStartTick(osg::Timer::instance()->getStartTick()); setStartTick(osg::Timer::instance()->getStartTick());
// configure threading.
setUpThreading();
if (osg::DisplaySettings::instance()->getCompileContextsHint()) if (osg::DisplaySettings::instance()->getCompileContextsHint())
{ {
int numProcessors = OpenThreads::GetNumberOfProcessors(); int numProcessors = OpenThreads::GetNumberOfProcessors();

View File

@ -587,6 +587,7 @@ void Viewer::realize()
// pass on the start tick to all the associated event queues // pass on the start tick to all the associated event queues
setStartTick(osg::Timer::instance()->getStartTick()); setStartTick(osg::Timer::instance()->getStartTick());
// configure threading.
setUpThreading(); setUpThreading();
if (osg::DisplaySettings::instance()->getCompileContextsHint()) if (osg::DisplaySettings::instance()->getCompileContextsHint())

View File

@ -177,6 +177,17 @@ void ViewerBase::setUpThreading()
Scenes scenes; Scenes scenes;
getScenes(scenes); getScenes(scenes);
for(Scenes::iterator scitr = scenes.begin();
scitr != scenes.end();
++scitr)
{
if ((*scitr)->getSceneData())
{
// update the scene graph so that it has enough GL object buffer memory for the graphics contexts that will be using it.
(*scitr)->getSceneData()->resizeGLObjectBuffers(osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts());
}
}
} }
} }
} }