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, or NULL to outline the entire rendering target. yes bestie, NULL is 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