Show
Ignore:
Timestamp:
07/03/07 19:32:19 (7 years ago)
Author:
robert
Message:

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"."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgwindows/osgwindows.cpp

    r6941 r7065  
    4545    osgViewer::Viewer viewer; 
    4646 
     47    int xoffset = 40; 
     48    int yoffset = 40; 
     49 
    4750    // left window + left slave camera 
    4851    { 
    4952        osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 
    50         traits->x = 0; 
    51         traits->y = 0; 
    52         traits->width = 640; 
     53        traits->x = xoffset + 0; 
     54        traits->y = yoffset + 0; 
     55        traits->width = 600; 
    5356        traits->height = 480; 
    5457        traits->windowDecoration = true; 
     
    6568        camera->setReadBuffer(buffer); 
    6669 
    67         // add this slave camra to the viewer, with a shift left of the projection matrix 
     70        // add this slave camera to the viewer, with a shift left of the projection matrix 
    6871        viewer.addSlave(camera.get(), osg::Matrixd::translate(1.0,0.0,0.0), osg::Matrixd()); 
    6972    } 
    7073     
    71     // left window + left slave camera 
     74    // right window + right slave camera 
    7275    { 
    7376        osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 
    74         traits->x = 640; 
    75         traits->y = 0; 
    76         traits->width = 640; 
     77        traits->x = xoffset + 600; 
     78        traits->y = yoffset + 0; 
     79        traits->width = 600; 
    7780        traits->height = 480; 
    7881        traits->windowDecoration = true; 
     
    8992        camera->setReadBuffer(buffer); 
    9093 
    91         // add this slave camra to the viewer, with a shift right of the projection matrix 
     94        // add this slave camera to the viewer, with a shift right of the projection matrix 
    9295        viewer.addSlave(camera.get(), osg::Matrixd::translate(-1.0,0.0,0.0), osg::Matrixd()); 
    9396    }