diff src/video/SDL_renderer_gl.c @ 3454:77366fae0094

Adjust the vertices to be over the texel center.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 19 Nov 2009 04:33:35 +0000
parents 294b770c1989
children 5a7b5760c875
line wrap: on
line diff
--- a/src/video/SDL_renderer_gl.c	Wed Nov 18 09:39:32 2009 +0000
+++ b/src/video/SDL_renderer_gl.c	Thu Nov 19 04:33:35 2009 +0000
@@ -1105,7 +1105,7 @@
                     (GLfloat) renderer->a * inv255f);
 
     data->glBegin(GL_POINTS);
-    data->glVertex2i(x, y);
+    data->glVertex2f(0.5f + x, 0.5f + y);
     data->glEnd();
 
     return 0;
@@ -1124,8 +1124,8 @@
                     (GLfloat) renderer->a * inv255f);
 
     data->glBegin(GL_LINES);
-    data->glVertex2i(x1, y1);
-    data->glVertex2i(x2, y2);
+    data->glVertex2f(0.5f + x1, 0.5f + y1);
+    data->glVertex2f(0.5f + x2, 0.5f + y2);
     data->glEnd();
 
     return 0;
@@ -1234,13 +1234,13 @@
 
     data->glBegin(GL_TRIANGLE_STRIP);
     data->glTexCoord2f(minu, minv);
-    data->glVertex2i(minx, miny);
+    data->glVertex2f(0.5f + minx, 0.5f + miny);
     data->glTexCoord2f(maxu, minv);
-    data->glVertex2i(maxx, miny);
+    data->glVertex2f(0.5f + maxx, 0.5f + miny);
     data->glTexCoord2f(minu, maxv);
-    data->glVertex2i(minx, maxy);
+    data->glVertex2f(0.5f + minx, 0.5f + maxy);
     data->glTexCoord2f(maxu, maxv);
-    data->glVertex2i(maxx, maxy);
+    data->glVertex2f(0.5f + maxx, 0.5f + maxy);
     data->glEnd();
 
     if (texturedata->shader != 0) {