al_register_bitmap_loader_f(3alleg5)
β¨ al_register_bitmap_loader_f β Allegro 5 API β¨
okay bestie, pull up a chair, we're doing the allegro5 manual today and honestly? this one is a lil hidden gem π
π NAME π
al_register_bitmap_loader_f β that's the whole thing, that's the name, it's giving Allegro 5 API and we love her for it π«Ά
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
bool al_register_bitmap_loader_f(const char *extension,
ALLEGRO_BITMAP *(*fs_loader)(ALLEGRO_FILE *fp, int flags))
look at that signature. she's got a function pointer and everything. very main character energy, no cap π
π DESCRIPTION π
so basically, this function registers a handler for al_load_bitmap_f(3alleg5). like, you're telling Allegro "hey, when someone loads a bitmap file with this extension, use this function of mine to do it." iconic delegation behavior, honestly π
here's the tea on the arguments:
extensionβ the file extension you're claiming. it should include the leading dot (.), so like.png, notpng. and ngl, it gets matched case-insensitively, so.PNGand.pngare the same vibe β¨fs_loaderβ your loader function. it takes anALLEGRO_FILE *fpand anint flags, and hands you back anALLEGRO_BITMAP *. π¦ and hmm, important: this argument may beNULLβ that's how you unregister an entry. yes bestie,NULLis the "actually nvm, forget this one" button π
and what does she return?
trueon success πfalseon error π- and specifically? she returns
falseif you try to unregister an entry that doesn't exist. so don't come for entries that were never there, she will simply say no π
π SEE ALSO π
al_register_bitmap_loader(3alleg5)β the sibling, the other one, go read her too fr fr π
that's the whole page, bestie. now go register some loaders, you absolute legend π§
this came to you straight from the <b>Allegro reference manual</b> β that's the source/version, and the page signs off as <b>al_register_bitmap_loader_f(3alleg5)</b>. mwah, bye π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms