add_clip_rect(3alleg4)

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

okay bestie, we're in the Allegro manual (that's the 3alleg4 girlies, the game programming library, you know the vibe) and today's main character is add_clip_rect. ✨


🌸 NAME 🌸

add_clip_rect β€” intersects a bitmap's clipping rectangle with the given area. Allegro game programming library energy only, no cap. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

void add_clip_rect(BITMAP *bitmap, int x1, int y1, int x2, int y2);

like. that's the whole thing. she's small but she's powerful. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜•: add_clip_rect sets the clipping rectangle of the bitmap you hand it β€” and it sets it to the intersection of two things:

  • the bitmap's current clipping rectangle (whatever it already had going on)
  • the rectangle described by those four coordinates, x1, y1, x2, y2

that's it. that's the function. it doesn't replace your clip rect, it overlaps it with the new one and keeps only the part where they both agree. it's giving "we only hang out where our vibes intersect" fr fr. 🌈

the way it works is genuinely so simple and so iconic of her. no notes. πŸ‘‘


🫢 SEE ALSO 🫢

  • set_clip_rect (3alleg4) β€” when you wanna set the whole thing outright instead of intersecting
  • get_clip_rect (3alleg4) β€” when you wanna peek at what the clip rect currently is
  • set_clip_state (3alleg4) β€” when you wanna turn clipping on or off
  • get_clip_state (3alleg4) β€” when you wanna know if clipping is even on

like a whole little friend group. they come as a set, iykyk. πŸ’œ


okay that's the page!! this was add_clip_rect(3alleg4) from the Allegro manual, version 4.4.3 β€” she's serving 4.4.3 and she's been serving it. mwah. πŸ˜­πŸ’– bye bestie, go clip something responsibly! πŸ“πŸ§šβ€β™€οΈβ­