|
发表于 2012-9-16 19:14:00
|
显示全部楼层
Re:terrain.cfg 调用怎么不能成功?
我都一样看到OGRE基础教程三就这样出错了,试了一天,上网都没找到问题所在,程序就两条命令真烦人,
#include "OGRE/ExampleApplication.h"
class TutorialApplication : public ExampleApplication
{
protected:
public:
TutorialApplication()
{
}
~TutorialApplication()
{
}
protected:
void chooseSceneManager(void)
{
mSceneMgr = (OctreeSceneManager*)mRoot->createSceneManager(ST_EXTERIOR_CLOSE);
}
void createScene(void)
{
mSceneMgr->setWorldGeometry( "terrain.cfg" );
}
};
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif
{
// Create application object
TutorialApplication app;
try {
app.go();
} catch( Exception& e ) {
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
fprintf(stderr, "An exception has occured: %s\n",
e.getFullDescription().c_str());
#endif
}
return 0;
}
抛出了这样的错误提示对话框:下面是log的异常,我看了这个异常是创建不到ST_EXTERIOR_CLOSE,不知道例程是怎么仿真的,编译是没错误运行时就有错
18:42:15: OGRE EXCEPTION(2:InvalidParametersException): World geometry is not supported by the generic SceneManager. in SceneManager::setWorldGeometry at ..\..\..\..\OgreMain\src\OgreSceneManager.cpp (line 1578) |
|