SDL_RectsEqual(3)
π SDL_RectsEqual(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_RectsEqual β the little header function that tells you whether two rectangles are, like, the same rectangle. π¦
β¨ NAME β¨
SDL_RectsEqual β figure out whether two rectangles are equal, no cap. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_rect.h>
SDL_FORCE_INLINE bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b);
β¨ DESCRIPTION β¨
so here's the vibe check: two rectangles count as equal only if both of them are not NULL and each of their x, y, width and height all match. every single one. all four. no skipping. π
β οΈ now the important part, bestie, listen up: this is a forced-inline function in a header, not a public API function that lives in the SDL library. which is to say β the code gets embedded straight into the calling program, and the linker and the dynamic loader will not be able to find this function inside SDL itself. it's giving "I live in your code now". π so don't go looking for it in the library, she's not there, she's already home. π«Ά
β¨ FUNCTION PARAMETERS β¨
aβ the first rectangle you wanna test. πbβ the second rectangle you wanna test. πΈ
β¨ RETURN VALUE β¨
returns true if the rectangles are equal, and false otherwise. that's it, that's the whole answer. β
β¨ THREAD SAFETY β¨
it is safe to call this function from any thread. go off, parallel besties. π§
β¨ AVAILABILITY β¨
this function has been available since SDL 3.2.0. so if you're on anything olderβ¦ girl. π
and that's the whole page, periodt. π
signing off from the Simple Directmedia Layer, running SDL 3.4.18 β stay iconic, keep your rects equal, and don't forget to check for NULL. mwah. πβ¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms