Mercurial > sdl-ios-xcode
comparison src/video/SDL_renderer_gl.c @ 4905:9779093454d2
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>
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 16 Oct 2010 17:14:04 -0700 |
parents | 6cf71111cf68 |
children | f205711f73d5 |
comparison
equal
deleted
inserted
replaced
4904:c0021a587dc7 | 4905:9779093454d2 |
---|---|
1179 for (i = 0; i < count; ++i) { | 1179 for (i = 0; i < count; ++i) { |
1180 data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); | 1180 data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); |
1181 } | 1181 } |
1182 data->glEnd(); | 1182 data->glEnd(); |
1183 } else { | 1183 } else { |
1184 int x1, y1, x2, y2; | |
1185 | |
1184 data->glBegin(GL_LINE_STRIP); | 1186 data->glBegin(GL_LINE_STRIP); |
1185 for (i = 0; i < count; ++i) { | 1187 for (i = 0; i < count; ++i) { |
1186 data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); | 1188 data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); |
1187 } | 1189 } |
1188 data->glEnd(); | 1190 data->glEnd(); |
1198 #if defined(__APPLE__) || defined(__WIN32__) | 1200 #if defined(__APPLE__) || defined(__WIN32__) |
1199 /* Mac OS X and Windows seem to always leave the second point open */ | 1201 /* Mac OS X and Windows seem to always leave the second point open */ |
1200 data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y); | 1202 data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y); |
1201 #else | 1203 #else |
1202 /* Linux seems to leave the right-most or bottom-most point open */ | 1204 /* Linux seems to leave the right-most or bottom-most point open */ |
1203 int x1 = points[0].x; | 1205 x1 = points[0].x; |
1204 int y1 = points[0].y; | 1206 y1 = points[0].y; |
1205 int x2 = points[count-1].x; | 1207 x2 = points[count-1].x; |
1206 int y2 = points[count-1].y; | 1208 y2 = points[count-1].y; |
1207 | 1209 |
1208 if (x1 > x2) { | 1210 if (x1 > x2) { |
1209 data->glVertex2f(0.5f + x1, 0.5f + y1); | 1211 data->glVertex2f(0.5f + x1, 0.5f + y1); |
1210 } else if (x2 > x1) { | 1212 } else if (x2 > x1) { |
1211 data->glVertex2f(0.5f + x2, 0.5f + y2); | 1213 data->glVertex2f(0.5f + x2, 0.5f + y2); |