al_register_bitmap_saver_f(3alleg5)
π al_register_bitmap_saver_f π
okay bestie, welcome to the Allegro reference manual β¨ this one's a lil niche but it's literally so useful, stay with me π«Ά
β¨ NAME β¨
al_register_bitmap_saver_f β Allegro 5 API π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
bool al_register_bitmap_saver_f(const char *extension,
bool (*fs_saver)(ALLEGRO_FILE *fp, ALLEGRO_BITMAP *bmp))
π DESCRIPTION π
So basically, this is how you tell Allegro "hey, when someone wants to save a bitmap with this file extension, run this function." π
It hooks your handler up to al_save_bitmap_f(3alleg5), and the function you hand over gets called whenever a bitmap is being saved to a file with that extension. iconic behavior, honestly.
The extension you pass in should include the leading dot (.) character β like, don't be out here rawdogging it with "png", it wants ".png" bestie π. And it gets matched case-insensitively, so ".PNG" and ".png" are the same vibe, no drama π.
The fs_saver argument can be NULL if you wanna unregister an entry. yes, you can just ghost it like that π.
It returns true on success, and false on error. And ngl, it also returns false if you try to unregister an entry that doesn't even exist β so don't come for an entry that was never there, it will not be having it π.
π SEE ALSO π
al_register_bitmap_saver(3alleg5)β the sibling, go say hi π¦
that's the whole page, you ate it, no crumbs β¨ this was brought to you by the Allegro reference manual, page al_register_bitmap_saver_f(3alleg5), mwah ππ
π¦ 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