SDL_RectToFRect(3)
π SDL_RectToFRect(3) π
okay so bestie, welcome to another episode of SDL3 FUNCTIONS that you're gonna wanna know about. This one is SDL_RectToFRect and it's literally exactly what it sounds like β it's giving glow-up for your rectangles. π¦
β¨ NAME β¨
SDL_RectToFRect β Convert an SDL_Rect to SDL_FRect π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_rect.h>
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect);
β¨ FUNCTION PARAMETERS β¨
rectβ a pointer to anSDL_Rect. π That's your regular ol' integer rectangle, the one you're holding right now.frectβ a pointer filled in with the floating point representation ofrect. πΈ So this is where the glow-up lands. The function writes into it, it doesn't read from it. iykyk.
β¨ THREAD SAFETY β¨
It is safe to call this function from any thread. No cap. Every thread, all at once, no drama, no locks, no nothing. π
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0. So if you're on something older, it's not you, it's your version. π
π real talk though:frectis a pointer filled in, so don't go passing an uninitialized orNULLpointer unless you want chaos. The manpage says what it says, and I'm just the messenger. π«Ά
k bye bestie, go float some rects, you ate π β¨
β written under the watch of Simple Directmedia Layer, SDL 3.4.18, in SDL_RectToFRect(3), periodt. ππ
π¦ 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