SDL_GetRectIntersectionFloat(3)
β¨ SDL_GetRectIntersectionFloat β¨
okay so bestie, welcome to the SDL3 FUNCTIONS section, and today's main character is SDL_GetRectIntersectionFloat β she's giving math, she's giving precision, she's giving "where do these two rectangles even overlap tho" π
π NAME π
SDL_GetRectIntersectionFloat β Calculate the intersection of two rectangles with float precision. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_rect.h>
bool SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
π DESCRIPTION π
okay so here's the vibe: you hand her two rectangles and she figures out where they overlap. float precision, no less. very demure, very precise β¨
and listen β if result is NULL then this function will return false. that's it, that's the deal. no result box to write into, no intersection to report. periodt.
π«Ά FUNCTION PARAMETERS π«Ά
Aβ anSDL_FRectstructure representing the first rectangle. πBβ anSDL_FRectstructure representing the second rectangle. π§resultβ anSDL_FRectstructure filled in with the intersection of rectanglesAandB. π
β RETURN VALUE β
Returns true if there is an intersection, false otherwise. like, she's not gonna leave you guessing, she's gonna tell you straight up π
π THREAD SAFETY π
It is safe to call this function from any thread. yes bestie, any thread. go wild, she can handle it π₯
π AVAILABILITY π
This function is available since SDL 3.2.0. if you're on anything older, sorry babe, she wasn't born yet π
π SEE ALSO π
SDL_HasRectIntersectionFloat(3)β for when you just wanna know if they overlap and not where, iykyk π
mwah π that's the whole page. source is the Simple Directmedia Layer, version SDL 3.4.18 β stay slay, go intersect some rectangles, and remember: NULL result gets you a false, every single time πβ¨
π¦ 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