# HG changeset patch # User Santeri Piippo # Date 1390589217 -7200 # Node ID 0526d8404097cca45abbc5ed65d4b94e10a2ecaf # Parent b3c32a2741be11b7ef0c0f480149636a124845ed - renamed some member variables for clarity diff -r b3c32a2741be -r 0526d8404097 src/GLCompiler.cc --- a/src/GLCompiler.cc Fri Jan 24 18:31:25 2014 +0200 +++ b/src/GLCompiler.cc Fri Jan 24 20:46:57 2014 +0200 @@ -22,13 +22,13 @@ GLCompiler::GLCompiler() : m_Document (null) { - glGenBuffers (VBO_NumArrays, &m_mainVBOIndices[0]); + glGenBuffers (VBO_NumArrays, &m_mainVBOs[0]); needMerge(); } GLCompiler::~GLCompiler() { - glDeleteBuffers (VBO_NumArrays, &m_mainVBOIndices[0]); + glDeleteBuffers (VBO_NumArrays, &m_mainVBOs[0]); } // ============================================================================= @@ -166,17 +166,17 @@ if (!m_changed[type]) return; - m_mainArrays[type].clear(); + m_mainVBOData[type].clear(); for (auto it = m_objArrays.begin(); it != m_objArrays.end(); ++it) - m_mainArrays[type] += (*it)[type]; + m_mainVBOData[type] += (*it)[type]; - glBindBuffer (GL_ARRAY_BUFFER, m_mainVBOIndices[type]); - glBufferData (GL_ARRAY_BUFFER, m_mainArrays[type].size() * sizeof(float), - m_mainArrays[type].constData(), GL_DYNAMIC_DRAW); - glBindBuffer (GL_ARRAY_BUFFER, m_mainVBOIndices[type]); + glBindBuffer (GL_ARRAY_BUFFER, m_mainVBOs[type]); + glBufferData (GL_ARRAY_BUFFER, m_mainVBOData[type].size() * sizeof(float), + m_mainVBOData[type].constData(), GL_DYNAMIC_DRAW); + glBindBuffer (GL_ARRAY_BUFFER, m_mainVBOs[type]); m_changed[type] = false; - log ("VBO array %1 prepared: %2 coordinates", (int) type, m_mainArrays[type].size()); + log ("VBO array %1 prepared: %2 coordinates", (int) type, m_mainVBOData[type].size()); } // ============================================================================= diff -r b3c32a2741be -r 0526d8404097 src/GLCompiler.h --- a/src/GLCompiler.h Fri Jan 24 18:31:25 2014 +0200 +++ b/src/GLCompiler.h Fri Jan 24 20:46:57 2014 +0200 @@ -77,12 +77,12 @@ inline GLuint getVBOIndex (E_VBOArray array) const { - return m_mainVBOIndices[array]; + return m_mainVBOs[array]; } inline int getVBOCount (E_VBOArray array) const { - return m_mainArrays[array].size() / 3; + return m_mainVBOData[array].size() / 3; } private: @@ -92,8 +92,8 @@ void writeColor (QVector< float >& array, const QColor& color); QMap*> m_objArrays; - QVector m_mainArrays[VBO_NumArrays]; - GLuint m_mainVBOIndices[VBO_NumArrays]; + QVector m_mainVBOData[VBO_NumArrays]; + GLuint m_mainVBOs[VBO_NumArrays]; bool m_changed[VBO_NumArrays]; LDObjectList m_staged; // Objects that need to be compiled };