summaryrefslogtreecommitdiff
path: root/gfx/models/mesh.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-17 17:09:40 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-17 17:09:40 +0100
commitda1c1336596d361678b3f641a1d23ab89e078789 (patch)
treec2f8b0fb1693cccc381e43f759cb27a19cd46208 /gfx/models/mesh.cpp
parentFix up the way spotlight shader works (diff)
downloadilt-da1c1336596d361678b3f641a1d23ab89e078789.tar.bz2
ilt-da1c1336596d361678b3f641a1d23ab89e078789.tar.xz
ilt-da1c1336596d361678b3f641a1d23ab89e078789.zip
Revamp how VertexArrayObject configures attributes and data
Diffstat (limited to 'gfx/models/mesh.cpp')
-rw-r--r--gfx/models/mesh.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 2719211..4200703 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -7,9 +7,10 @@
Mesh::Mesh(const std::span<const Vertex> vertices, const std::span<const unsigned int> indices, GLenum m) :
m_numIndices {static_cast<GLsizei>(indices.size())}, mode {m}
{
- VertexArrayObject<Vertex>::configure<&Vertex::pos, &Vertex::texCoord, &Vertex::normal, &Vertex::colour,
- &Vertex::material>(
- m_vertexArrayObject, m_vertexArrayBuffers[0], m_vertexArrayBuffers[1], vertices, indices);
+ VertexArrayObject {m_vertexArrayObject}
+ .addAttribs<Vertex, &Vertex::pos, &Vertex::texCoord, &Vertex::normal, &Vertex::colour, &Vertex::material>(
+ m_vertexArrayBuffers[0], vertices)
+ .addIndices(m_vertexArrayBuffers[1], indices);
}
void