is_inside_bitmap(3)

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

✨ is_inside_bitmap ✨

okay bestie, welcome to the is_inside_bitmap page from the Allegro manual β€” yes, the Allegro game programming library, we're being ✨retro✨ today and honestly? iconic of us. πŸŽ€


🌸 NAME 🌸

is_inside_bitmap β€” tells you if a point is inside a bitmap. that's it, that's the whole job, and she does it flawlessly. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int is_inside_bitmap(BITMAP *bmp, int x, int y, int clip);

look at her. four args, one int back. no drama, no notes. 🫢


πŸ’– DESCRIPTION πŸ’–

so here's the tea: this function returns non-zero if the point (x, y) lies inside the bitmap. that's the vibe check you're running. πŸ’«

but here's where it gets spicy, because that little clip argument is doing SO much work:

  • If clip is non-zero, the function compares the coordinates with the clipping rectangle. so basically it returns non-zero if the point lies inside the clipping rectangle β€” OR if clipping is disabled for the bitmap entirely (she's generous like that πŸ’…).
  • If clip is zero, the function compares the coordinates with the actual dimensions</c> of the bitmap. no clipping rectangle involvement, just the raw real geometry, fr fr.

so like… same function, two whole personalities, depending on whether you pass a 0 or not. main character energy honestly. πŸ‘‘


🌈 SEE ALSO 🌈

go be nosy, bestie, these are all in the same friend group:


and that's the whole page, bestie!! πŸ¦‹ this little legend comes to you courtesy of Allegro, version 4.4.3 β€” written by the Allegro people, she's been holding down bitmaps since forever, and we love her for it. periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from