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 β€” an SDL_Rect structure representing the first rectangle. the main character rectangle, if you will πŸ‘‘
  • B β€” an SDL_Rect structure 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 πŸ‘‘


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