src/video/SDL_renderer_gl.c
changeset 3475 3bd01435287f
parent 3474 1edb86163d62
child 3479 6f887204fa7a
equal deleted inserted replaced
3474:1edb86163d62 3475:3bd01435287f
  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     /* The line is half open, so we need one more point to complete the line.
  1158     /* The line is half open, so we need one more point to complete the line.
  1159      * http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html
  1159      * http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html
       
  1160      * If we have to, we can use vertical line and horizontal line textures
       
  1161      * for vertical and horizontal lines, and then create custom textures
       
  1162      * for diagonal lines and software render those.  It's terrible, but at
       
  1163      * least it would be pixel perfect.
  1160      */
  1164      */
  1161     data->glBegin(GL_POINTS);
  1165     data->glBegin(GL_POINTS);
  1162 #ifdef __APPLE__
  1166 #ifdef __APPLE__
  1163     /* Mac OS X seems to always leave the second point open */
  1167     /* Mac OS X seems to always leave the second point open */
  1164     data->glVertex2f(0.5f + x2, 0.5f + y2);
  1168     data->glVertex2f(0.5f + x2, 0.5f + y2);
  1165 #else
  1169 #else
  1166     /* Linux seems to use the right-most or bottom-most point open */
  1170     /* Linux seems to leave the right-most or bottom-most point open */
  1167     if (x1 > x2) {
  1171     if (x1 > x2) {
  1168         data->glVertex2f(0.5f + x1, 0.5f + y1);
  1172         data->glVertex2f(0.5f + x1, 0.5f + y1);
  1169     } else if (x2 > x1) {
  1173     } else if (x2 > x1) {
  1170         data->glVertex2f(0.5f + x2, 0.5f + y2);
  1174         data->glVertex2f(0.5f + x2, 0.5f + y2);
  1171     } else if (y1 > y2) {
  1175     } else if (y1 > y2) {