diff -r 4cc6b582fde8 -r 1536f23cfab7 src/gl/compiler.h --- a/src/gl/compiler.h Wed Jan 22 22:43:28 2020 +0200 +++ b/src/gl/compiler.h Thu Jan 23 00:29:10 2020 +0200 @@ -21,6 +21,7 @@ #include "gl/common.h" #include "types/boundingbox.h" #include +#include #include #include #include @@ -59,6 +60,7 @@ void bindVertexArray(gl::ArrayClass arrayClass); void releaseVertexArray(gl::ArrayClass arrayClass); void buildShaders(int arrayId); + template void setUniform(const char* uniformName, T&& value) { @@ -72,6 +74,13 @@ object.program->release(); } } + + template + void setUniformMatrix(const char* uniformName, const glm::mat<4, 4, Float, Prec>& value) + { + const float (*array)[4][4] = reinterpret_cast(glm::value_ptr(value)); + this->setUniform(uniformName, *array); + } private: bool m_vboChanged[gl::numVbos] = {true}; std::size_t storedVboSizes[gl::numVbos] = {0_z};