SDL_RectsEqualEpsilon(3)
π SDL_RectsEqualEpsilon(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we're checking if two float rectangles are basically the same. not exactly the same. within an epsilon. it's giving "close enough is good enough" and honestly? valid.
β¨ NAME β¨
SDL_RectsEqualEpsilon β figure out whether two floating point rectangles are equal, within some given epsilon. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_rect.h>
SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, float epsilon);
π¦ DESCRIPTION π¦
so here's the tea: two rectangles count as equal if both of them are not NULL and each of their x, y, width and height are within epsilon of each other. that's it, that's the whole vibe check. π
and if you're sitting there like "bestie what number do i even put for epsilon π" β the manpage says: if you don't know what value to use for epsilon, you should call the SDL_RectsEqualFloat function instead. she's got you. π«Ά
now, the important part, no cap: note that this is a forced-inline function in a header, and not a public API function available in the SDL library. which is to say, the code is embedded in the calling program and the linker and the dynamic loader will not be able to find this function inside SDL itself. so don't go looking for her in the library, she lives in your code now. iconic behaviour honestly. β¨
π FUNCTION PARAMETERS π
aβ the first rectangle to test. πbβ the second rectangle to test. πepsilonβ the epsilon value for comparison. the lil tolerance window, the "close enough" radius, the grace she deserves. π
β RETURN VALUE β
Returns true if the rectangles are equal, false otherwise. binary. no in-between. slay. π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. go off, multithreaded main character. π₯
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on anything older, no she isn't. π
π SEE ALSO π
SDL_RectsEqualFloat(3)β the one you call when you don't know what epsilon to use. the certified "idk just use this one" queen. πΈ
and that's the page, bestie!! brought to you by the fine folks at Simple Directmedia Layer, straight out of SDL 3.4.18 β this whole SDL_RectsEqualEpsilon(3) moment is theirs, we're just living in it. 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