Re: [AD] generic game loop

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tuesday 15 March 2005 00:46, Jon Rafkind wrote:
> I guess this loop would only be able to lock to a logic rate, but why 
> would you want to lock to a graphics rate?

Beats me, but I've seen people post on ACC on how to do this.

> There could also be a  
> function that returns the value of the time counter, but what would the 
> user do with this?

I usually keep track of the number of game loops since the start of the 
game. I use this for some logic functions that span multiple update 
cycles, or (potentially) for checking synchronisation between 
client/server or debugging.
Not a big deal, since it's easy to just have another variable++ at the 
start of each logic loop, but a bit wasteful if there's one available 
already.

> The user doesnt need to specify when to update the graphics, a flag is 
> set after the logic is run telling game_loop to call the draw() method.

Bad idea. You shouldn't redraw the graphics if nothing has changed on 
screen during the last logic loop.

> Ok. Maybe EasyAllegro or something equally quaint.

I'm not sure if you're refering to Lennart Steinke's installer/setup 
distribution?

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/