summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-22 01:45:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-22 01:45:01 +0000
commit903e959080837d1f15e8689f095624cccfc3ceda (patch)
tree17f018fe66ffa6250cab7c764d26980399f3bfd2 /lib
parentRemove the old custom mesh per network link rendering (diff)
downloadilt-903e959080837d1f15e8689f095624cccfc3ceda.tar.bz2
ilt-903e959080837d1f15e8689f095624cccfc3ceda.tar.xz
ilt-903e959080837d1f15e8689f095624cccfc3ceda.zip
Add missing support for glUniform simple span of numbers
Diffstat (limited to 'lib')
-rw-r--r--lib/gl_traits.h9
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)