Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Require point size / line width for DrawMode constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Nov 4, 2016
1 parent 7505640 commit f41e21d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/mbgl/gl/draw_mode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <mbgl/gl/primitives.hpp>
#include <mbgl/util/variant.hpp>

#include <cassert>

namespace mbgl {
namespace gl {

Expand All @@ -11,6 +13,8 @@ class Points {
using Primitive = Point;
static constexpr std::size_t bufferGroupSize = 1;

explicit Points(float pointSize_) : pointSize(pointSize_) {}

float pointSize;
};

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

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

Expand Down

0 comments on commit f41e21d

Please sign in to comment.