diff options
Diffstat (limited to 'include/mbgl/shader/uniform.hpp')
-rw-r--r-- | include/mbgl/shader/uniform.hpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/include/mbgl/shader/uniform.hpp b/include/mbgl/shader/uniform.hpp deleted file mode 100644 index a87bbd7aa3..0000000000 --- a/include/mbgl/shader/uniform.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef MBGL_SHADER_UNIFORM -#define MBGL_SHADER_UNIFORM - -#include <mbgl/shader/shader.hpp> -#include <mbgl/platform/gl.hpp> - -namespace mbgl { - -template <typename T> -class Uniform { -public: - Uniform(const GLchar* name, const Shader& shader) - : location(glGetUniformLocation(shader.program, name)) {} - - void operator=(const T& t) { - if (current != t) { - current = t; - bind(t); - } - } - -private: - void bind(const T&); - - T current; - GLint location; -}; - -template <size_t C, size_t R = C> -class UniformMatrix { -public: - typedef std::array<float, C*R> T; - - UniformMatrix(const GLchar* name, const Shader& shader) - : location(glGetUniformLocation(shader.program, name)) {} - - void operator=(const T& t) { - if (current != t) { - current = t; - bind(t); - } - } - -private: - void bind(const T&); - - T current; - GLint location; -}; - -} - -#endif |