Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
This fixes SDL_renderer_gl so that it builds with c89.
Browse files Browse the repository at this point in the history
From: Fran?ois Revol <revol@free.fr>
Checked By: Scott McCreary <scottmc2@gmail.com>
  • Loading branch information
slouken committed Oct 17, 2010
1 parent b3e1866 commit c5455f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/video/SDL_renderer_gl.c
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c5455f2

Please sign in to comment.