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.
This commit is contained in:
弥继平 2018-06-19 00:33:03 +08:00 committed by GitHub
parent 3410d3a37d
commit 36aa3a4fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void)
camera->setGraphicsContext(gc); camera->setGraphicsContext(gc);
// Set the viewport for the Camera // 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 // set the draw and read buffers up for a double buffered window with rendering going to back buffer
camera->setDrawBuffer(GL_BACK); camera->setDrawBuffer(GL_BACK);