summaryrefslogtreecommitdiff
path: root/src/mbgl/gl
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-11-04 14:42:23 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:29 -0800
commit3b38cf48b706ace413bee44e8d2742710c9425b4 (patch)
tree1c32acc83174f280938d3bcf345ddd7e714266a4 /src/mbgl/gl
parent52be5d480d6fa0eabe51e2b66498f59c5d1f3edf (diff)
downloadqtlocation-mapboxgl-3b38cf48b706ace413bee44e8d2742710c9425b4.tar.gz
[core] Require point size / line width for DrawMode constructors
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r--src/mbgl/gl/draw_mode.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mbgl/gl/draw_mode.hpp b/src/mbgl/gl/draw_mode.hpp
index 8f7db0a3fa..ab86d5e469 100644
--- a/src/mbgl/gl/draw_mode.hpp
+++ b/src/mbgl/gl/draw_mode.hpp
@@ -3,6 +3,8 @@
#include <mbgl/gl/primitives.hpp>
#include <mbgl/util/variant.hpp>
+#include <cassert>
+
namespace mbgl {
namespace gl {
@@ -11,6 +13,8 @@ public:
using Primitive = Point;
static constexpr std::size_t bufferGroupSize = 1;
+ explicit Points(float pointSize_) : pointSize(pointSize_) {}
+
float pointSize;
};
@@ -19,6 +23,10 @@ public:
using Primitive = Line;
static constexpr std::size_t bufferGroupSize = 2;
+ explicit Lines(float lineWidth_) : lineWidth(lineWidth_) {
+ assert(lineWidth > 0);
+ }
+
float lineWidth;
};
@@ -29,6 +37,10 @@ public:
using Primitive = Line;
static constexpr std::size_t bufferGroupSize = 1;
+ explicit LineStrip(float lineWidth_) : lineWidth(lineWidth_) {
+ assert(lineWidth > 0);
+ }
+
float lineWidth;
};