#pragma once #include #include #include namespace mbgl { struct SymbolAttributes : gl::Attributes< attributes::a_pos, attributes::a_offset, attributes::a_texture_pos, attributes::a_data<4>> { static Vertex vertex(Point a, Point o, uint16_t tx, uint16_t ty, float minzoom, float maxzoom, float labelminzoom, uint8_t labelangle) { return Vertex { { static_cast(a.x), static_cast(a.y) }, { static_cast(::round(o.x * 64)), // use 1/64 pixels for placement static_cast(::round(o.y * 64)) }, { static_cast(tx / 4), static_cast(ty / 4) }, { static_cast(labelminzoom * 10), // 1/10 zoom levels: z16 == 160 static_cast(labelangle), static_cast(minzoom * 10), static_cast(::fmin(maxzoom, 25) * 10) } }; } }; using SymbolVertex = SymbolAttributes::Vertex; static_assert(sizeof(SymbolVertex) == 16, "expected SymbolVertex size"); } // namespace mbgl