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 drawingcount-1lines. 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
- 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