summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-19 01:52:46 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-19 01:52:46 +0100
commitf3343e1cc8a56f039888d4d375a6d5a088a68494 (patch)
tree02013c298eb801302ee490c47e85b58682ea7d62 /gfx/models
parentFixup vertexAttribFunc for matrices (diff)
downloadilt-f3343e1cc8a56f039888d4d375a6d5a088a68494.tar.bz2
ilt-f3343e1cc8a56f039888d4d375a6d5a088a68494.tar.xz
ilt-f3343e1cc8a56f039888d4d375a6d5a088a68494.zip
Export mesh size and primitive type
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/mesh.cpp12
-rw-r--r--gfx/models/mesh.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 2c849e7..55759cb 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -21,6 +21,18 @@ Mesh::configureVAO(VertexArrayObject && vao) const
.addIndices(m_vertexArrayBuffers[1]);
}
+GLsizei
+Mesh::count() const
+{
+ return m_numIndices;
+}
+
+GLenum
+Mesh::type() const
+{
+ return mode;
+}
+
void
Mesh::Draw() const
{
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index 0af8d70..472b7ed 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -15,6 +15,8 @@ public:
void Draw() const;
VertexArrayObject & configureVAO(VertexArrayObject &&) const;
+ GLsizei count() const;
+ GLenum type() const;
private:
glVertexArray m_vertexArrayObject;