diff options
Diffstat (limited to 'src/mbgl/shader/uniform.cpp')
-rw-r--r-- | src/mbgl/shader/uniform.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mbgl/shader/uniform.cpp b/src/mbgl/shader/uniform.cpp index 4c7646119a..bd4c13eee1 100644 --- a/src/mbgl/shader/uniform.cpp +++ b/src/mbgl/shader/uniform.cpp @@ -1,51 +1,52 @@ #include <mbgl/shader/uniform.hpp> #include <mbgl/util/color.hpp> +#include <mbgl/gl/gl.hpp> namespace mbgl { template <> -void Uniform<GLfloat>::bind(const GLfloat& t) { +void Uniform<float>::bind(const float& t) { MBGL_CHECK_ERROR(glUniform1f(location, t)); } template <> -void Uniform<GLint>::bind(const GLint& t) { +void Uniform<int32_t>::bind(const int32_t& t) { MBGL_CHECK_ERROR(glUniform1i(location, t)); } template <> -void Uniform<std::array<GLfloat, 2>>::bind(const std::array<GLfloat, 2>& t) { +void Uniform<std::array<float, 2>>::bind(const std::array<float, 2>& t) { MBGL_CHECK_ERROR(glUniform2fv(location, 1, t.data())); } template <> -void Uniform<std::array<GLfloat, 3>>::bind(const std::array<GLfloat, 3>& t) { +void Uniform<std::array<float, 3>>::bind(const std::array<float, 3>& t) { MBGL_CHECK_ERROR(glUniform3fv(location, 1, t.data())); } template <> -void Uniform<std::array<GLfloat, 4>>::bind(const std::array<GLfloat, 4>& t) { +void Uniform<std::array<float, 4>>::bind(const std::array<float, 4>& t) { MBGL_CHECK_ERROR(glUniform4fv(location, 1, t.data())); } template <> void Uniform<Color>::bind(const Color& t) { - std::array<GLfloat, 4> a = {{ t.r, t.g, t.b, t.a }}; + std::array<float, 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) { +void UniformMatrix<2>::bind(const std::array<float, 4>& t) { MBGL_CHECK_ERROR(glUniformMatrix2fv(location, 1, GL_FALSE, t.data())); } template <> -void UniformMatrix<3>::bind(const std::array<GLfloat, 9>& t) { +void UniformMatrix<3>::bind(const std::array<float, 9>& t) { MBGL_CHECK_ERROR(glUniformMatrix3fv(location, 1, GL_FALSE, t.data())); } template <> -void UniformMatrix<4>::bind(const std::array<GLfloat, 16>& t) { +void UniformMatrix<4>::bind(const std::array<float, 16>& t) { MBGL_CHECK_ERROR(glUniformMatrix4fv(location, 1, GL_FALSE, t.data())); } |