next_fli_frame(3)
π next_fli_frame(3) β the Allegro manual, but make it make sense π
okay bestie, gather round, because this one is literally from the Allegro game programming library and it's giving "flipbook but make it C" β¨
πΈ NAME πΈ
next_fli_frame β reads the next frame of the current animation file. π
(and yes, it lives in the Allegro game programming library, that's the whole vibe π¦)
β¨ SYNOPSIS β¨
#include <allegro.h>
int next_fli_frame(int loop);
π DESCRIPTION π
So here's the tea: this function reads the next frame of the current animation file. That's it. That's the job. π«Ά
Now, the loop argument? She's the main character here:
- if
loopis not zero, the player will cycle when it reaches the end of the file β like a playlist on repeat, no cap π - if
loopis zero, it'll just returnFLI_EOFinstead. bye. πͺ
And where does the frame go, you ask? It gets read into the global variables fli_bitmap and fli_palette. iconic behaviour honestly π
Example time, because i know you love one:
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... */
}
see how clean that is? the loop just keeps going until the frames run out. periodt π
π₯ RETURN VALUE π₯
FLI_OKβ slay, it worked, success β¨FLI_ERRORβ oops, something went wrong πFLI_NOT_OPENβ also an error, but specifically the "girl you never opened the file" kind πFLI_EOFβ you've hit the end of the file, that's all she wrote π
π SEE ALSO π
go read those too, iykyk π
k that's the whole page bestie!! this was brought to you by Allegro version 4.4.3 π β mwah, drink water, and don't forget to check your return values πβ¨π
π¦ 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