]> git.cworth.org Git - apitrace-tests/commitdiff
Avoid zero strides.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 31 Oct 2011 14:03:39 +0000 (14:03 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 31 Oct 2011 14:03:39 +0000 (14:03 +0000)
On MacOSX they will be replaced by the actual value.

apps/gl/varray.c
apps/gl/varray.ref.txt

index aa24b64695029d3e051a56995c9c4f86a5328e9f..719e8f2adce9130a1ed47e5472672a45024fd435 100644 (file)
@@ -89,8 +89,8 @@ static void setupPointers(void)
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
 
-   glVertexPointer(2, GL_INT, 0, vertices);
-   glColorPointer(3, GL_FLOAT, 0, colors);
+   glVertexPointer(2, GL_INT, 2 * sizeof(GLint), vertices);
+   glColorPointer(3, GL_FLOAT, 3 * sizeof(GLfloat), colors);
 }
 
 static void setupInterleave(void)
index 7c28118ec8df068d9d1bea5d5321141e970f775d..636db63199abf415ee59dace171ef3d60842b48e 100644 (file)
@@ -7,7 +7,7 @@ glMatrixMode(mode = GL_PROJECTION)
 glLoadIdentity()
 glOrtho(left = 0, right = 350, bottom = 0, top = 350, zNear = -1, zFar = 1)
 glClear(mask = GL_COLOR_BUFFER_BIT)
-glColorPointer(size = 3, type = GL_FLOAT, stride = 0, pointer = blob(72))
-glVertexPointer(size = 2, type = GL_INT, stride = 0, pointer = blob(48))
+glColorPointer(size = 3, type = GL_FLOAT, stride = 12, pointer = blob(72))
+glVertexPointer(size = 2, type = GL_INT, stride = 8, pointer = blob(48))
 glDrawArrays(mode = GL_TRIANGLES, first = 0, count = 6)
 glFlush()