diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/gl/gl_values.hpp | 22 | ||||
-rw-r--r-- | include/mbgl/style/conversion/make_property_setters.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/style/layers/circle_layer.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/style/types.hpp | 5 |
4 files changed, 27 insertions, 4 deletions
diff --git a/include/mbgl/gl/gl_values.hpp b/include/mbgl/gl/gl_values.hpp index b15ef18f48..29a5281cca 100644 --- a/include/mbgl/gl/gl_values.hpp +++ b/include/mbgl/gl/gl_values.hpp @@ -3,6 +3,7 @@ #include <cstdint> #include <tuple> #include <array> +#include <cassert> #include <mbgl/gl/gl.hpp> #include <mbgl/util/color.hpp> @@ -258,15 +259,15 @@ struct LineWidth { }; struct ActiveTexture { - using Type = GLint; + using Type = uint8_t; static const Type Default; static void Set(const Type& value) { - MBGL_CHECK_ERROR(glActiveTexture(value)); + MBGL_CHECK_ERROR(glActiveTexture(GL_TEXTURE0 + value)); } static Type Get() { - Type activeTexture; + GLint activeTexture; MBGL_CHECK_ERROR(glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture)); - return activeTexture; + return activeTexture - GL_TEXTURE0; } }; @@ -305,5 +306,18 @@ struct RasterPos { #endif // GL_ES_VERSION_2_0 +struct BindTexture { + using Type = GLuint; + static const Type Default; + static void Set(const Type& value) { + MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, value)); + } + static Type Get() { + GLint texture; + MBGL_CHECK_ERROR(glGetIntegerv(GL_TEXTURE_BINDING_2D, &texture)); + return texture; + } +}; + } // namespace gl } // namespace mbgl diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp index 4c0089deaf..3da04e4a63 100644 --- a/include/mbgl/style/conversion/make_property_setters.hpp +++ b/include/mbgl/style/conversion/make_property_setters.hpp @@ -112,6 +112,7 @@ auto makePaintPropertySetters() { result["circle-opacity"] = makePropertySetter<V>(&CircleLayer::setCircleOpacity); result["circle-translate"] = makePropertySetter<V>(&CircleLayer::setCircleTranslate); result["circle-translate-anchor"] = makePropertySetter<V>(&CircleLayer::setCircleTranslateAnchor); + result["circle-pitch-scale"] = makePropertySetter<V>(&CircleLayer::setCirclePitchScale); result["raster-opacity"] = makePropertySetter<V>(&RasterLayer::setRasterOpacity); result["raster-hue-rotate"] = makePropertySetter<V>(&RasterLayer::setRasterHueRotate); diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp index c8d99ab30e..873f95bcff 100644 --- a/include/mbgl/style/layers/circle_layer.hpp +++ b/include/mbgl/style/layers/circle_layer.hpp @@ -44,6 +44,9 @@ public: PropertyValue<TranslateAnchorType> getCircleTranslateAnchor() const; void setCircleTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {}); + PropertyValue<CirclePitchScaleType> getCirclePitchScale() const; + void setCirclePitchScale(PropertyValue<CirclePitchScaleType>, const optional<std::string>& klass = {}); + // Private implementation class Impl; diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp index 28ebda9fb9..34e5642ec6 100644 --- a/include/mbgl/style/types.hpp +++ b/include/mbgl/style/types.hpp @@ -45,6 +45,11 @@ enum class RotateAnchorType : bool { Viewport, }; +enum class CirclePitchScaleType : bool { + Map, + Viewport, +}; + enum class SymbolPlacementType : bool { Point, Line, |