is_memory_bitmap(3alleg4)

is_memory_bitmap πŸ’–

ok so this is a page from the Allegro manual, section 3alleg4, and it's literally just one tiny function that answers one very important question: is this bitmap a memory bitmap or not? bestie it's giving "am I the main character" but for bitmaps ✨


✨ NAME ✨

is_memory_bitmap β€” tells you if a bitmap is a memory bitmap πŸŽ€

(also: it's part of the Allegro game programming library, iykyk πŸ’…)


🌸 SYNOPSIS 🌸

#include <allegro.h>

int is_memory_bitmap(BITMAP *bmp);

like. that's the whole thing. one include, one call, one int back. no cap 🫢


πŸ’« DESCRIPTION πŸ’«

okay so here's the tea πŸ“ β€” is_memory_bitmap returns TRUE if bmp is a memory bitmap. and what even is a memory bitmap, you ask? it's one that was:

  • created by calling create_bitmap(), or
  • loaded from a grabber datafile or image file πŸŽ€

that's the vibe check. if it passes either of those, boom, you get TRUE. πŸ”₯

and the reason you'd even care, bestie, is that memory bitmaps can be accessed directly through the line pointers in the bitmap structure, like this:

bmp->line[y][x] = color;

so you can just reach in there and poke pixels yourself. very main character energy, no middleman, we love to see it πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

(they're the siblings fr fr, go say hi πŸ’œ)


Allegro, version 4.4.3 β€” and that's the whole page, is_memory_bitmap(3alleg4), wrapped up with a little bow πŸŽ€ thanks for coming to my TED talk, go forth and poke pixels responsibly πŸ’–πŸŒˆβœ¨