From f653048d5f590b47017444df3d4e992c3d7f2710 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 9 Sep 2013 12:37:55 +0000 Subject: [PATCH] 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." --- examples/osgviewerMFC/MFC_OSG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgviewerMFC/MFC_OSG.cpp b/examples/osgviewerMFC/MFC_OSG.cpp index 56056b4f8..7c37af710 100644 --- a/examples/osgviewerMFC/MFC_OSG.cpp +++ b/examples/osgviewerMFC/MFC_OSG.cpp @@ -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 camera = new osg::Camera; + // Init Master Camera for this View + osg::ref_ptr camera = mViewer->getCamera(); // Assign Graphics Context to the Camera camera->setGraphicsContext(gc);