SDL_GetRectEnclosingPoints(3)
π SDL_GetRectEnclosingPoints π
okay so bestie, welcome to SDL_GetRectEnclosingPoints(3) β it's a lil function from the SDL3 crew and it's literally just "draw me the smallest box that fits all these points" energy. no cap. she's giving bounding box, she's giving minimal rectangle, she's iconic. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_rect.h>
bool SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
πΈ DESCRIPTION πΈ
So like, here's the tea π: if clip is not NULL, then only the points that are inside the clipping rectangle get considered. that's it, that's the whole vibe. everyone else gets left on read. π
π«Ά FUNCTION PARAMETERS π«Ά
pointsβ an array ofSDL_Pointstructures, aka the lil guys you wanna enclose. the squad. the whole group chat. β¨countβ how many structures are chillin' in thatpointsarray. bestie needs a headcount, she doesn't do surprises.clipβ anSDL_Rectyou use for clipping, orNULLif you want to enclose all the points, no filter, no gatekeeping, let everybody in. πresultβ anSDL_Rectstructure that gets filled in with the minimal enclosing rectangle. she gets dressed up with your answer. cute. π
π RETURN VALUE π
Returns true if any points were enclosed, or false if all the points were outside of the clipping rectangle β which is the sad path, the "nobody made it in" path, the π path. fr fr.
π§ THREAD SAFETY π§
It is safe to call this function from any thread. periodt. call her from wherever, she does not care, she is unbothered, she is thriving. π¦
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, no she's not there yet, you gotta upgrade bestie. π
mwah π that's the whole page. go enclose some points, you got this.
this lil love letter came to you from Simple Directmedia Layer, living in SDL 3.4.18, and she answers to the name SDL_GetRectEnclosingPoints(3). πΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms