The Ogre Startup Sequence

The basic Ogre life cycle looks like this:

  1. 1.Create the Root object.
  2. 2.Define the resources that Ogre will use.
  3. 3.Choose and setup the RenderSystem (that is, DirectX, OpenGL, etc).
  4. 4.Create the RenderWindow (the window which Ogre resides in).
  5. 5.Initialize the resources that you are going to use.
  6. 6.Create a scene using those resources.
  7. 7.Setup any third party libraries and plugins.
  8. 8.Create any number of frame listeners.
  9. 9.Start the render loop.

We will be going through each one of these in depth in this tutorial.

I would like to note that while you really should do steps 1-4 in order, steps 5 and 6 (initializing resources and creating the scene) can come much later in your startup process if you like. You could initialize third party plugins and create frame listeners before steps 5 and 6 if you so choose, but you really shouldn't do them before finishing step 4. Also the frame listeners/third party libraries cannot access any game related resources (such as your cameras, entities, etc) until the resources are initialized and the scene has been created. In short, you can do some of these steps out of order if you feel it will be better for your application, but I do not recommend so unless you are sure you understand the consequences of what you are doing.

posted @ 2009-07-22 16:07  回忆1919  阅读(228)  评论(0编辑  收藏  举报