changeset 174:c0183515a0a3

Use integers instead of floats to avoid filtering and ugly approximations (like the official game)
author Thibaut Girka <thib@sitedethib.com>
date Fri, 21 Oct 2011 19:20:03 +0200
parents 35d850502d1f
children 5dc243bcf312
files pytouhou/opengl/gamerenderer.pyx
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/opengl/gamerenderer.pyx
+++ b/pytouhou/opengl/gamerenderer.pyx
@@ -29,7 +29,7 @@ MAX_ELEMENTS = 10000
 
 
 cdef struct Vertex:
-    float x, y, z
+    int x, y, z
     float u, v
     unsigned char r, g, b, a
 
@@ -86,7 +86,7 @@ cdef class GameRenderer:
                 nb_vertices += 4
 
         for (texture_key, blendfunc), indices in indices_by_texture.items():
-            glVertexPointer(3, GL_FLOAT, 24, <long> &self.vertex_buffer[0].x)
+            glVertexPointer(3, GL_INT, 24, <long> &self.vertex_buffer[0].x)
             glTexCoordPointer(2, GL_FLOAT, 24, <long> &self.vertex_buffer[0].u)
             glColorPointer(4, GL_UNSIGNED_BYTE, 24, <long> &self.vertex_buffer[0].r)