|
运行程序时,在控制台上打印如下信息:
Warning: Could not find plugin to read object from file "C:\OSG\data\fonts\arial.ttf"
可是我查看该路径下文件是存在的,不知是什么原因。
贴上我的代码
- #ifdef _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")
- #pragma comment(lib, "osgTextd.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")
- #pragma comment(lib, "osgText.lib")
- #endif
- #include <osgViewer/Viewer>
- #include <osgDB/ReadFile>
- #include <osgViewer/ViewerEventHandlers>
- int main()
- {
- osg::ref_ptr <osgViewer::Viewer> viewer = new osgViewer::Viewer;
- viewer->addEventHandler(new osgViewer::StatsHandler);
- viewer->setSceneData(osgDB::readNodeFile("glider.osg"));
- return viewer->run();
- }
复制代码 |
|