From afc722d43b1f39cc7c37a2fece01602f81ba7b98 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 3 Jul 2007 17:32:19 +0000 Subject: [PATCH] From Thibault Genessay, "You'll find attached a fix for the comments of the osgwindows example. It fixes a typo in the comments which is quite disturbing for newbies trying to learn using the source (twice 'left' instead of 'left' and 'right'). I've also added a little offset to the windows' positions so that their decoration falls inside the desktop and we can manipulate them - it looks a bit less "made out of wood"." --- examples/osgwindows/osgwindows.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/osgwindows/osgwindows.cpp b/examples/osgwindows/osgwindows.cpp index 6c58dff48..625077ba7 100644 --- a/examples/osgwindows/osgwindows.cpp +++ b/examples/osgwindows/osgwindows.cpp @@ -44,12 +44,15 @@ int main( int argc, char **argv ) // construct the viewer. osgViewer::Viewer viewer; + int xoffset = 40; + int yoffset = 40; + // left window + left slave camera { osg::ref_ptr traits = new osg::GraphicsContext::Traits; - traits->x = 0; - traits->y = 0; - traits->width = 640; + traits->x = xoffset + 0; + traits->y = yoffset + 0; + traits->width = 600; traits->height = 480; traits->windowDecoration = true; traits->doubleBuffer = true; @@ -64,16 +67,16 @@ int main( int argc, char **argv ) camera->setDrawBuffer(buffer); camera->setReadBuffer(buffer); - // add this slave camra to the viewer, with a shift left of the projection matrix + // add this slave camera to the viewer, with a shift left of the projection matrix viewer.addSlave(camera.get(), osg::Matrixd::translate(1.0,0.0,0.0), osg::Matrixd()); } - // left window + left slave camera + // right window + right slave camera { osg::ref_ptr traits = new osg::GraphicsContext::Traits; - traits->x = 640; - traits->y = 0; - traits->width = 640; + traits->x = xoffset + 600; + traits->y = yoffset + 0; + traits->width = 600; traits->height = 480; traits->windowDecoration = true; traits->doubleBuffer = true; @@ -88,7 +91,7 @@ int main( int argc, char **argv ) camera->setDrawBuffer(buffer); camera->setReadBuffer(buffer); - // add this slave camra to the viewer, with a shift right of the projection matrix + // add this slave camera to the viewer, with a shift right of the projection matrix viewer.addSlave(camera.get(), osg::Matrixd::translate(-1.0,0.0,0.0), osg::Matrixd()); }