src/video/SDL_renderer_gl.c
changeset 3470 419f459f2f38
parent 3468 789b97008d8a
child 3472 fdd2f2e9cd97
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