next_fli_frame(3alleg4)

πŸ’– next_fli_frame β€” bestie, it's the next frame πŸ’–

okay so this page lives in the Allegro manual (the 3alleg4 girlies know), and it's all about the function next_fli_frame. she reads the next frame of your current animation file. that's her whole job. she's an icon, she's a legend, and she's the moment. ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

int next_fli_frame(int loop);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. next_fli_frame reads the next frame of the current animation file. that's it. that's the vibe. πŸ’…

but here's the tea about loop, bestie β€” listen closely:

  • if loop is not zero, the player will cycle when it reaches the end of the file. she just keeps going. infinite main character energy. πŸ”
  • if loop is zero, then instead of cycling it returns FLI_EOF when it hits the end. no encore. the show ends. 🎬

and where does the frame go, you ask? straight into the global variables fli_bitmap and fli_palette. iconic behaviour honestly. πŸ’–

here's an example, literally copy-paste her:

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... */
}

⭐ RETURN VALUE ⭐

  • FLI_OK β€” slay, it worked, success πŸŽ€
  • FLI_ERROR or FLI_NOT_OPEN β€” uh oh, error time 😭
  • FLI_EOF β€” you hit the end of the file, babes 🏁

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all part of the same friend group fr fr:


okay that's the whole page bestie, no cap, every flag and every constant accounted for 🫢 this was Allegro version 4.4.3 doing the absolute most as always, so mwah, go forth and animate your little heart out βœ¨πŸ’œπŸŒΈ