SDL_GetRectE...ngPointsFloat(3)

πŸ’– SDL_GetRectEnclosingPointsFloat(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_GetRectEnclosingPointsFloat β€” she's a real one, no cap. πŸŽ€


✨ NAME ✨

SDL_GetRectEnclosingPointsFloat β€” calculate a minimal rectangle enclosing a set of points with float precision. literally she draws the tightest little box around your pointies. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_rect.h>

bool SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);

πŸ’… DESCRIPTION πŸ’…

So here's the tea: if clip is not NULL, then only the points inside of the clipping rectangle get considered. everyone else? not invited to the party. πŸ™ˆ


🫢 FUNCTION PARAMETERS 🫢

  • points β€” an array of SDL_FPoint structures representing the points to be enclosed. your lil squad of coordinates, basically. πŸ‘‘
  • count β€” the number of structures in the points array. how many besties are actually showing up. ⭐
  • clip β€” an SDL_FRect used for clipping, or NULL to enclose all the points. the VIP velvet rope, or no rope at all. 🌈
  • result β€” an SDL_FRect structure filled in with the minimal enclosing rectangle. this is where the finished box gets dropped off. πŸ’œ

πŸ”₯ RETURN VALUE πŸ”₯

Returns true if any points were enclosed, or false if all the points were outside of the clipping rectangle. so like, false = nobody made it past the bouncer. πŸ’€


🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. periodt. go off from wherever you want, she doesn't care. ✨


🌟 AVAILABILITY 🌟

This function is available since SDL 3.2.0. so if you're on something older… yeah, she's not there yet, sorry babe. 😭


lowkey important: that clip check is the whole vibe β€” NULL means every point counts, and a real rectangle means only the inside ones do. don't forget it or your box will be giving unexpected energy. πŸ’…

okay that's the whole page bestie, you ate it up πŸ“ β€” this was Simple Directmedia Layer, version SDL 3.4.18, dated with all the love of SDL_GetRectE...ngPointsFloat(3). mwah, go enclose some points, you icon. πŸ’–πŸŒˆπŸŽ€

πŸ“¦ where this page comes from