[SDL] How about an SDL_RenderFillQuad function?

Sanette sanette-linux at laposte.net
Fri Sep 30 08:24:22 PDT 2016


for lines, you can store a line in a texture (or, for that matter, you 
can simply store a pixel)
and then rotate and strech the texture with SDL_RenderCopyEx

Le 30/09/2016 à 17:07, SeanOConnor a écrit :
> For now I've done:
>
>
>
>
>
>
>
>
> Code:
>
> for (xx=-1; xx<=+1; xx++)
> {
>    for (yy=-1; yy<=+1; yy++)
>    {
>       SDL_RenderDrawLine(m_pRenderer,
>                      ptFrom.x + xx,
>                      ptFrom.y + yy,
>                      ptTo.x + xx,
>                      ptTo.y + yy);
>    }
> }
>
>
>
>
> I just thought that adding a quad, triangle or arbitrary number of 
> points function would be so easy (as rects are drawn with triangles 
> anyway) it might as well be added, and I was surprised those functions 
> weren't there already.
>
> I took a look at SDL_gpu but I'm wary of trying something without much 
> documentation and potential future support. It does seem to use 
> floating points for coordinates though which is another thing I don't 
> get why SDL doesn't use.
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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


More information about the SDL mailing list