public:t-gede-12-1:buildingogrefromscratch
This is an old revision of the document!
Steps for Building a New Ogre App Totally from Scratch
For Windows
General Preparation
- Download and install Microsoft Visual C++ Express 2010 (if you don't have it)
- Download and install Microsoft DirectX SDK (February 2010)
Building Ogre from Source Files
- Download and decompress the OGRE 1.7.3 Source For Windows (this should create the folder “ogre_src_v1-7-3”)
- Download Microsoft Visual C++ Dependencies Package, unzip it, and place the folder
Dependenciesinsideogre_src_v1-7-3 - Build the
ogre_src_v1-7-3\Dependencies\src\OgreDependencies.VS2010.slnsolution - Download and install CMake (Recommend “Add CMake to the system PATH” option)
- Run “CMake (cmake-gui)”
- Browse to
ogre_src_v1-7-3to enter location of source code - Create and browse to a separate directory for the built binaries, e.g.
ogre_built - Press “Configure” and pick your target compiler (i.e. Visual C++ Express 2010) (when done, you see new configuration variables in red)
- Press “Configure” again (configuration variables turn gray)
- Press “Generate”
- Go to your
ogre_builtdirectory and build theOGRE.slnsolution- If this build goes well, you can test the Ogre examples by running
SampleBrowser_d.exeunderogre_built\bin\debug(if built with the debug configuration)
Creating Your Ogre Application
- Create a new Win32 project (Windows Application, Empty Project)
- Download and add the Ogre Tutorial Framework Files to your project
- Configure your project properties (Debug Configuration) (Replace “C:\Development” with your development directory):
- General → Character Set →
Use Multi-Byte Character Set - Debugging → Command →
.\Debug\$(ProjectName).exe - Debugging → Working Directory →
.\Debug - C/C++ → General → Additional Include Directories →
C:\Development\ogre_src_v1-7-3\OgreMain\include;C:\Development\ogre_src_v1-7-3\Dependencies\include;C:\Development\ogre_src_v1-7-3\Dependencies\include\OIS;C:\Development\ogre_src_v1-7-3\Samples\Common\include;C:\Development\ogre_built\include - Linker → General → Additional Library Directories →
C:\Development\ogre_built\lib\Debug; C:\Development\ogre_src_v1-7-3\Dependencies\lib\Debug - Linker → Input → Additional Dependencies →
OgreMain_d.lib;OIS_d.lib;%(AdditionalDependencies)
- Build your project (Debug Configuration)
- Add
C:\Development\ogre_built\bin\debugto your windows system PATH environment variable (so the Ogre DLLs can be found) - Copy
ogre_d.cfg,resources_d.cfgandplugins_d.cfginto the folder with your new Ogre application (local Ogre configuration) - Run your application
- After going through a configuration screen you should see a black render window
- Add the following code to your
TutorialApplication.ccpinside theTutorialApplication::createScene(void)function, build and run.Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50);- You should now see a green Ogre head!
/var/www/cadia.ru.is/wiki/data/attic/public/t-gede-12-1/buildingogrefromscratch.1326420270.txt.gz · Last modified: 2024/04/29 13:32 (external edit)