[SDL] How about an SDL_RenderFillQuad function?

SeanOConnor sean at windowsgames.co.uk
Fri Sep 30 08:07:54 PDT 2016


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.




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


More information about the SDL mailing list