al_register_bitmap_saver_f(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸ‘‘


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