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