summaryrefslogtreecommitdiff
path: root/gfx/models/mesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/models/mesh.cpp')
-rw-r--r--gfx/models/mesh.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 55759cb..52c9275 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -21,24 +21,22 @@ Mesh::configureVAO(VertexArrayObject && vao) const
.addIndices(m_vertexArrayBuffers[1]);
}
-GLsizei
-Mesh::count() const
+void
+Mesh::Draw() const
{
- return m_numIndices;
-}
+ glBindVertexArray(m_vertexArrayObject);
-GLenum
-Mesh::type() const
-{
- return mode;
+ glDrawElements(mode, m_numIndices, GL_UNSIGNED_INT, nullptr);
+
+ glBindVertexArray(0);
}
void
-Mesh::Draw() const
+Mesh::DrawInstanced(GLuint vao, GLsizei count) const
{
- glBindVertexArray(m_vertexArrayObject);
+ glBindVertexArray(vao);
- glDrawElements(mode, m_numIndices, GL_UNSIGNED_INT, nullptr);
+ glDrawElementsInstanced(mode, m_numIndices, GL_UNSIGNED_INT, nullptr, count);
glBindVertexArray(0);
}