public:t-gede-12-1:buildingogrefromscratch
Steps for Building a New Ogre App Totally from Scratch
This is a condensed, corrected and Windows only version of the information provided on the Building Ogre and Setting Up An Application wiki pages on the Ogre Wiki. Go there directly for more information and for setting this up on other platforms.
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
Dependencies
insideogre_src_v1-7-3
- Build the
ogre_src_v1-7-3\Dependencies\src\OgreDependencies.VS2010.sln
solution - Download and install CMake (Recommend “Add CMake to the system PATH” option)
- Run “CMake (cmake-gui)”
- Browse to
ogre_src_v1-7-3
to 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_built
directory and build theOGRE.sln
solution- If this build goes well, you can test the Ogre examples by running
SampleBrowser_d.exe
underogre_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 own 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\debug
to your windows system PATH environment variable (so the Ogre DLLs can be found) - Copy
resources_d.cfg
andplugins_d.cfg
into 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.ccp
inside 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/pages/public/t-gede-12-1/buildingogrefromscratch.txt · Last modified: 2024/04/29 13:33 by 127.0.0.1