SDL_GetRectUnion(3)

✨ SDL_GetRectUnion ✨

okay so bestie, welcome to the SDL_GetRectUnion page of the SDL3 FUNCTIONS manual πŸ’– this one's a lil math baddie and honestly? she eats.


πŸŽ€ NAME πŸŽ€

SDL_GetRectUnion β€” calculate the union of two rectangles. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_rect.h>

bool SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);

like. look at her. three pointers, one bool, zero drama ✨


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • A β€” an SDL_Rect structure representing the first rectangle. rect number one, the OG, the main character πŸ‘‘
  • B β€” an SDL_Rect structure representing the second rectangle. rect number two, here to get merged with her bestie 🫢
  • result β€” an SDL_Rect structure that gets filled in with the union of rectangles A and B. note the vibe: she writes into this one, she doesn't just read it. it's giving output parameter energy πŸ’–

⭐ RETURN VALUE ⭐

Returns true on success or false on failure 😭 and if you got the false? you gotta call SDL_GetError() for more information, no cap. that's where the tea is πŸ“


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. literally any of them. go wild, be free, thread it up 🌈✨


πŸ’œ AVAILABILITY πŸ’œ

This function is available since SDL 3.2.0. so if you're on something older, sorry babe, she's not there yet πŸ™ˆ


ngl there's no SEE ALSO section on this page, so we're just gonna sit here and appreciate her on her own πŸ’…

and that's the whole page, bestie!! this came to you straight from the Simple Directmedia Layer crew, version SDL 3.4.18, and it's the SDL_GetRectUnion(3) page πŸŽ€ mwah, go union some rectangles, ily πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from