SDL_RenderFillRects(3)
π SDL_RenderFillRects(3) π
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the internet π pull up a chair, we're talking about SDL_RenderFillRects(3) and honestly? it's giving efficiency queen π
β¨ NAME β¨
SDL_RenderFillRects β fill some number of rectangles on the current rendering target with the drawing color at subpixel precision π
like. MULTIPLE rects. ONE call. the way that she just does that π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_render.h>
bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
that's it. that's the whole vibe. one line, infinite rectangles β¨
π¦ FUNCTION PARAMETERS π¦
rendererβ the renderer which should fill multiple rectangles. yes bestie, THE renderer, the one you made, the main character of your whole rendering situation πrectsβ a pointer to an array of destination rectangles. an ARRAY. as in more than one. as in we're doing this in bulk, no cap π¦countβ the number of rectangles. she needs to know how many. tell her how many. don't leave her guessing π
β RETURN VALUE β
Returns true on success or false on failure β and if it's a false girlie, you gotta call SDL_GetError() for more information π lowkey mandatory, not optional, do it.
ngl if you get false and just move on with your life, the error message is still sitting there waiting for you. just check it. please. for me π«Ά
π§ THREAD SAFETY π§
This function should only be called on the main thread. MAIN THREAD ONLY. periodt π do not be out here calling this from a worker thread and then acting surprised when the universe gets weird. she's monogamous, she's main-thread-only, respect the boundary π
π AVAILABILITY π
This function is available since SDL 3.2.0 β so if you're on anything older, bestie, this one is not for you, and that's simply the tea β
π SEE ALSO π
SDL_RenderFillRect(3)β the single-rect little sister π same energy, one rectangle, still iconic
π the sign-off π
this lil page came to you courtesy of the Simple Directmedia Layer girlies, straight out of SDL 3.4.18 π«Ά go fill some rectangles, you're doing amazing, and remember: subpixel precision means she's precise AND she's got range π β¨ bye 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