summaryrefslogtreecommitdiff
path: root/gfx/models/vertex.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-05-10 00:02:50 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-05-10 00:02:50 +0100
commitef00fc9ae1323b64d5e167d04a987887c60c6ec0 (patch)
treea214a04fca7969d5c892422cc462e0bf31e80ee9 /gfx/models/vertex.cpp
parentSupport for tessellation shaders (diff)
downloadilt-ef00fc9ae1323b64d5e167d04a987887c60c6ec0.tar.bz2
ilt-ef00fc9ae1323b64d5e167d04a987887c60c6ec0.tar.xz
ilt-ef00fc9ae1323b64d5e167d04a987887c60c6ec0.zip
Make Mesh into a template to support any vertex type
Customisation point VertexArrayObject to define the layout for the type
Diffstat (limited to 'gfx/models/vertex.cpp')
-rw-r--r--gfx/models/vertex.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gfx/models/vertex.cpp b/gfx/models/vertex.cpp
new file mode 100644
index 0000000..c144db3
--- /dev/null
+++ b/gfx/models/vertex.cpp
@@ -0,0 +1,10 @@
+#include "vertex.h"
+#include "gfx/gl/vertexArrayObject.h"
+
+template<>
+VertexArrayObject &
+VertexArrayObject::addAttribsFor<Vertex>(const GLuint arrayBuffer, const GLuint divisor)
+{
+ return addAttribs<Vertex, &Vertex::pos, &Vertex::texCoord, &Vertex::normal, &Vertex::colour, &Vertex::material>(
+ arrayBuffer, divisor);
+}