Added DisplaySetting::s/getCompileContextHint() and use of this hint in osgViewer::Viewer/CompositeViewer.

Removed the CustomViewer in osgterrain example as the above now removes the need for it.
This commit is contained in:
Robert Osfield
2007-08-11 14:49:14 +00:00
parent 4cd437d7d4
commit d57a16e023
8 changed files with 93 additions and 65 deletions

View File

@@ -74,12 +74,6 @@ int main(int argc, char** argv)
return 1;
}
bool createBackgroundContextForCompiling = false;
while (arguments.read("--bc")) { createBackgroundContextForCompiling = true; }
bool createBackgroundThreadsForCompiling = false;
while (arguments.read("--bt")) { createBackgroundContextForCompiling = true; createBackgroundThreadsForCompiling = true; }
// set up the camera manipulators.
{
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
@@ -151,27 +145,6 @@ int main(int argc, char** argv)
viewer.realize();
if (createBackgroundContextForCompiling)
{
int numProcessors = OpenThreads::GetNumberOfProcessors();
int processNum = 0;
for(unsigned int i=0; i<= osg::GraphicsContext::getMaxContextID(); ++i)
{
osg::GraphicsContext* gc = osg::GraphicsContext::getOrCreateCompileContext(i);
if (gc && createBackgroundThreadsForCompiling)
{
gc->createGraphicsThread();
gc->getGraphicsThread()->setProcessorAffinity(processNum % numProcessors);
gc->getGraphicsThread()->startThread();
++processNum;
}
}
}
viewer.run();
}