From 48aa8723e4e82f2329a6053f95075af8cbf37444 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 27 Jun 2013 06:20:52 +0000 Subject: [PATCH] fix severe (crashing) bugs with two calls to qglDrawElements when using 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index 81e71c3b..a03060c1 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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 } } -- 2.39.2