Re: How about an SDL_RenderFillQuad function?
Melker Narikka <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <CAFbsDthrxB4D4mugyC3Ea-_wAdUbFNBNA5oHcktGCbmHL9FT6w@mail.gmail.com> |
If you're not too worried about performance, you could draw a rectangle into an SDL_Texture and then draw it rotated with SDL_RenderCopyEx. Of course you'd have to do a bit more additional arithmetic yourself as the function takes an angle in degrees. -- Melker Narikka On Fri, Sep 30, 2016 at 3:37 PM, SeanOConnor <[email protected]> wrote: > 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? > > _______________________________________________ > SDL mailing list > [email protected] > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org >