SDL_HasRectIntersection(3)
π SDL_HasRectIntersection π
okay bestie, welcome to the SDL_HasRectIntersection(3) page, part of the SDL3 functions lineup β¨ β this one's a lil baby function but it's lowkey iconic, no cap.
πΈ NAME πΈ
SDL_HasRectIntersection β figure out whether two rectangles intersect or not. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_rect.h>
bool SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
π¦ DESCRIPTION π¦
so here's the tea: this function tells you if two rectangles overlap. but listen β if either pointer is NULL, the function will return false. like, it's not gonna crash out on you, it just says nope π
π FUNCTION PARAMETERS π
Aβ anSDL_Rectstructure representing the first rectangle. the main character rectangle, if you will πBβ anSDL_Rectstructure representing the second rectangle. the love interest rectangle π«Ά
β RETURN VALUE β
Returns true if there is an intersection, false otherwise. simple as that, periodt π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. go off, multithreaded queen π
π AVAILABILITY π
This function is available since SDL 3.2.0. yes, she's been here a minute π
π SEE ALSO π
SDL_GetRectIntersection(3)β the sibling function, the one that actually gives you the overlap rectangle. iykyk π₯
okay that's the whole page, mwah π this was Simple Directmedia Layer, SDL 3.4.18, dated SDL_HasRectIntersection(3) β love u, bye bestie πβ¨
π¦ 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