DVUI

step

Runs exactly one frame, returning the wait_time from dvui.Window.end.

Assumes we are just after dvui.Window.begin, and moves to just after the next dvui.Window.begin.

Useful when you know the frame will not settle, but you need the frame to handle events.

Parameters

#
frame:dvui.App.frameFunction
dvui.App.frameFunction

Source

Implementation

#
pub fn step(frame: dvui.App.frameFunction) !?u32 {
    const cw = dvui.currentWindow();
    if (try frame() == .close) return error.closed;
    const wait_time = try cw.end(.{});
    try cw.begin(cw.frame_time_ns + 100 * std.time.ns_per_ms);
    return wait_time;
}