Re: [AD] generic game loop

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


Things to consider: how does it allow the user to specify the update rate? Would it be possible to lock to a specific graphical framerate instead of a logic rate? Is the user code able to query the current value of the time counter? How does the user specify that the graphics need to be updated at the next opportunity (does he call a function that sets a flag, say request_graphics_update(), whenever the logic dictates that a graphics update will be needed)?

The update rate is specified by the 'time' parameter. game_loop would call install_int_ex( something, BPS_TO_TIMER(time) ) or whatever. 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? There could also be a function that returns the value of the time counter, but what would the user do with this?

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.

I can see a critiscm be "This is a basic part of games that people should know how to do and doesnt belong in a graphics library." but this is exactly the point, its so common( or should be ) that it might as well go in a game library, which Allegro is supposed to be.

Yes - but as a `supported addon' or whatever name we would choose to give to addons that are bundled with the larger Allegro distribution.
Let's get 4.2 out of the way first though.

Ok. Maybe EasyAllegro or something equally quaint.





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