summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gl_traits.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gl_traits.h b/lib/gl_traits.h
index 14ac9d8..b3c6909 100644
--- a/lib/gl_traits.h
+++ b/lib/gl_traits.h
@@ -83,6 +83,14 @@ template<> struct gl_traits<glm::uint32> : public gl_traits_integer {
template<typename T, std::size_t S> struct gl_traits<std::array<T, S>> : public gl_traits<T> {
static constexpr GLint size {S * gl_traits<T>::size};
+ static constexpr auto vertexAttribFunc {
+ [](GLuint index, GLint, GLenum type, GLsizei stride, const void * pointer) -> GLuint {
+ const auto base = static_cast<const T *>(pointer);
+ for (GLuint e = 0; e < S; e++) {
+ glVertexAttribPointer(index + e, gl_traits<T>::size, type, GL_FALSE, stride, base + e);
+ }
+ return S;
+ }};
};
template<glm::length_t L, typename T, glm::qualifier Q> struct gl_traits<glm::vec<L, T, Q>> : public gl_traits<T> {