Skip to main content

run_with

Function run_with 

Source
pub fn run_with<F>(render: F) -> Result<()>
where F: FnMut() -> Result<bool>,
Expand description

Runs a message loop driven by render. render is called whenever no messages are pending; return Ok(true) to keep rendering immediately (for continuous animation) or Ok(false) to wait for the next message before rendering again (event-driven, e.g. when occluded or idle). Returns when the window is closed, or early if render returns an error.