]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix severe (crashing) bugs with two calls to qglDrawElements when using
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Jun 2013 06:20:52 +0000 (06:20 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Jun 2013 06:20:52 +0000 (06:20 +0000)
index buffers (this bug was hidden by gl_mesh_drawrangeelements being 1
by default)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11961 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 81e71c3b2ab7c273ba30e64575a0cb15a3bbe892..a03060c1d33ca4f4b97f38f4e8eba2ba3ab347e7 100644 (file)
@@ -3112,7 +3112,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                                else
 #endif
                                {
-                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3])));
+                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_SHORT, (void *)bufferoffset3s);
                                        CHECKGLERROR
                                }
                        }
@@ -3128,7 +3128,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                                else
 #endif
                                {
-                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3])));
+                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_INT, (void *)bufferoffset3i);
                                        CHECKGLERROR
                                }
                        }