summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/uniform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/shader/uniform.cpp')
-rw-r--r--src/mbgl/shader/uniform.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/shader/uniform.cpp b/src/mbgl/shader/uniform.cpp
index d43dd20016..4c7646119a 100644
--- a/src/mbgl/shader/uniform.cpp
+++ b/src/mbgl/shader/uniform.cpp
@@ -1,4 +1,5 @@
#include <mbgl/shader/uniform.hpp>
+#include <mbgl/util/color.hpp>
namespace mbgl {
@@ -28,6 +29,12 @@ void Uniform<std::array<GLfloat, 4>>::bind(const std::array<GLfloat, 4>& t) {
}
template <>
+void Uniform<Color>::bind(const Color& t) {
+ std::array<GLfloat, 4> a = {{ t.r, t.g, t.b, t.a }};
+ MBGL_CHECK_ERROR(glUniform4fv(location, 1, a.data()));
+}
+
+template <>
void UniformMatrix<2>::bind(const std::array<GLfloat, 4>& t) {
MBGL_CHECK_ERROR(glUniformMatrix2fv(location, 1, GL_FALSE, t.data()));
}