al_load_bitmap(3alleg5)
π al_load_bitmap β Allegro 5 API π
okay bestie, welcome to the al_load_bitmap(3alleg5) page, aka the glow-up moment where a random image file becomes a whole entire ALLEGRO_BITMAP. it's from the Allegro reference manual, it's iconic, let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
ALLEGRO_BITMAP *al_load_bitmap(const char *filename)
πΈ DESCRIPTION πΈ
So what does it actually do? It loads an image file into a brand new ALLEGRO_BITMAP(3alleg5). that's it, that's the whole job, and it does it slayfully π
The way it figures out what kind of file you handed it? It asks al_identify_bitmap(3alleg5) first β and if identification isn't possible, it falls back on the file extension like a backup plan. lowkey smart of it fr fr.
Returns NULL on error. so like⦠always check your return value, bestie, no cap. if it hands you NULL, something went wrong.
Also important: this function is literally the same as calling al_load_bitmap_flags(3alleg5) with a flags parameter of 0. same energy, shorter name, periodt.
Note: the core Allegro library does not support any image file formats by default. You must use the allegro_image addon, or register your own format handler.
like genuinely, do not skip that note. you will be sitting there going "why is my bitmap NULL π" and the answer is you didn't pull in the addon. it's giving user error, and it's giving all of us at some point, no shame, just fix it π
π SEE ALSO π
al_load_bitmap_flags(3alleg5)al_load_bitmap_f(3alleg5)al_register_bitmap_loader(3alleg5)al_set_new_bitmap_format(3alleg5)al_set_new_bitmap_flags(3alleg5)al_init_image_addon(3alleg5)
go read those too, they're the rest of the friend group π
and that's the whole page, bestie β¨ this one came straight out of the Allegro reference manual, filed under al_load_bitmap(3alleg5). mwah, go load something pretty πππ¦
π¦ 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