Re: [AD] General time-passed function

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


I think it's a great idea. Additionally, would it be possible to create a
class
TIMER
which works like this? :

TIMER timer(2000); // 2000 msecs
while (timer.check() > 0);

This would do the same thing like rest(). I would need such a class for
cursor blinking or any other stuff which needs to be timed. Currently I do
it like it is shown in the Allegro-docs using a global timer-variable and
increase it myself. But when I change it's speed to achive higher accuracy I
have to change all relating values, too. With this class I could change the
speed of my logic_loop() and all animations would have the same speed as
before, because they use 'real' times and no cycle-counts...

Jörg

----- Original Message -----
From: George Foot <george.foot@xxxxxxxxxx>
To: <conductors@xxxxxxxxxx>
Sent: Friday, January 28, 2000 10:57 PM
Subject: [AD] General time-passed function


> Hi,
>
> This is a subject that's come up before -- people wanting a
> general record of time passing.  The standard answer is that
> they should install a timer handler, and increase their own
> variable, I suppose.  However, if we make a dedicated function,
> it could offer better accuracy than Allegro's timer callbacks.
> Under Linux and possibly other Unixes you can get the time
> pretty accurately, and this is true to ms resolution in Windows
> too AFAIK.  Might this be worth adding?  It's a fairly easy
> thing to do -- I can supply code for Linux and DOS box under
> Windows (95/98 definitely).
>
> George
>



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