Commit 6340df79 authored by Sam Lantinga's avatar Sam Lantinga

This fixes SDL_renderer_gl so that it builds with c89.

From: François Revol <revol@free.fr>
Checked By: Scott McCreary <scottmc2@gmail.com>
parent 2b7c1494
...@@ -1181,6 +1181,8 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, ...@@ -1181,6 +1181,8 @@ GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
} }
data->glEnd(); data->glEnd();
} else { } else {
int x1, y1, x2, y2;
data->glBegin(GL_LINE_STRIP); data->glBegin(GL_LINE_STRIP);
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); 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, ...@@ -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); data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y);
#else #else
/* Linux seems to leave the right-most or bottom-most point open */ /* Linux seems to leave the right-most or bottom-most point open */
int x1 = points[0].x; x1 = points[0].x;
int y1 = points[0].y; y1 = points[0].y;
int x2 = points[count-1].x; x2 = points[count-1].x;
int y2 = points[count-1].y; y2 = points[count-1].y;
if (x1 > x2) { if (x1 > x2) {
data->glVertex2f(0.5f + x1, 0.5f + y1); data->glVertex2f(0.5f + x1, 0.5f + y1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment