From 11ed44c13c227c73d9b2ec416aed54b00bda2a0a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 18 Nov 2014 09:49:02 +0200 Subject: Support larger custom meshes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vertex index was limited to unsigned short, meaning even slightly complex meshes couldn't be used. Changed to unsigned int. Also removed unused vertex indexer methods. Change-Id: Iebe62bd3a501dc79ee2857cca28ac0d05bd4a55e Reviewed-by: Tomi Korpipää --- src/datavisualization/utils/objecthelper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/datavisualization/utils/objecthelper.cpp') diff --git a/src/datavisualization/utils/objecthelper.cpp b/src/datavisualization/utils/objecthelper.cpp index 0237708f..6441aae2 100644 --- a/src/datavisualization/utils/objecthelper.cpp +++ b/src/datavisualization/utils/objecthelper.cpp @@ -25,7 +25,6 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION ObjectHelper::ObjectHelper(const QString &objectFile) : m_objectFile(objectFile) { - m_indicesType = GL_UNSIGNED_SHORT; load(); } @@ -158,7 +157,7 @@ void ObjectHelper::load() glGenBuffers(1, &m_elementbuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_elementbuffer); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, m_indices.size() * sizeof(unsigned short), + glBufferData(GL_ELEMENT_ARRAY_BUFFER, m_indices.size() * sizeof(GLuint), &m_indices.at(0), GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); -- cgit v1.2.3