summaryrefslogtreecommitdiff
path: root/include/mbgl/shader/icon_shader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/shader/icon_shader.hpp')
-rw-r--r--include/mbgl/shader/icon_shader.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/mbgl/shader/icon_shader.hpp b/include/mbgl/shader/icon_shader.hpp
new file mode 100644
index 0000000000..b97b3c2be3
--- /dev/null
+++ b/include/mbgl/shader/icon_shader.hpp
@@ -0,0 +1,42 @@
+#ifndef MBGL_SHADER_SHADER_ICON
+#define MBGL_SHADER_SHADER_ICON
+
+#include <mbgl/shader/shader.hpp>
+
+namespace mbgl {
+
+class IconShader : public Shader {
+public:
+ IconShader();
+
+ void bind(char *offset);
+
+ void setImage(int32_t image);
+ void setColor(const std::array<float, 4>& color);
+ void setDimension(const std::array<float, 2>& dimension);
+ void setSize(float size);
+ void setRatio(float ratio);
+
+private:
+ int32_t a_pos = -1;
+ int32_t a_tex = -1;
+
+ int32_t image = -1;
+ int32_t u_image = -1;
+
+ std::array<float, 4> color = {{}};
+ int32_t u_color = -1;
+
+ std::array<float, 2> dimension = {{}};
+ int32_t u_dimension = -1;
+
+ float size = 0;
+ int32_t u_size = -1;
+
+ float ratio = 0;
+ int32_t u_ratio = -1;
+};
+
+}
+
+#endif