load_bmp(3alleg4)

✨ NAME ✨

okay so bestie, welcome to load_bmp β€” she loads a BMP bitmap from a file πŸ’– and yes she's part of the Allegro game programming library, we stan.


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

BITMAP *load_bmp(const char *filename, RGB *pal);

like, that's it. two lines. iconic behavior honestly.


πŸ¦‹ DESCRIPTION πŸ¦‹

load_bmp pulls in an 8-bit, 16-bit, 24-bit or 32-bit BMP file β€” and not just any BMP, we're talking Windows or OS/2 flavor πŸ’…. she does not discriminate, she simply eats.


πŸ’– RETURN VALUE πŸ’–

  • she hands you back a pointer to the bitmap 🫢
  • or NULL if something went wrong 😭 (error vibes, we hate to see it)
⚠️ okay so listen, this is the important part and I need you to hear me: you are responsible for destroying the bitmap when you're done with it. that's your job, not hers. if you just walk away and leave her hanging, that's a memory leak πŸ’€ and nobody wants that. clean up after yourself, bestie. periodt.

🌸 SEE ALSO 🌸

go read those too, they're literally her siblings 🧚


and that's the whole page babes ✨ this was the load_bmp entry from the Allegro manual, version 4.4.3, and yeah the footer said load_bmp(3alleg4) again because they love a little encore πŸ‘‘ mwah, go write some games πŸ’œ