create_bitmap_ex(3)
β¨ create_bitmap_ex β¨
okay bestie, welcome to the Allegro manual π β this is the page for create_bitmap_ex, and it's gonna be so good, I promise.
πΈ NAME πΈ
create_bitmap_ex β it makes you a memory bitmap, but with a color depth you pick yourself π
Part of the Allegro game programming library.
π SYNOPSIS π
#include <allegro.h>
BITMAP *create_bitmap_ex(int color_depth, int width, int height);
π¦ DESCRIPTION π¦
okay so. this function creates a bitmap in a specific color depth. the depths you can ask for are 8, 15, 16, 24 or 32 bits per pixel. that's it, that's the whole vibe. π«Ά
here's the example, and it literally eats every time:
/* Create screen sized bitmap in 32 bits per pixel. */
BITMAP *bmp = create_bitmap_ex(32, SCREEN_W, SCREEN_H);
if (!bmp)
abort_on_error("Couldn't create bitmap!");
/* Use the bitmap. */
...
/* Destroy it when we don't need it any more. */
destroy_bitmap(bmp);
see how she does it? make it, check it actually happened, use it, then clean it up. that's main character energy β¨
π RETURN VALUE π
she hands you back a pointer to the bitmap she made π β or NULL if the bitmap could not be created (yes, that happens, it's giving π).
IMPORTANT: remember to free this bitmap later, bestie. not freeing it = memory leaks, and memory leaks are not the vibe. π
β SEE ALSO β
create_bitmap(3)create_sub_bitmap(3)create_video_bitmap(3)create_system_bitmap(3)destroy_bitmap(3)is_memory_bitmap(3)clear_bitmap(3)clear_to_color(3)ex12bit(3)exlights(3)exrgbhsv(3)extrans(3)
and that's the whole page, no cap π go make some bitmaps, bestie, you've got this. mwah π π
this was brought to you by Allegro, version 4.4.3, and this very page, create_bitmap_ex(3) π bye bestie!! π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms