13 std::array<Kakshya::MeshVertex, 6> textured_mesh_rect(
17 const glm::vec2 mn = region.
min;
18 const glm::vec2 mx = region.
max;
20 V { .position = { mn.x, mn.y, 0.F }, .weight = 1.F, .uv = { 0.F, 1.F } },
21 V { .position = { mx.x, mn.y, 0.F }, .weight = 1.F, .uv = { 1.F, 1.F } },
22 V { .position = { mn.x, mx.y, 0.F }, .weight = 1.F, .uv = { 0.F, 0.F } },
23 V { .position = { mx.x, mn.y, 0.F }, .weight = 1.F, .uv = { 1.F, 1.F } },
24 V { .position = { mx.x, mx.y, 0.F }, .weight = 1.F, .uv = { 1.F, 0.F } },
25 V { .position = { mn.x, mx.y, 0.F }, .weight = 1.F, .uv = { 0.F, 0.F } },
32 const std::shared_ptr<Core::VKImage>&
image,
39 buffer->submit(textured_mesh_rect(region));
45 const std::shared_ptr<Buffers::TextureBuffer>& buf,
52 std::string_view text,
53 std::optional<Portal::Text::PressParams> params,
59 if (!params.has_value())
63 buffer->submit(textured_mesh_rect(region));
68void Element::set_text(std::string_view text, std::optional<Portal::Text::PressParams> params)
73 if (!params.has_value())
bool repress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color, RedrawPolicy policy)
Re-composite a UTF-8 string into an existing TextBuffer.
std::shared_ptr< Buffers::TextBuffer > press(std::string_view text, const PressParams ¶ms)
Composite a UTF-8 string into a new TextBuffer.
Vertex type for indexed triangle mesh primitives (TRIANGLE_LIST topology)
Axis-aligned bounding rectangle in a 2D coordinate space.
Construction parameters for press().