From Wang Rui, "Some developers report that the osgviewerMFC example is broken in 3.2, in which depth test is not enabled by default so all models loaded look awkward. I submit this patch to make it work again. I haven't gone deep to check why previous example goes wrong in newer version but I believe the problem was because the newly created camera object missed some important global statesets before set as the main camera."

This commit is contained in:
Robert Osfield
2013-09-09 12:37:55 +00:00
parent caf56902c3
commit f653048d5f

View File

@@ -97,8 +97,8 @@ void cOSG::InitCameraConfig(void)
// Create the Graphics Context
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
// Init a new Camera (Master for this View)
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
// Init Master Camera for this View
osg::ref_ptr<osg::Camera> camera = mViewer->getCamera();
// Assign Graphics Context to the Camera
camera->setGraphicsContext(gc);