diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-24 00:46:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-24 00:46:57 +0000 |
commit | 17aa6053e641d006649f94bb60a834ce945f351e (patch) | |
tree | b76f6fc642b749ee69d4be4b2e3f60e80c0ed7bc /lib/gl_traits.h | |
parent | Add traits wrapper for setting uniforms (diff) | |
parent | Fix network population of position in gBuffer (diff) | |
download | ilt-17aa6053e641d006649f94bb60a834ce945f351e.tar.bz2 ilt-17aa6053e641d006649f94bb60a834ce945f351e.tar.xz ilt-17aa6053e641d006649f94bb60a834ce945f351e.zip |
Merge remote-tracking branch 'origin/instanced-networks'
Diffstat (limited to 'lib/gl_traits.h')
-rw-r--r-- | lib/gl_traits.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gl_traits.h b/lib/gl_traits.h index 2d3d85d..dcbe04e 100644 --- a/lib/gl_traits.h +++ b/lib/gl_traits.h @@ -125,6 +125,15 @@ glUniform(GLint location, std::span<const glm::vec<L, T, Q>> v) (*gl_traits<T>::glUniformvFunc[L - 1])(location, static_cast<GLsizei>(v.size()), glm::value_ptr(v.front())); } +template<typename T> +void +glUniform(GLint location, std::span<const T> v) +{ + static_assert( + requires { gl_traits<T>::glUniformvFunc; }, "Has glUnformNTv"); + (*gl_traits<T>::glUniformvFunc.front())(location, static_cast<GLsizei>(v.size()), v.data()); +} + template<glm::length_t L, typename T, glm::qualifier Q> void glUniform(GLint location, const glm::mat<L, L, T, Q> & v) |