[A5] Timer events
boNltt

Hello, i recently started out with Allegro and game programming in general so i don't really get all the concepts yet so sorry if this is a bad question.

I've read up a bit about interpolation and handling of frame skipping on the forums and i think i get most of it, except one part which i would like to get a bit of clarity on.

The general way of determining interpolation values seem to be
interpolation = (al_get_time() - offset - gametime) / dt

and for calculating gametime there seems to usually be something in the form of
gametime = event.timer.count * dt

Now the thing i'm having a bit trouble with is what event.timer.count refers to.

Is it the time since the timer itself started counting? The time it has been sitting in the queue?

Would love to get some clarity on this.

Thanks in advance.

SiegeLord

It increments by 1 every time an ALLEGRO_EVENT_TIMER is triggered, and it starts at 0 when the timer is created. You can also reset it via al_set_timer_count, so it's not quite as simple as simply saying "number of times it ticked since being started".

Thread #612407. Printed from Allegro.cc