From 3bdfb700aad87eff9a84995119cb6f3066454165 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Mar 2008 12:10:09 +0000 Subject: [PATCH] Added extra event handlers to make viewer more functional --- .../osgmultitexturecontrol.cpp | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp index 261981a8b..70eab19a7 100644 --- a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp +++ b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp @@ -16,7 +16,6 @@ * THE SOFTWARE. */ -#include #include @@ -29,8 +28,11 @@ #include #include +#include + +#include +#include -#include #include @@ -212,9 +214,33 @@ int main( int argc, char **argv ) else if (mtc) mtc->setCullCallback(elbc); else rootnode->setCullCallback(elbc); - // add terrain manipulator - viewer.setCameraManipulator(new osgGA::TerrainManipulator); - + // add all the event handlers to the viewer + { + // add terrain manipulator + viewer.setCameraManipulator(new osgGA::TerrainManipulator); + + // add the state manipulator + viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); + + // add the thread model handler + viewer.addEventHandler(new osgViewer::ThreadingHandler); + + // add the window size toggle handler + viewer.addEventHandler(new osgViewer::WindowSizeHandler); + + // add the stats handler + viewer.addEventHandler(new osgViewer::StatsHandler); + + // add the help handler + viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); + + // add the record camera path handler + viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); + + // add the LOD Scale handler + viewer.addEventHandler(new osgViewer::LODScaleHandler); + } + // add a viewport to the viewer and attach the scene graph. viewer.setSceneData( rootnode );