SDL_RenderFillRect(3)
π SDL_RenderFillRect(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_RenderFillRect β yes, the actual full name, no nickname energy here π
β¨ NAME β¨
SDL_RenderFillRect β fills a rectangle on the current rendering target with the drawing color, and it does it at subpixel precision π like, it's not gonna snap your rectangle to whole pixels, it's giving finesse.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_render.h>
bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect);
that's it. two arguments. you got this fr fr π«Ά
π¦ FUNCTION PARAMETERS π¦
rendererβ the renderer that should fill a rectangle. it's your renderer, the one doing the filling, the main character of this operation πrectβ a pointer to the destination rectangle you wanna fill. or, and hear me out,NULLβ which means the entire rendering target. like, all of it. the whole vibe. π
β RETURN VALUE β
returns true on success, or false on failure π and if it's a fail, pls call SDL_GetError() for more info β she will tell you what went wrong, no cap.
π THREAD SAFETY π
this function should only be called on the main thread. not the side threads. not the background ones. the MAIN one. periodt.
π§ AVAILABILITY π§
this function is available since SDL 3.2.0 β¨ so if you're on something older, bestie, that's a you problem (respectfully) π
π₯ SEE ALSO π₯
SDL_RenderFillRects(3)β the plural one, for when one rectangle just isn't enough and you need the whole squad π
and that's the whole page, you ate it π mwah π
signing off from Simple Directmedia Layer β SDL 3.4.18 β SDL_RenderFillRect(3), bestie edition πΈπ¦β¨
π¦ 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