Skip to main content

run

Function run 

Source
pub fn run<F>(title: &str, size: Size2D, frame_fn: F)
where F: FnMut(&mut FrameState<'_>) + 'static,
Expand description

Runs a single-window application with a per-frame closure.

This is the simplest way to get a window on screen. On error, the error is logged and the process exits with ERROR.

§Example

use optic_loop::run;

run("Hello", (800, 600).into(), |frame| {
    frame.gpu.clear();
});