create_video_bitmap(3)

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

πŸ’– create_video_bitmap β€” the Allegro manual, but make it cute πŸ’–

okay bestie, welcome to create_video_bitmap(3), a page straight out of the Allegro manual for the Allegro game programming library. yes we are in the Allegro docs and yes we are thriving. let's get into it πŸ¦‹


✨ NAME ✨

create_video_bitmap β€” literally just creates a video memory bitmap. that's it. that's the whole thing. Allegro game programming library representation, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

BITMAP *create_video_bitmap(int width, int height);

look at her. iconic signature. BITMAP *, two ints, and she's serving πŸŽ€


πŸ‘‘ DESCRIPTION πŸ‘‘

so what does she actually do? she allocates a video memory bitmap of the specified size. main character energy fr fr.

you can use this to:

  • allocate offscreen video memory for storing source graphics that are ready for a hardware accelerated blitting operation, or
  • create multiple video memory pages which you can then display by calling show_video_bitmap().

also, the docs are like "go read the introduction of this chapter" for a comparison with other types of bitmaps and other specific details β€” so if you want the full lore, that's where it lives πŸ“–βœ¨

⚠️ Warning, and this one matters: video memory bitmaps are usually allocated from the same space as the screen bitmap, so they may overlap with it. therefore it is not a good idea to use the global screen at the same time as any surfaces returned by this function. like, don't do it. i'm begging 🫢

πŸ’€ RETURN VALUE πŸ’€

  • Success: returns a pointer to the bitmap πŸ’–
  • Failure: returns NULL if you have run out of video ram 😭

and listen β€” remember to destroy this bitmap before any subsequent call to set_gfx_mode(). that is not optional, that is a lifestyle. free your memory, bestie 🧚


🌈 SEE ALSO 🌈

the whole friend group, in order, exactly as they appear:


and that's the page!! this lil beauty came to you courtesy of Allegro, version 4.4.3 β€” go allocate something iconic and stay hydrated πŸ“πŸ’œ

πŸ“¦ where this page comes from