|
楼主 |
发表于 2016-3-17 19:48:07
|
显示全部楼层
#if def_DEBUG
#pragma comment(lib,"osgViewerd.lib")
#pragma comment(lib,"osgDBd.lib")
#pragma comment(lib,"OpenThreadsd.lib")
#pragma comment(lib,"osgd.lib")
#pragma comment(lib,"osgGAd.lib")
#else
#pragma comment(lib,"osgViewer.lib")
#pragma comment(lib,"osgDB.lib")
#pragma comment(lib,"OpenThreads.lib")
#pragma comment(lib,"osg.lib")
#pragma comment(lib,"osgGA.lib")
#endif
#include<osgViewer/Viewer>
#include<osgDB/ReadFile>
#include<osgGA/StateSetManipulator>
#include<osgViewer/ViewerEventHandlers>
int main(int argc,char**argv)
{
osg::ref_ptr<osgViewer::Viewer>viewer=new osgViewer::Viewer;
osg::ArgumentParser arguments(&argc,argv);
//arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription("help Information");
osg::ref_ptr<osg::Node>glider=osgDB::readNodeFile("glider.osg");
viewer->addEventHandler(new osgGA::StateSetManipulator(viewer->getCamera()->getOrCreateStateSet()));
viewer->addEventHandler(new osgViewer::ThreadingHandler);
viewer->addEventHandler(new osgViewer::WindowSizeHandler);
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
viewer->addEventHandler(new osgViewer::RecordCameraPathHandler);
viewer->addEventHandler(new osgViewer:ODScaleHandler);
viewer->addEventHandler(new osgViewer::ScreenCaptureHandler);
viewer->setSceneData(glider);
return viewer->run();
}
*/
|
|