[SDL] How about an SDL_RenderFillQuad function?

SeanOConnor sean at windowsgames.co.uk
Fri Sep 30 05:37:13 PDT 2016


I need to draw a graph in my game but it looks like the SDL_RenderDrawLine only draws lines 1 pixel wide. With a bit of maths I can work out the 4 points needed to draw a line of any width but the only SDL function that draws a primitive seems to be:

SDL_RenderFillRect

which only draws rectangles with no rotation.

I'm guessing this SDL function just draws two triangles to make this rectangle based on the SDL_Rect it's sent, so surely it'd be trivial to create a new function SDL_RenderFillQuad that accepts four SDL_Points and draws two triangles based on that?

And maybe an SDL_RenderFillTriangle too that takes three SDL_Points?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20160930/9f0f82dc/attachment.htm>


More information about the SDL mailing list