#include<osgViewer/Viewer>#include<osgViewer/ViewerEventHandlers>#include<osgGA/StateSetManipulator>#include<osgDB/ReadFile>intmain(int argc,char*argv[]){
ref_ptr<osgViewer::Viewer> v =new osgViewer::Viewer;
v->setUpViewInWindow(100,100,800,800);// add the state manipulator
v->addEventHandler(new osgGA::StateSetManipulator(v->getCamera()->getOrCreateStateSet()));// add the thread model handler
v->addEventHandler(new osgViewer::ThreadingHandler);// add the window size toggle handler
v->addEventHandler(new osgViewer::WindowSizeHandler);// add the stats handler
v->addEventHandler(new osgViewer::StatsHandler);// add the help handler
v->addEventHandler(new osgViewer::HelpHandler());
v->setSceneData(osgDB::readNodeFile("cow.osg"));
v->realize();return v->run();}