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.hpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/include/mbgl/shader/line_shader.hpp b/include/mbgl/shader/line_shader.hpp
index c476b5c4c6..b789330882 100644
--- a/include/mbgl/shader/line_shader.hpp
+++ b/include/mbgl/shader/line_shader.hpp
@@ -2,6 +2,7 @@
#define MBGL_SHADER_SHADER_LINE
#include <mbgl/shader/shader.hpp>
+#include <mbgl/shader/uniform.hpp>
namespace mbgl {
@@ -11,36 +12,18 @@ public:
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 setBlur(float blur);
- void setDebug(float debug);
+ UniformMatrix<4> u_matrix = {"u_matrix", *this};
+ UniformMatrix<4> u_exmatrix = {"u_exmatrix", *this};
+ Uniform<std::array<float, 4>> u_color = {"u_color", *this};
+ Uniform<std::array<float, 2>> u_linewidth = {"u_linewidth", *this};
+ Uniform<std::array<float, 2>> u_dasharray = {"u_dasharray", *this};
+ Uniform<float> u_ratio = {"u_ratio", *this};
+ Uniform<float> u_blur = {"u_blur", *this};
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;
-
- float blur = 0.0f;
- int32_t u_blur = -1;
};