]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix glDrawRangeElements issue with mesa
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 08:29:31 +0000 (08:29 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 08:29:31 +0000 (08:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9131 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 89b789c30c66a30673e4398ea5131f77198accf1..c0907b3663fa36749d8a9b25d9122106221d5d40 100644 (file)
@@ -1279,7 +1279,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                        GL_BindEBO(bufferobject3s);
                        if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL)
                        {
-                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3])));
+                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3])));
                                CHECKGLERROR
                        }
                        else
@@ -1293,7 +1293,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                        GL_BindEBO(bufferobject3i);
                        if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL)
                        {
-                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3])));
+                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3])));
                                CHECKGLERROR
                        }
                        else
@@ -1307,7 +1307,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                        GL_BindEBO(0);
                        if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL)
                        {
-                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_SHORT, element3s);
+                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_SHORT, element3s);
                                CHECKGLERROR
                        }
                        else
@@ -1321,7 +1321,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                        GL_BindEBO(0);
                        if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL)
                        {
-                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_INT, element3i);
+                               qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_INT, element3i);
                                CHECKGLERROR
                        }
                        else