SDL_RectEmpty(3)

πŸ’– SDL_RectEmpty πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_RectEmpty ✨


🌸 NAME 🌸

SDL_RectEmpty β€” literally just tells you whether a rectangle has no area. that's it. that's the whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_rect.h>

SDL_FORCE_INLINE bool SDL_RectEmpty(const SDL_Rect *r);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, a rectangle counts as "empty" for this function if either of these is true:

  • r is NULL πŸ™ˆ
  • r's width and/or height are <= 0 😭

that's the vibe check. zero area = empty, no cap.

⚠️ but WAIT, important lore: this is a forced-inline function in a header, NOT a public API function you can find in the SDL library itself. which means the code gets embedded right into the calling program 🫢 and the linker and the dynamic loader will not be able to find this function inside SDL. it's giving "i live in your code now", not "i live in the shared object". iykyk πŸ’€

πŸ“ FUNCTION PARAMETERS πŸ“

  • r β€” the rectangle to test πŸ‘‘

⭐ RETURN VALUE ⭐

returns true if the rectangle is "empty", and false otherwise ✨


πŸ’œ THREAD SAFETY πŸ’œ

it is safe to call this function from any thread. go off, queen, no locking required 🌈


🌸 AVAILABILITY 🌸

this function has been available since SDL 3.2.0 πŸŽ€


and that's the whole page, bestie, you ate it up πŸ‘‘

this was brought to you by Simple Directmedia Layer, version SDL 3.4.18, dated SDL_RectEmpty(3) β€” mwah, stay iconic πŸ’–πŸ§šβœ¨

πŸ“¦ where this page comes from