Re: SDL_RenderDrawLine endpoint inconsistency

"rtrussell" <[email protected]> Thu, 12 Jan 2017 20:01:37 +0000
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
Since nobody has ventured an opinion I've looked at the source and there seems to be code specifically to make Linux behave differently; the trouble is, according to my tests, it makes Linux behave wrongly:

sdl_render_gl.c: 
Code:
#if defined(__MACOSX__) || defined(__WIN32__)
        /* Mac OS X and Windows seem to always leave the last point open */
        data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y);
#else
        /* Linux seems to leave the right-most or bottom-most point open */
        x1 = points[0].x;
        y1 = points[0].y;
        x2 = points[count-1].x;
        y2 = points[count-1].y;

        if (x1 > x2) {
            data->glVertex2f(0.5f + x1, 0.5f + y1);
        } else if (x2 > x1) {
            data->glVertex2f(0.5f + x2, 0.5f + y2);
        }
        if (y1 > y2) {
            data->glVertex2f(0.5f + x1, 0.5f + y1);
        } else if (y2 > y1) {
            data->glVertex2f(0.5f + x2, 0.5f + y2);
        }
#endif


It seems unlikely that OpenGL works differently on Linux by design so should this code still be in SDL?

Richard.

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org