From 3110c4d9fb1d04fcdcd163b9d88835bb737eb996 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 21 Nov 2009 06:19:34 +0000 Subject: [PATCH] It's not the last pixel, it's the rightmost pixel, or if they're both the same x coordinate, the bottommost pixel. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404211 --- src/video/SDL_renderer_gl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_renderer_gl.c b/src/video/SDL_renderer_gl.c index 0ef0ca2a2..9b1e71b77 100644 --- a/src/video/SDL_renderer_gl.c +++ b/src/video/SDL_renderer_gl.c @@ -1155,9 +1155,17 @@ GL_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) data->glVertex2f(0.5f + x2, 0.5f + y2); data->glEnd(); - /* For some reason the second endpoint is skipped */ + /* For some reason the rightmost or lowest endpoint is skipped */ data->glBegin(GL_POINTS); - data->glVertex2f(0.5f + x2, 0.5f + y2); + if (x1 > x2) { + data->glVertex2f(0.5f + x1, 0.5f + y1); + } else if (x2 > x1) { + data->glVertex2f(0.5f + x2, 0.5f + y2); + } else if (y1 > y2) { + data->glVertex2f(0.5f + x1, 0.5f + y1); + } else if (y2 > y1) { + data->glVertex2f(0.5f + x2, 0.5f + y2); + } data->glEnd(); return 0;