Re: [AD] Possible Timer API additions/modifications

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


On Sat, 2008-01-26 at 02:45 -0800, Ryan Dickie 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 have attached a quick stand-alone prototype (for *nix) which
> includes a quick test bench for a feel of the interface.  I quickly
> re-implemented al_rest and al_current_time to deal with doubles as
> well for convenience sake. 
> 

My impression is, there is no need for this to go into the Allegro 5
core, as it can be implemented on top of it. (The policy we set up is to
keep the core as small as possible to ease maintanance.)

So the best way for this likely will be some collection of useful code
snippets, maybe on the wiki. Or maybe we can have a time addon (which
then could also have additional stuff like printing dates and so on).

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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