#pragma once #include #include #include #include namespace mbgl { namespace attributes { // Layout attributes MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_pos); MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_extrude); MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, a_texture_pos); template struct a_data : gl::Attribute { static auto name() { return "a_data"; } }; template struct a_offset : gl::Attribute { static auto name() { return "a_offset"; } }; // Paint attributes template struct Min : Attr { static auto name() { static const std::string name = Attr::name() + std::string("_min"); return name.c_str(); } }; template struct Max : Attr { static auto name() { static const std::string name = Attr::name() + std::string("_max"); return name.c_str(); } }; template struct InterpolationUniform : gl::UniformScalar, float> { static auto name() { static const std::string name = Attr::name() + std::string("_t"); return name.c_str(); } }; struct a_color : gl::Attribute, 4> { static auto name() { return "a_color"; } static Value value(const Color& color) { return {{ gl::Normalized(color.r), gl::Normalized(color.g), gl::Normalized(color.b), gl::Normalized(color.a) }}; } }; struct a_stroke_color : gl::Attribute, 4> { static auto name() { return "a_stroke_color"; } static Value value(const Color& color) { return {{ gl::Normalized(color.r), gl::Normalized(color.g), gl::Normalized(color.b), gl::Normalized(color.a) }}; } }; struct a_outline_color : gl::Attribute, 4> { static auto name() { return "a_outline_color"; } static Value value(const Color& color) { return {{ gl::Normalized(color.r), gl::Normalized(color.g), gl::Normalized(color.b), gl::Normalized(color.a) }}; } }; struct a_opacity : gl::Attribute, 1> { static auto name() { return "a_opacity"; } static Value value(float opacity) { return {{ gl::Normalized(opacity) }}; } }; struct a_stroke_opacity : gl::Attribute, 1> { static auto name() { return "a_stroke_opacity"; } static Value value(float opacity) { return {{ gl::Normalized(opacity) }}; } }; struct a_blur : gl::Attribute { static auto name() { return "a_blur"; } static Value value(float blur) { return {{ blur }}; } }; struct a_radius : gl::Attribute { static auto name() { return "a_radius"; } static Value value(float radius) { return {{ radius }}; } }; struct a_width : gl::Attribute { static auto name() { return "a_width"; } static Value value(float width) { return {{ width }}; } }; struct a_height : gl::Attribute { static auto name() { return "a_height"; } static Value value(float width) { return {{ width }}; } }; struct a_base : gl::Attribute { static auto name() { return "a_base"; } static Value value(float width) { return {{ width }}; } }; struct a_gap_width : gl::Attribute { static auto name() { return "a_gapwidth"; } static Value value(float width) { return {{ width }}; } }; struct a_stroke_width : gl::Attribute { static auto name() { return "a_stroke_width"; } static Value value(float width) { return {{ width }}; } }; template <> struct a_offset<1> : gl::Attribute { static auto name() { return "a_offset"; } static Value value(float offset) { return {{ offset }}; } }; } // namespace attributes } // namespace mbgl