pane_ui 0.1.0

A RON-driven, hot-reloadable wgpu UI library with spring animations and consistent scaling
Documentation
//! # order
//!
//! The per-frame schedule. Every fn called once per frame lives here, in order.
//! If it happens every frame, it is called from `run_frame`. Nowhere else.
//!
//! To insert a step: write the fn, add the call in the right place.
//! To remove a step: delete the call and the fn.
//! To reorder: move the call.
//!
//! Keep this file thin. If a step fn grows beyond a few lines, the logic belongs elsewhere.
use crate::threader::FrameCtx;

/// Execute one full UI frame: poll input, tick all widgets, build the draw scene, and present.
///
/// This is the single entry point for the per-frame schedule.  Every step runs in a fixed order;
/// see the module-level doc for how to add, remove, or reorder steps.
pub fn run_frame(
    ctx: &mut FrameCtx,
    encoder: Option<&mut wgpu::CommandEncoder>,
    view: Option<&wgpu::TextureView>,
) {
    crate::logic::check_messages(ctx);
    ctx.frame.input.poll_gamepad();
    crate::logic::tick_dt(ctx);
    ctx.frame.scene.clear();
    crate::logic::draw_background(ctx);
    crate::logic::clear_nav_on_mouse(ctx);
    crate::logic::resolve_edges(ctx);
    crate::logic::tick_all(ctx);
    crate::keyboard::tick_osk(ctx);
    crate::logic::resolve_nav(ctx);
    ctx.frame.input.begin_frame(ctx.frame.dt);
    crate::logic::present(ctx, encoder, view);
}