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/gl/draw_mode.hpp | |
parent | 6a6bddb4537004cc1bfc506e76772de74d33f3f7 (diff) | |
download | qtlocation-mapboxgl-141e995806576364d185626176c1b993fc519291.tar.gz |
[core] Add support for data-driven styling
Diffstat (limited to 'src/mbgl/gl/draw_mode.hpp')
-rw-r--r-- | src/mbgl/gl/draw_mode.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mbgl/gl/draw_mode.hpp b/src/mbgl/gl/draw_mode.hpp index ab86d5e469..275eb25b89 100644 --- a/src/mbgl/gl/draw_mode.hpp +++ b/src/mbgl/gl/draw_mode.hpp @@ -1,7 +1,7 @@ #pragma once +#include <mbgl/gl/types.hpp> #include <mbgl/gl/primitives.hpp> -#include <mbgl/util/variant.hpp> #include <cassert> @@ -11,7 +11,9 @@ namespace gl { class Points { public: using Primitive = Point; + static constexpr std::size_t bufferGroupSize = 1; + static constexpr PrimitiveType primitiveType = PrimitiveType::Points; explicit Points(float pointSize_) : pointSize(pointSize_) {} @@ -21,7 +23,9 @@ public: class Lines { public: using Primitive = Line; + static constexpr std::size_t bufferGroupSize = 2; + static constexpr PrimitiveType primitiveType = PrimitiveType::Lines; explicit Lines(float lineWidth_) : lineWidth(lineWidth_) { assert(lineWidth > 0); @@ -35,7 +39,9 @@ public: // LineStrip is a form of "Line" rendering, but the element buffer // cannot be grouped into logical elements beyond a single Point. using Primitive = Line; + static constexpr std::size_t bufferGroupSize = 1; + static constexpr PrimitiveType primitiveType = PrimitiveType::LineStrip; explicit LineStrip(float lineWidth_) : lineWidth(lineWidth_) { assert(lineWidth > 0); @@ -47,7 +53,9 @@ public: class Triangles { public: using Primitive = Triangle; + static constexpr std::size_t bufferGroupSize = 3; + static constexpr PrimitiveType primitiveType = PrimitiveType::Triangles; }; class TriangleStrip { @@ -55,7 +63,9 @@ public: // TriangleStrip is a form of "Triangle" rendering, but the element buffer // cannot be grouped into logical elements beyond a single Point. using Primitive = Triangle; + static constexpr std::size_t bufferGroupSize = 1; + static constexpr PrimitiveType primitiveType = PrimitiveType::TriangleStrip; }; // Special draw mode for use with VertexVector<Indexed, Vertex>, in which @@ -65,12 +75,5 @@ public: static constexpr std::size_t bufferGroupSize = 1; }; -using DrawMode = variant< - Points, - Lines, - LineStrip, - Triangles, - TriangleStrip>; - } // namespace gl } // namespace mbgl |