20,741
edits
Line 771: | Line 771: | ||
traits->windowDecoration = false; | traits->windowDecoration = false; | ||
traits->doubleBuffer = false; | traits->doubleBuffer = false; | ||
// http://forum.openscenegraph.org/viewtopic.php?t=10340 | |||
traits->sharedContext = 0; | traits->sharedContext = 0; | ||
traits->pbuffer = true; | traits->pbuffer = true; | ||
Line 782: | Line 784: | ||
_gc = osg::GraphicsContext::createGraphicsContext(traits.get()); | _gc = osg::GraphicsContext::createGraphicsContext(traits.get()); | ||
} | } | ||
//view->setSceneData(scene.get()); | if (gc.valid()) { | ||
v->getCamera()->setGraphicsContext(_gc.get()); | |||
v->getCamera()->setViewport(new osg::Viewport(x,y,width,height)); | |||
osgViewer::View* view = new osgViewer::View; | |||
view->setName("Main Canvas View"); | |||
v.addView(view); | |||
view->setUpViewOnSingleScreen(0); | |||
//view->setSceneData(scene.get()); | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||