summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-06-28 20:23:57 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-06-28 20:23:57 +0100
commite3d42befda7ee1f309d1a67797db492561fd8e52 (patch)
treea5b6a332dbcc484eebd12d7a25bbc50cdbad0c39 /gfx/models
parentRemove some unnecessary includes (diff)
downloadilt-e3d42befda7ee1f309d1a67797db492561fd8e52.tar.bz2
ilt-e3d42befda7ee1f309d1a67797db492561fd8e52.tar.xz
ilt-e3d42befda7ee1f309d1a67797db492561fd8e52.zip
Allow passing start index for instanced draw
First stage of culling support
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/mesh.cpp4
-rw-r--r--gfx/models/mesh.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 374b731..e7474ca 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -13,11 +13,11 @@ MeshBase::Draw() const
}
void
-MeshBase::DrawInstanced(GLuint vao, GLsizei count) const
+MeshBase::DrawInstanced(GLuint vao, GLsizei count, GLuint base) const
{
glBindVertexArray(vao);
- glDrawElementsInstanced(mode, m_numIndices, GL_UNSIGNED_INT, nullptr, count);
+ glDrawElementsInstancedBaseInstance(mode, m_numIndices, GL_UNSIGNED_INT, nullptr, count, base);
glBindVertexArray(0);
}
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index d790d16..248cb8f 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -11,7 +11,7 @@ class Vertex;
class MeshBase {
public:
void Draw() const;
- void DrawInstanced(GLuint vao, GLsizei count) const;
+ void DrawInstanced(GLuint vao, GLsizei count, GLuint base = 0) const;
protected:
MeshBase(GLsizei m_numIndices, GLenum mode);