is_same_bitmap(3alleg4)

πŸ’– is_same_bitmap πŸ’–

okay bestie, so this one lives in the Allegro manual β€” section 3alleg4 β€” and it's a lil function from the Allegro game programming library that answers the eternal question: are these two bitmaps actually the same drawing surface?? πŸ‘€


✨ SYNOPSIS ✨

#include <allegro.h>

int is_same_bitmap(BITMAP *bmp1, BITMAP *bmp2);

🌸 DESCRIPTION 🌸

so you hand it two bitmaps, bmp1 and bmp2, and it comes back with TRUE if those two describe the same drawing surface. that's it. that's the whole vibe check. 🫢

and bestie, "same drawing surface" is doing some heavy lifting here, because there are like three ways two bitmaps can be the same:

  1. the pointers are equal β€” literally the same bitmap, same address, no cap πŸ’…
  2. one is a sub-bitmap of the other πŸ¦‹
  3. they're both sub-bitmaps of a common parent β€” sisters, same source, iconic ✨

so like… not me expecting it to just compare addresses 😭 it's so much smarter than that. it actually knows the family tree. main character energy fr fr πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


ngl this is the function you want whenever you're about to draw on something and you're like "wait. is this thing literally the thing i already have" β€” because lowkey the answer is more complicated than == πŸ’€

and that's the whole page, bestie!! 🌈 this was Allegro manual page is_same_bitmap(3alleg4), from Allegro version 4.4.3 β€” periodt. go forth and compare your drawing surfaces responsibly πŸŽ€πŸ§šπŸ’œ