register_bitmap_file_type(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– register_bitmap_file_type(3) πŸ’–

okay bestie, welcome to the Allegro manual β€” this one lives in the Allegro game programming library and it's literally about teaching your program a brand-new image format πŸŽ€


✨ NAME ✨

register_bitmap_file_type β€” registers custom bitmap loading/saving functions. Allegro game programming library.


🌸 SYNOPSIS 🌸

#include <allegro.h>

void register_bitmap_file_type(const char *ext, BITMAP *(*load)(const
char *filename, RGB *pal), int (*save)(const char *filename, BITMAP
*bmp, const RGB *pal));

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, this function informs the load_bitmap() and save_bitmap() functions that a new file type exists, and hands them the routines to read and write images in that format. ✨ Either one of those functions may be NULL β€” no cap, that's allowed. πŸ’…

The functions you supply must follow the same prototype as load_bitmap() and save_bitmap(). Here's the vibe:

BITMAP *load_dump(const char *filename, RGB *pal)
{
   ...
}

int save_dump(const char *filename, BITMAP *bmp, const RGB *pal)
{
   ...
}

   register_bitmap_file_type("dump", load_dump, save_dump);

it's giving pluggable image codecs and honestly? iconic. πŸ‘‘


🌈 SEE ALSO 🌈


mwah πŸ’‹ that's the whole page, written for Allegro version 4.4.3 β€” yeah she's a little vintage but she ate, periodt. πŸ«ΆπŸ’– go register a file type bestie, you got this 🧚✨

πŸ“¦ where this page comes from