From b361f7fac83a8cb0159ac708db976649c0cf6ea8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 16 Oct 2010 17:14:04 -0700 Subject: [PATCH] =?UTF-8?q?This=20fixes=20SDL=5Frenderer=5Fgl=20so=20that?= =?UTF-8?q?=20it=20builds=20with=20c89.=20From:=20Fran=C3=A7ois=20Revol=20?= =?UTF-8?q?=20Checked=20By:=20Scott=20McCreary=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/video/SDL_renderer_gl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video/SDL_renderer_gl.c b/src/video/SDL_renderer_gl.c index b2d8084ec..2d9d6e4d8 100644 --- a/src/video/SDL_renderer_gl.c +++ b/src/video/SDL_renderer_gl.c @@ -1181,6 +1181,8 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, } data->glEnd(); } else { + int x1, y1, x2, y2; + data->glBegin(GL_LINE_STRIP); for (i = 0; i < count; ++i) { data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); @@ -1200,10 +1202,10 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, 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 */ - int x1 = points[0].x; - int y1 = points[0].y; - int x2 = points[count-1].x; - int y2 = points[count-1].y; + 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);