summaryrefslogtreecommitdiff
path: root/include/mbgl/shader/line_shader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/shader/line_shader.hpp')
-rw-r--r--include/mbgl/shader/line_shader.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/mbgl/shader/line_shader.hpp b/include/mbgl/shader/line_shader.hpp
new file mode 100644
index 0000000000..38efe0b71f
--- /dev/null
+++ b/include/mbgl/shader/line_shader.hpp
@@ -0,0 +1,45 @@
+#ifndef MBGL_SHADER_SHADER_LINE
+#define MBGL_SHADER_SHADER_LINE
+
+#include <mbgl/shader/shader.hpp>
+
+namespace mbgl {
+
+class LineShader : public Shader {
+public:
+ LineShader();
+
+ void bind(char *offset);
+
+ void setExtrudeMatrix(const std::array<float, 16>& exmatrix);
+ void setColor(const std::array<float, 4>& color);
+ void setLineWidth(const std::array<float, 2>& linewidth);
+ void setRatio(float ratio);
+ void setDashArray(const std::array<float, 2>& dasharray);
+ void setDebug(float debug);
+
+private:
+ int32_t a_pos = -1;
+ int32_t a_extrude = -1;
+ int32_t a_linesofar = -1;
+
+ std::array<float, 16> exmatrix = {{}};
+ int32_t u_exmatrix = -1;
+
+ std::array<float, 4> color = {{}};
+ int32_t u_color = -1;
+
+ std::array<float, 2> linewidth = {{}};
+ int32_t u_linewidth = -1;
+
+ float ratio = 0;
+ int32_t u_ratio = -1;
+
+ std::array<float, 2> dasharray = {{}};
+ int32_t u_dasharray = -1;
+};
+
+
+}
+
+#endif