diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-28 16:39:50 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-02 09:44:42 -0800 |
commit | 141e995806576364d185626176c1b993fc519291 (patch) | |
tree | ecdc41fc7699f2a1a9e9456157348451ebe99597 /src/mbgl/programs/raster_program.hpp | |
parent | 6a6bddb4537004cc1bfc506e76772de74d33f3f7 (diff) | |
download | qtlocation-mapboxgl-141e995806576364d185626176c1b993fc519291.tar.gz |
[core] Add support for data-driven styling
Diffstat (limited to 'src/mbgl/programs/raster_program.hpp')
-rw-r--r-- | src/mbgl/programs/raster_program.hpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/mbgl/programs/raster_program.hpp b/src/mbgl/programs/raster_program.hpp index 9aa25cf90c..7b4c3842be 100644 --- a/src/mbgl/programs/raster_program.hpp +++ b/src/mbgl/programs/raster_program.hpp @@ -5,6 +5,7 @@ #include <mbgl/programs/uniforms.hpp> #include <mbgl/shader/raster.hpp> #include <mbgl/util/geometry.hpp> +#include <mbgl/style/layers/raster_layer_properties.hpp> namespace mbgl { @@ -22,14 +23,12 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 3, u_spin_weights); MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_tl_parent); } // namespace uniforms -using RasterAttributes = gl::Attributes< - attributes::a_pos, - attributes::a_texture_pos>; - class RasterProgram : public Program< shaders::raster, gl::Triangle, - RasterAttributes, + gl::Attributes< + attributes::a_pos, + attributes::a_texture_pos>, gl::Uniforms< uniforms::u_matrix, uniforms::u_image0, @@ -43,25 +42,27 @@ class RasterProgram : public Program< uniforms::u_spin_weights, uniforms::u_buffer_scale, uniforms::u_scale_parent, - uniforms::u_tl_parent>> + uniforms::u_tl_parent>, + style::RasterPaintProperties> { public: using Program::Program; - static Vertex vertex(Point<int16_t> p, Point<uint16_t> t) { - return Vertex { - { + static LayoutVertex layoutVertex(Point<int16_t> p, Point<uint16_t> t) { + return LayoutVertex { + {{ p.x, p.y - }, - { + }}, + {{ t.x, t.y - } + }} }; } }; -using RasterVertex = RasterProgram::Vertex; +using RasterLayoutVertex = RasterProgram::LayoutVertex; +using RasterAttributes = RasterProgram::Attributes; } // namespace mbgl |