Re: How about an SDL_RenderFillQuad function?
Jonathan Dearborn <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <CA+DSiHZwrc2zDafOoJJ1CNxEAOKd0E=BLpfp-p8_BhM-egn0pw@mail.gmail.com> |
It would probably be better to have a function for arbitrary geometry composed of triangles, like this one (SDL_RenderGeometry()): https://bugzilla.libsdl.org/show_bug.cgi?id=1734 But that feature has been waiting for over three years... and this related one is 5 years old: https://bugzilla.libsdl.org/show_bug.cgi?id=1138 Either of those would enable us to implement rotated quad rendering and keep the API lean. In the meantime, I've suggested SDL_gpu if you really need this now. Jonny D On Fri, Sep 30, 2016 at 8:37 AM, 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 > > _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org