From 3b38cf48b706ace413bee44e8d2742710c9425b4 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 4 Nov 2016 14:42:23 -0700 Subject: [PATCH] [core] Require point size / line width for DrawMode constructors --- src/mbgl/gl/draw_mode.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mbgl/gl/draw_mode.hpp b/src/mbgl/gl/draw_mode.hpp index 8f7db0a3f..ab86d5e46 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 @@ 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; };