[core] Require point size / line width for DrawMode constructors

This commit is contained in:
John Firebaugh
2016-11-04 14:42:23 -07:00
parent 52be5d480d
commit 3b38cf48b7

View File

@@ -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;
};