From da1c1336596d361678b3f641a1d23ab89e078789 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 17 Apr 2023 17:09:40 +0100 Subject: Revamp how VertexArrayObject configures attributes and data --- gfx/models/mesh.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gfx/models') 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 vertices, const std::span indices, GLenum m) : m_numIndices {static_cast(indices.size())}, mode {m} { - VertexArrayObject::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( + m_vertexArrayBuffers[0], vertices) + .addIndices(m_vertexArrayBuffers[1], indices); } void -- cgit v1.2.3