is_inside_bitmap(3alleg4)

πŸ’– is_inside_bitmap β€” Allegro manual πŸ’–

okay bestie, welcome to the is_inside_bitmap page, straight outta the Allegro manual for the Allegro game programming library ✨ this one's short, it's sweet, and it's literally just "is this point in the box or not" πŸŽ€


🌸 NAME 🌸

is_inside_bitmap β€” tells if a point is inside a bitmap. Allegro game programming library. 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 little args. no drama. πŸ¦‹


🫢 DESCRIPTION 🫢

So the tea is this: is_inside_bitmap returns non-zero if the point (x, y) lies inside the bitmap. that's the vibe check. inside = non-zero, outside = zero, no in-between, no "it's complicated" πŸ’€

now here's the part where you have to actually pay attention because clip changes everything:

  • if clip is non-zero β€” the function compares the coordinates with the clipping rectangle. so it returns non-zero if the point lies inside the clipping rectangle, OR if clipping is disabled for the bitmap. yep, either one, both count, slay 🌈
  • if clip is zero β€” the function compares the coordinates with the actual dimensions of the bitmap. the raw bitmap. the real one. no clipping rectangle involved at all, periodt πŸ‘‘

so basically you pick which box you're asking about: the clip box or the actual bitmap box. that's the whole personality. obsessed πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€

go read those next bestie, they're all in the same friend group fr fr πŸ’œ


okay that's the page!! this was Allegro, version 4.4.3, and this gorgeous little manpage is is_inside_bitmap(3alleg4) β€” mwah, no notes, go check your points, love u, bye πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’