OGRE (Object-Oriented Graphics Rendering Engine)

Copying the sample sources

This step is the same whether you're using the 'easy' or the 'advanced' way.

In summary:

- Copy SampleApp.cpp from this folder into your application folder, and rename it to reflect your application's name.

And now in more detail: OGRE comes with a useful set of classes for getting applications up and running, called 'ExampleApplication' and 'ExampleFrameListener'. These classes basically boot the OGRE system, set up all the usual stuff like displaying a configuration dialog and creating a window, sets up a camera and make it responds to the standard mouselook & WSAD controls, and just basically make your life easy. All you have to do to create your application is to subclass these classes to customise the behaviour where you want.

And hey, to make it even easier, I've created a sample subclass which you can use as a template. In the same folder as this tutorial is a file called 'SampleApp.cpp', which you can just copy into your application folder, rename, and fill in the blanks. As your project gets bigger you will want to split things up into more files, but for simplicity I've included it all in one file for the moment (since excluding comments it's less than a page of code anyway).

All you have to do is to fill in the 'createScene' implementation. If you want to do more advanced things like adding extra controls, choosing a different scene manager, setting up different resource locations etc you will need to override more methods of ExampleApplication and maybe introduce a subclass of ExampleFrameListener. You can look at the other tutorials and the sample applications provided with OGRE to see how this is done.

Back to Index |  | << Previous section | Next section >>