fli_timer(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– NAME πŸ’–

hey bestie, welcome to fli_timer(3) from the Allegro manual ✨ this is the global variable that handles timing for FLI playback, straight out of the Allegro game programming library πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

extern volatile int fli_timer;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so fli_timer is a global variable for timing FLI playback, and it's literally the main character of this page πŸ‘‘

when you open an FLI file, a timer interrupt gets installed, and that interrupt increments this variable every single time a new frame should be displayed ⏰✨

then when you call next_fli_frame(), it decrements fli_timer. so the vibe check is: if fli_timer is greater than zero, you know it's time to display a new frame 🫢

like, here's the example, no cap:

   while (next_fli_frame(0) == FLI_OK) {
      /* Do stuff, like play audio stream
         or check keys to skip animation. */
      /* Rest some time until next frame... */
      while (fli_timer <= 0)
         rest(0);
   }

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸ’… this was <strong>Allegro version 4.4.3</strong>, fli_timer(3) β€” go slay your FLI playback πŸŒˆπŸ’–

πŸ“¦ where this page comes from