23 const auto render_bounds = auto_render_bounds
26 surface.
window()->get_state().current_width,
27 surface.
window()->get_state().current_height)
37 .render_bounds = render_bounds,
44 const uint32_t
id = surface.
layer().
add(std::move(el));
48 if (auto_render_bounds) {
50 [surface,
id, text = spec.
text,
color = spec.
color, bounds = spec.
bounds](uint32_t, uint32_t)
mutable {
51 const auto dims = Kinesis::ndc_size_to_pixels(
52 { bounds.width(), bounds.height() },
53 surface.
window()->get_state().current_width,
54 surface.
window()->get_state().current_height);
56 if (
auto* element = surface.
layer().
get(
id))
74 const auto verts = Kinesis::filled_rect(spec.
bounds, spec.
color);
85 const uint32_t
id = surface.
layer().
add(std::move(el));
100 std::shared_ptr<Kakshya::PlotContainer> container)
102 auto mapped = make_mapped<std::shared_ptr<Kakshya::PlotContainer>>(
103 std::move(container), std::move(spec.
fn), std::move(buf));
105 mapped.element.id = surface.
layer().
add(mapped.element);
106 mapped.state->
id = mapped.element.id;
107 mapped.force_redraw_on_sync =
true;
108 mapped.sync(&surface.
layer());
void on_resize(uint32_t id, ResizeFn fn)
Called on every window resize.
glm::uvec2 ndc_size_to_pixels(const AABB2D ®ion, uint32_t width, uint32_t height)
Convert an NDC AABB's extent to integer pixel dimensions.
float height() const noexcept
float width() const noexcept
glm::vec4 color
RGBA color applied to all glyphs not covered by a span in spans.
Construction parameters for press().