From 21459ac4c92b82f2a3eeb1d9a6b462726001084c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 18 Apr 2023 00:08:18 +0100 Subject: Specialize vertexAttribFunc for matrices because there's an upper limit of size 4 on attrib pointers --- gfx/gl/vertexArrayObject.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/vertexArrayObject.hpp b/gfx/gl/vertexArrayObject.hpp index 8c828c8..fdc43e9 100644 --- a/gfx/gl/vertexArrayObject.hpp +++ b/gfx/gl/vertexArrayObject.hpp @@ -72,19 +72,19 @@ public: private: template - static void + static auto set_pointer(const GLuint vertexArrayId, const void * ptr) { glEnableVertexAttribArray(vertexArrayId); using traits = gl_traits; - traits::vertexAttribFunc(vertexArrayId, traits::size, traits::type, sizeof(VertexT), ptr); + return traits::vertexAttribFunc(vertexArrayId, traits::size, traits::type, sizeof(VertexT), ptr); } template - static void + static auto set_pointer(const GLuint vertexArrayId) { - set_pointer(vertexArrayId, attrib); + return set_pointer(vertexArrayId, attrib); } template @@ -97,7 +97,7 @@ private: } else { GLuint vertexArrayId {}; - (set_pointer(vertexArrayId++), ...); + ((vertexArrayId += set_pointer(vertexArrayId)), ...); } } }; -- cgit v1.2.3