From 2205506aa3202a79837e99e5c384b8a1a1ca0f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A5=E7=BB=A7=E5=B9=B3?= Date: Tue, 19 Jun 2018 00:33:03 +0800 Subject: [PATCH] Fixed the position of the viewport for the camera The position of viewport doesn't setup properly, some part of viewer is out of CMFC_OSG_MDIView, and not visible. --- examples/osgviewerMFC/MFC_OSG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgviewerMFC/MFC_OSG.cpp b/examples/osgviewerMFC/MFC_OSG.cpp index d27acdf65..7573d74f4 100644 --- a/examples/osgviewerMFC/MFC_OSG.cpp +++ b/examples/osgviewerMFC/MFC_OSG.cpp @@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void) camera->setGraphicsContext(gc); // Set the viewport for the Camera - camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height)); + camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height)); // set the draw and read buffers up for a double buffered window with rendering going to back buffer camera->setDrawBuffer(GL_BACK);