Function winit_main::run[][src]

pub fn run<F>(f: F) -> ! where
    F: FnOnce(EventLoopHandle, EventReceiver) + Send + 'static, 
Expand description

Hijack the main thread with a winit event loop, and spawn a new thread with callbacks to communicate with the main thread.

When the new thread, the “simulated main thread” exits, the event loop will also exit loop. This is this is the primary abstraction of this crate, as it abstracts away winit’s inversion of control, and allows winit to be used more like any other library.