| 25 | namespace |
| 26 | { |
| 27 | void BuildText(ref_ptr<dp::GraphicsContext> context, std::string const & str, dp::FontDecl const & font, |
| 28 | m2::PointD const & position, m2::PointD const & center, ref_ptr<dp::TextureManager> textures, |
| 29 | dp::Batcher & batcher) |
| 30 | { |
| 31 | gui::StaticLabel::LabelResult result; |
| 32 | gui::StaticLabel::CacheStaticText(str, "\n", dp::LeftTop, font, textures, result); |
| 33 | glsl::vec2 const pt = glsl::ToVec2(df::MapShape::ConvertToLocal(position, center, df::kShapeCoordScalar)); |
| 34 | for (gui::StaticLabel::Vertex & v : result.m_buffer) |
| 35 | v.m_position = glsl::vec3(pt, 0.0f); |
| 36 | |
| 37 | dp::AttributeProvider provider(1 /* streamCount */, static_cast<uint32_t>(result.m_buffer.size())); |
| 38 | provider.InitStream(0 /* streamIndex */, gui::StaticLabel::Vertex::GetBindingInfo(), |
| 39 | make_ref(result.m_buffer.data())); |
| 40 | |
| 41 | batcher.InsertListOfStrip(context, result.m_state, make_ref(&provider), dp::Batcher::VertexPerQuad); |
| 42 | } |
| 43 | } // namespace |
| 44 | |
| 45 | namespace df |
no test coverage detected