diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-27 21:47:41 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-27 21:47:41 +0000 |
commit | e0ac130808d9bed5443115ee91e9cccda713ae3c (patch) | |
tree | dad2b2cbe2bc8bf5560f4859880549472f808671 /lib/gl_traits.h | |
parent | Remove the static texture cache (diff) | |
parent | Render text in N draw calls (diff) | |
download | ilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.tar.bz2 ilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.tar.xz ilt-e0ac130808d9bed5443115ee91e9cccda713ae3c.zip |
Merge branch 'text2'
Diffstat (limited to 'lib/gl_traits.h')
-rw-r--r-- | lib/gl_traits.h | 8 |
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> { |