Changeset 6036 for OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
- Timestamp:
- 01/23/07 16:51:43 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
r6035 r6036 14 14 #include <osgGA/DriveManipulator> 15 15 #include <osgGA/KeySwitchMatrixManipulator> 16 #include <osgGA/StateSetManipulator>17 16 #include <osgGA/AnimationPathManipulator> 18 17 #include <osgGA/TerrainManipulator> 19 18 #include <osgGA/AnimationPathManipulator> 19 #include <osgGA/StateSetManipulator> 20 20 21 21 #include <osgViewer/Viewer> … … 150 150 arguments.getApplicationUsage()->addCommandLineOption("--two-pass", "Use two-pass stencil for shadow volumes."); 151 151 152 // hint to tell viewer to request stencil buffer when setting up windows 153 osg::DisplaySettings::instance()->setMinimumNumStencilBits(8); 154 152 155 // construct the viewer. 153 156 osgViewer::Viewer viewer; … … 176 179 while (arguments.read("--noShadow")) doShadow = false; 177 180 181 int screenNum = -1; 182 while (arguments.read("--screen", screenNum)) viewer.setUpViewOnSingleScreen(screenNum); 183 178 184 osgShadow::ShadowVolumeGeometry::DrawMode drawMode = osgShadow::ShadowVolumeGeometry::STENCIL_TWO_SIDED; 179 185 while (arguments.read("--two-sided")) drawMode = osgShadow::ShadowVolumeGeometry::STENCIL_TWO_SIDED; … … 206 212 viewer.setCameraManipulator( keyswitchManipulator.get() ); 207 213 } 214 215 216 // add the state manipulator 217 viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); 208 218 209 219 // add stats … … 438 448 } 439 449 440 } 441 442 } 443 444 // hint to tell viewer to request stencil buffer when setting up windows 445 osg::DisplaySettings::instance()->setMinimumNumStencilBits(8); 450 } 451 452 } 453 446 454 447 455 viewer.setSceneData(group.get()); 448 456 449 457 // create the windows and run the threads. 450 458 viewer.realize();
