From 128d0c2d64abec366cec22dfca493e6f5e03aa9d Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 2 Nov 2010 12:16:51 +0100 Subject: Fixed index type after reapplying commit 89cbb165. Made the code added with commit 89cbb165 use ushort indices on systems which don't support uint indices, like commit 207d9239 did with the rest of the GL paint engine. Reviewed-by: Samuel --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index d00723a..b90709f 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -890,7 +890,10 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) prepareForDraw(currentBrush.isOpaque()); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, vertices.constData()); - glDrawElements(GL_TRIANGLES, polys.indices.size(), GL_UNSIGNED_INT, polys.indices.constData()); + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) + glDrawElements(GL_TRIANGLES, polys.indices.size(), GL_UNSIGNED_INT, polys.indices.data()); + else + glDrawElements(GL_TRIANGLES, polys.indices.size(), GL_UNSIGNED_SHORT, polys.indices.data()); } else { // We can't handle big, concave painter paths with OpenGL without stencil buffer. qWarning("Painter path exceeds +/-32767 pixels."); -- cgit v0.12