comparison src/video/SDL_renderer_gl.c @ 3470:419f459f2f38

It's not the last pixel, it's the rightmost pixel, or if they're both the same x coordinate, the bottommost pixel.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 21 Nov 2009 06:19:34 +0000
parents 789b97008d8a
children fdd2f2e9cd97
comparison
equal deleted inserted replaced
3469:8c5fb2a3b11d 3470:419f459f2f38
1153 data->glBegin(GL_LINES); 1153 data->glBegin(GL_LINES);
1154 data->glVertex2f(0.5f + x1, 0.5f + y1); 1154 data->glVertex2f(0.5f + x1, 0.5f + y1);
1155 data->glVertex2f(0.5f + x2, 0.5f + y2); 1155 data->glVertex2f(0.5f + x2, 0.5f + y2);
1156 data->glEnd(); 1156 data->glEnd();
1157 1157
1158 /* For some reason the second endpoint is skipped */ 1158 /* For some reason the rightmost or lowest endpoint is skipped */
1159 data->glBegin(GL_POINTS); 1159 data->glBegin(GL_POINTS);
1160 data->glVertex2f(0.5f + x2, 0.5f + y2); 1160 if (x1 > x2) {
1161 data->glVertex2f(0.5f + x1, 0.5f + y1);
1162 } else if (x2 > x1) {
1163 data->glVertex2f(0.5f + x2, 0.5f + y2);
1164 } else if (y1 > y2) {
1165 data->glVertex2f(0.5f + x1, 0.5f + y1);
1166 } else if (y2 > y1) {
1167 data->glVertex2f(0.5f + x2, 0.5f + y2);
1168 }
1161 data->glEnd(); 1169 data->glEnd();
1162 1170
1163 return 0; 1171 return 0;
1164 } 1172 }
1165 1173