SDL_GetRectUnionFloat(3)

✨ SDL_GetRectUnionFloat ✨

okay bestie, so this one is SDL_GetRectUnionFloat(3) from the SDL3 functions lineup, and it's literally the girl who takes two rectangles and smushes them into one big rectangle that covers both. no cap. 🫢


🌸 NAME 🌸

SDL_GetRectUnionFloat β€” calculate the union of two rectangles with float precision πŸ’–

like... float precision. she's precise. she's delicate. she's giving math girlboss.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_rect.h>

bool SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);

πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • A β€” an SDL_FRect structure that's holding your first rectangle. first queen energy πŸ‘‘
  • B β€” an SDL_FRect structure holding your second rectangle. the other one. equally valid. πŸ’…
  • result β€” an SDL_FRect structure that gets filled in with the union of rectangles A and B. yes bestie, she writes into your struct. that's the whole point. πŸ“

πŸ’œ RETURN VALUE πŸ’œ

  • Returns true on success
  • Returns false on failure

and if it's giving failure, you go call SDL_GetError() for more information. that's your 411, that's your tea, that's where the lore lives 😭


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread.

periodt. no locks, no drama, no "wait your turn" β€” any thread, any time. iconic. ✨


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older, she's not there yet, don't gaslight yourself πŸ’€


ngl the vibes here are immaculate: two rects walk in, one bigger rect walks out, everybody claps. no cap. 🧚

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_GetRectUnionFloat(3)

that's the whole page bestie, mwah πŸ’‹ go union some rectangles, you're gonna eat πŸ”₯πŸ‘‘

πŸ“¦ where this page comes from