Re: [AD] Possible Timer API additions/modifications

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


On 2008-01-26, Ryan Dickie <goalieca@xxxxxxxxxx> wrote:
> Since allegro is a high-level library I thought it might be useful to add
> some common functionality to the timer API's. In particular it would be
> useful to have a stopwatch timer and a countdown timer. A stopwatch simply
> measures time elapsed. The interface provides for pausing, resuming, and
> resetting. The countdown timer will expire when the time remaining reaches
> 0. It has a nearly identical interface as the stopwatch. The stopwatch and
> countdown timers were done using doubles as they were the natural choice.
> These timers are implemented entirely on top of al_current_time().

I agree with Elias.  These are simple wrappers on top of
al_current_time() so there's no need for them to be in the core.

> /**
> ####################################################
> ########### One-Shot TIMER #########################
> ####################################################
> should be parallel to allegro's periodic timer
> Current Timers have a nice interface I think
> just make it handle doubles.
> */

I have thought about adding a one-shot mode to ALLEGRO_TIMERs.  It would
only insert one one tick event into the event queues it is registered
with, then stop.  I don't know if that's what you're referring to.  It's
not strictly necessary but probably would be quite convenient.

Peter





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