【Ogre Beginner Guider】第一章 配置OGRE
在使用Ogre 3D SDK之前我们需要配置IDE
1. 新建一个空工程
2. 在工程里新建一个文件,命名为main.cpp
3. 添加一个main方法:
int main (void)
{
return 0;
}
4. 在该文件开头部分包含上ExampleApplication.h文件:
#include "Ogre\ExampleApplication.h"
5. 添加“你的Ogre SDK路径\include\”到你的项目include path(头文件路径)
6. 添加“你的Ogre SDK路径\boost_1_42\”到你的项目include path(头文件路径)
7. 添加“你的Ogre SDK路径\boost_1_42\lib\”到你的项目lib path(库文件路径)
8. 向main.cpp里添加一个类:
class Example1 : public ExampleApplication
{
public:
void createScene()
{
}
};
9. 把下面的代码添加到你的main函数里:
Example1 app;
app.go();
10. 添加“你的Ogre SDK路径\ lib\debug\”到你的项目lib path(库文件路径)
11. 添加OgreMain_d.lib到需要的链接库(工程属性的Linker->Input)里
12. 添加OIS_d.lib到需要的链接库(工程属性的Linker->Input)里
13. 编译此项目
14. 设置项目程序的工作空间(working directory)为“你的Ogre SDK路径\bin\debug”
以上过程已验证可用。
SDK中自带了一个解决方案(.sln),里面是一些例子,不过编译需要挺久的。