SDL_HasRectIntersectionFloat(3)
๐ SDL_HasRectIntersectionFloat(3) ๐
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_HasRectIntersectionFloat. yes she's a whole function. yes she's in the SDL3 manual. let's get into it ๐ซถ
โจ NAME โจ
SDL_HasRectIntersectionFloat โ figure out whether two rectangles intersect, but like... with float precision. ๐
๐ธ SYNOPSIS ๐ธ
#include <SDL3/SDL_rect.h>
bool SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
๐ฆ DESCRIPTION ๐ฆ
So the vibe check here is simple: you hand her two rectangles, she tells you if they overlap. that's it. that's the whole job. iconic, no notes โจ
โ ๏ธ but bestie, listen: if either pointer isNULL, the function will returnfalse. not an error, not a crash, just a chill littlefalse. so don't come for her if you passed nothing. ๐
๐ FUNCTION PARAMETERS ๐
Aโ anSDL_FRectstructure representing the first rectangle. ๐Bโ anSDL_FRectstructure representing the second rectangle. ๐
two rectangles. two pointers. one destiny. ๐
โญ RETURN VALUE โญ
- Returns
trueif there is an intersection ๐ฅ - Returns
falseotherwise ๐
that's the whole range, no secret third option, no "maybe", she does not do situationships. periodt. ๐
๐ง THREAD SAFETY ๐ง
It is safe to call this function from any thread. ๐
literally any thread. go wild. thread it from the main thread, thread it from a worker, she does not care, she is unbothered and thriving. ๐
๐ AVAILABILITY ๐
this one is available since SDL 3.2.0. so if you're on something older, she's not there yet, and no amount of manifestation will summon her. ๐ฎ
๐ SEE ALSO ๐
SDL_GetRectIntersectionFloat(3)โ the sister function, she actually gives you the intersection instead of just y/n-ing you. iykyk. ๐ซถ
Simple Directmedia Layer ยท SDL 3.4.18 โ and that's the whole page bestie, written in the SDL 3.4.18 era of the Simple Directmedia Layer manual, tysm for reading, go check if ur rects overlap, mwah ๐โจ๐
๐ฆ 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