#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgGA/GUIEventAdapter>
#include <osgViewer/ViewerEventHandlers>
int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
osg::ref_ptr<osg::Node> node = new osg::Node;
node = osgDB::readNodeFile("D:\参考手册\BIM\osg\library.OSGB");
viewer->setSceneData(node.get());
viewer->setUpViewInWindow(200,200,700,500,0);
//添加帮助事件
viewer->addEventHandler(new osgViewer::HelpHandler);
return viewer->run();
}