From 6e45fc4c2f938320415247d71249fd6cfff4c18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Tue, 15 Sep 2015 18:18:24 +0200 Subject: [PATCH] Small performance improvement in opengl drawing --- src/render/opengl/VertexArray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/opengl/VertexArray.h b/src/render/opengl/VertexArray.h index 66300d6..2d47307 100644 --- a/src/render/opengl/VertexArray.h +++ b/src/render/opengl/VertexArray.h @@ -132,7 +132,7 @@ public: program->setAttributeArray(uv, GL_FLOAT, (void*)(ptr + offsetof(Vertex, uv)), 2, sizeof(Vertex)); program->enableAttributeArray(uv); - functions->glDrawElements(GL_TRIANGLES, index_count, GL_UNSIGNED_SHORT, indices); + functions->glDrawRangeElements(GL_TRIANGLES, 0, vertex_count - 1, index_count, GL_UNSIGNED_SHORT, indices); program->disableAttributeArray(vertex); program->disableAttributeArray(uv);