diff --git a/src/mbgl/gl/draw_mode.hpp b/src/mbgl/gl/draw_mode.hpp index 8f7db0a3fa2..ab86d5e4690 100644 --- a/src/mbgl/gl/draw_mode.hpp +++ b/src/mbgl/gl/draw_mode.hpp @@ -3,6 +3,8 @@ #include #include +#include + namespace mbgl { namespace gl { @@ -11,6 +13,8 @@ class Points { using Primitive = Point; static constexpr std::size_t bufferGroupSize = 1; + explicit Points(float pointSize_) : pointSize(pointSize_) {} + float pointSize; }; @@ -19,6 +23,10 @@ class Lines { 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 @@ class LineStrip { using Primitive = Line; static constexpr std::size_t bufferGroupSize = 1; + explicit LineStrip(float lineWidth_) : lineWidth(lineWidth_) { + assert(lineWidth > 0); + } + float lineWidth; };