SDL_RenderLines(3)

πŸ’– SDL_RenderLines πŸ’–

okay bestie, gather round, because this one is a little iconic. this is SDL_RenderLines, a function from the SDL3 FUNCTIONS fam, and it does exactly what it says on the tin: it draws a whole series of connected lines onto the current rendering target, at subpixel precision. not pixel precision. SUBpixel. she's precise. she's delicate. she ate. ✨


🌸 NAME 🌸

SDL_RenderLines β€” draw a series of connected lines on the current rendering target at subpixel precision πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_render.h>

bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count);

like. look at her. three little arguments and she's ready to go πŸ’…


πŸ“ FUNCTION PARAMETERS πŸ“

  • renderer β€” the renderer that should draw multiple lines. she's the one holding the pen, fr fr.
  • points β€” the points along the lines. this is your little trail of coordinates, and the lines get stitched through them 🧚
  • count β€” the number of points, and lowkey here's the tea: you're drawing count-1 lines. so if you want N lines you gotta bring N+1 points. no cap, that's just how she works.

⭐ RETURN VALUE ⭐

returns true on success, or false on failure 😭 and if it fails you gotta call SDL_GetError() for more information β€” she'll tell you what went wrong, she's not mysterious like that.


πŸ‘‘ THREAD SAFETY πŸ‘‘

main thread only, bestie. do NOT try to call this from a side thread. this function should only be called on the main thread. periodt.

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, sorry babe, she's not there yet πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

  • SDL_RenderLine(3) β€” the single-line sister, for when one line is all you need 🫢

and that's the whole page, gorgeous. this was brought to you by Simple Directmedia Layer, running version SDL 3.4.18 β€” mwah, take care of her, she's an icon πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from