Page 1 of 1

wrapping my head around gamestates

Posted: Tue Jan 25, 2005 5:54 am
by snowblind
Ogre newbie here.

I've coded game engines before, but I'm trying to figure out how to build one around Ogre now :) Basically I'm going to go with the "stack of gamestates" idea.

Should each game state have it's own...

a) Root node
b) Scene Manager
c) Or something even higher level...maybe each state clears the scene manager when it comes into scope?

Also, are frame listeners the best way to implement a game logic loop? All the examples use them. Can I call a draw method on the Root node and work with Ogre that way? That way I could do my whole own timing/game logic loop thing with less hassle.

Any suggestions are appreciated :) Thanks!

Posted: Tue Jan 25, 2005 11:14 am
by Banania
You are not forced to use the framework provided with the samples. It is provided only because it is convenient to quickly have something working.
But you can write your own game loop if you need to.

Posted: Tue Jan 25, 2005 1:56 pm
by Robomaniac

Posted: Tue Jan 25, 2005 9:13 pm
by psyclonist
snowblind: We use a custom loop and make calls to OGRE (renderOneFrame() or sth similar) when we need to render... well, a frame. The rest is ours. For code, have a look at YAKE. But I'm sure it'll be easier to just search the forums for similar keywords (renderOneFrame, custom render loop, ...) as this question came up a few times already (and has been answered, too).

-psy