SDL_RenderRect(3)
π SDL_RenderRect π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_RenderRect(3) β she draws a rectangle on the current rendering target at subpixel precision. yes, subpixel. she's precise like that. π
β¨ NAME β¨
SDL_RenderRect β draw a rectangle on the current rendering target at subpixel precision. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_render.h>
bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect);
π¦ FUNCTION PARAMETERS π¦
rendererβ the renderer that should draw a rectangle. like, the one doing the drawing. give her the job. π«Άrectβ a pointer to the destination rectangle, orNULLto outline the entire rendering target. yes bestie,NULLis a valid move here β it means "the whole screen, go off". π₯
β RETURN VALUE β
Returns true on success or false on failure. if it's a fail, call SDL_GetError() for more info β she'll tell you what went wrong, no cap. π
π THREAD SAFETY π
This function should only be called on the main thread. no side-quests, no other threads, just main character energy on the main thread. periodt. π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something olderβ¦ girl. upgrade. π
π SEE ALSO π
SDL_RenderRects(3)β the plural one. the friend group. go check her out too. β¨
okay that's the whole page, you ate that π this was SDL_RenderRect(3) from the Simple Directmedia Layer crew, documented for SDL 3.4.18 β mwah, go draw some rectangles bestie π§π
π¦ 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