fli_frame(3)
β¨ fli_frame β¨
okay so bestie, welcome to the Allegro manual π this one's a tiny little global variable with big main-character energy, and it lives in the Allegro game programming library. yes, that Allegro. the one you already love. π
πΈ NAME πΈ
fli_frame</purage> β stores the current frame number of the animation. Allegro game programming library. that's it. that's the whole job. she's simple, she's iconic, she knows her purpose. π
π SYNOPSIS π
#include <allegro.h>
extern int fli_frame;
π¦ DESCRIPTION π¦
so this is a global variable and it holds the current frame number in the FLI file. no cap. that's literally what it does.
and why do you care? because this is how you synchronise other events with the animation. fr fr. like, say you want a sound to hit at exactly the right frame β you could peek at fli_frame inside a play_fli() callback function and use it to trigger a sample at a particular point. chef's kiss. π«Ά
here's the example, verbatim, no notes:
while (next_fli_frame(0) == FLI_OK) {
if (fli_frame == 345)
play_sample(trumpet_sound, 255, 128, 1000, 0);
/* Rest some time until next frame... */
}
the way that fli_frame == 345 just casually drops a trumpet into your animation π that's the whole vibe. sync queen. β¨
π SEE ALSO π
go read those too, bestie, they're the rest of the FLI friend group and they ate π
quick vibe check: this is a global variable, so if you're juggling multiple FLI things at once just know she's out here sharing state with the whole program. iykyk. π
okay that's the page!! this was the fli_frame(3) manual page, straight from Allegro, version 4.4.3 β yeah, 4.4.3, the date on the original footer. shoutout to the Allegro gang for writing her up in the first place, mwah π now go make something cute play at frame 345 for me. bye bestie!! ππ¦πΈβπ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms