diff --git a/src/Mesh.cpp b/src/Mesh.cpp index de77e9175..8a7ed35d9 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -69,7 +69,7 @@ void Mesh::draw() { it->first->unbind(); } - glDrawArrays(_primitive, 0, count); + glDrawArrays(_primitive, 0, _vertexCount); /* Disable vertex arrays for all attributes */ for(set::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it) @@ -111,7 +111,7 @@ void Mesh::finalize() { ait->pointer = reinterpret_cast(position); /* Add attribute size (for all vertices) to position */ - position += ait->size*sizeOf(ait->type)*count; + position += ait->size*sizeOf(ait->type)*_vertexCount; } } } diff --git a/src/Mesh.h b/src/Mesh.h index 09db8dab4..0939454ea 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -83,9 +83,9 @@ class Mesh { /** * @brief Constructor * @param primitive Primitive type - * @param _count Vertex count + * @param vertexCount Vertex count */ - inline Mesh(Primitive primitive, GLsizei _count): _primitive(primitive), count(_count), finalized(false) {} + inline Mesh(Primitive primitive, GLsizei vertexCount): _primitive(primitive), _vertexCount(vertexCount), finalized(false) {} /** * @brief Destructor @@ -97,6 +97,9 @@ class Mesh { /** @brief Primitive type */ inline Primitive primitive() const { return _primitive; } + /** @brief Vertex count */ + inline GLsizei vertexCount() const { return _vertexCount; } + /** * @brief Add buffer * @param interleaved If storing more than one attribute data in the @@ -164,7 +167,7 @@ class Mesh { private: Primitive _primitive; - GLsizei count; + GLsizei _vertexCount; bool finalized; std::map > > _buffers;