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 β€” an SDL_FRect structure representing the first rectangle. πŸ“
  • B β€” an SDL_FRect structure representing the second rectangle. 🧚
  • result β€” an SDL_FRect structure filled in with the intersection of rectangles A and B. πŸ‘‘

⭐ 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 πŸ‘‘


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