#pragma once #include #include namespace mbgl { namespace gfx { class DrawMode { protected: DrawMode(DrawModeType type_, float size_) : type(type_), size(size_) { } public: const DrawModeType type; const float size; }; template struct BufferGroupSizeOf; template struct PrimitiveTypeOf; class Points : public DrawMode { public: explicit Points(float pointSize_) : DrawMode(DrawModeType::Points, pointSize_) { assert(size > 0); } }; template <> struct BufferGroupSizeOf : std::integral_constant {}; template <> struct PrimitiveTypeOf : std::integral_constant {}; class Lines : public DrawMode { public: explicit Lines(float lineWidth_) : DrawMode(DrawModeType::Lines, lineWidth_) { assert(size > 0); } }; template <> struct BufferGroupSizeOf : std::integral_constant {}; template <> struct PrimitiveTypeOf : std::integral_constant {}; // LineStrip is a form of "Line" rendering, but the element buffer // cannot be grouped into logical elements beyond a single Point. class LineStrip : public DrawMode { public: explicit LineStrip(float lineWidth_) : DrawMode(DrawModeType::LineStrip, lineWidth_) { assert(size > 0); } }; template <> struct BufferGroupSizeOf : std::integral_constant {}; template <> struct PrimitiveTypeOf : std::integral_constant {}; class Triangles : public DrawMode { public: explicit Triangles() : DrawMode(DrawModeType::Triangles, 0) { } }; template <> struct BufferGroupSizeOf : std::integral_constant {}; template <> struct PrimitiveTypeOf : std::integral_constant {}; // TriangleStrip is a form of "Triangle" rendering, but the element buffer // cannot be grouped into logical elements beyond a single Point. class TriangleStrip : public DrawMode { public: explicit TriangleStrip() : DrawMode(DrawModeType::TriangleStrip, 0) { } }; template <> struct BufferGroupSizeOf : std::integral_constant {}; template <> struct PrimitiveTypeOf : std::integral_constant {}; } // namespace gfx } // namespace mbgl