[core] Require point size / line width for DrawMode constructors
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user