Ah… Nasty.
Anyway, I was rather thinking about the general API design, and specifically
supporting the three cases; individual lines, line strips and polygons. All
three variants should render the final pixels, but line strips and polygons
should not generate overdraw, except when lines are crossed.
Now, unless we’re switching to a Begin/…/End style interface, this would
mean something like this:
SDL_RenderLines(int npoints, int *x, int *y);
SDL_RenderLineStrip(int npoints, int *x, int *y);
SDL_RenderLinePolygon(int npoints, int *x, int *y);
(An odd number for ‘npoints’ to SDL_RenderLines() would be an error.)
Of course, one could keep the current SDL_RenderLine() as a convenient
shortcut for drawing a single line, or drop SDL_RenderLines() entirely. It’s
mostly a performance hack for certain backends.On Tuesday 08 December 2009, at 10.03.38, Sam Lantinga wrote:
Unfortunately GL_LINES has the behavior I described of not rendering
the final pixel. It’s actually worse than that, it doesn’t render a
final pixel, and which one is left undefined and is implementation
dependent.
–
//David Olofson - Developer, Artist, Open Source Advocate
.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’