SDL_RenderRects(3)

✨ SDL_RenderRects(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS page for SDL_RenderRects πŸ’– this is the one in <SDL3/SDL_render.h>, and she is that girl.


πŸŽ€ NAME πŸŽ€

SDL_RenderRects β€” draw some number of rectangles on the current rendering target, at subpixel precision πŸ‘‘

like. not one rectangle. some number of them. a whole lil squad. and they're subpixel-precise so they land exactly where you meant, no cap.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_render.h>

bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);

look at her. three args. zero drama. πŸ’…


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • renderer β€” the renderer which should draw multiple rectangles. this is your main character, the one doing the actual drawing 🫢
  • rects β€” a pointer to an array of destination rectangles. yes bestie, an array, that's the whole point of the "Rects" part 🌈
  • count β€” the number of rectangles. how many of them from that array are getting drawn. tell her the number or she's just guessing fr fr

πŸ’œ RETURN VALUE πŸ’œ

Returns true on success or false on failure 😭

and if it fails? call SDL_GetError() for more information β€” she will tell you exactly what went wrong, go ask her, don't just sit there spiraling πŸ™ˆ


🧚 THREAD SAFETY 🧚

This function should only be called on the main thread. 🚨

main thread only, periodt. don't be out here calling her from some random thread, that's not the vibe check you want to fail πŸ’€


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0 ✨ so if you're on something older, that's why she's not picking up the phone.


πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_RenderRect(3) β€” the singular sister. one rectangle instead of many, iykyk πŸ“

kisses, and go draw some rectangles bestie, you got this πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

this page is brought to you by the fine folks at Simple Directmedia Layer, living in SDL 3.4.18 β€” and she is iconic, no notes 🌈⭐πŸ”₯πŸ’œ

πŸ“¦ where this page comes from