Added event handling

This commit is contained in:
Robert Osfield 2010-06-17 14:18:11 +00:00
parent 0d641bf483
commit 8fae9c5779

View File

@ -27,7 +27,9 @@
#include <osgDB/ReadFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osg/Quat>
#include <osg/io_utils>
@ -510,6 +512,12 @@ int main( int argc, char **argv )
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// create the windows and run the threads.
viewer.realize();