Struct winit::EventsLoop
[−]
[src]
pub struct EventsLoop { /* fields omitted */ }
Provides a way to retreive events from the windows that were registered to it.
To wake up an EventsLoop
from a another thread, see the EventsLoopProxy
docs.
Usage will result in display backend initialisation, this can be controlled on linux
using an environment variable WINIT_UNIX_BACKEND
.
Legal values are
x11
andwayland
. If this variable is set only the named backend will be tried by winit. If it is not set, winit will try to connect to a wayland connection, and if it fails will fallback on x11.If this variable is set with any other value, winit will panic.
Methods
impl EventsLoop
[src]
fn new() -> EventsLoop
Builds a new events loop.
fn poll_events<F>(&mut self, callback: F) where
F: FnMut(Event),
F: FnMut(Event),
Fetches all the events that are pending, calls the callback function for each of them, and returns.
fn run_forever<F>(&mut self, callback: F) where
F: FnMut(Event) -> ControlFlow,
F: FnMut(Event) -> ControlFlow,
Runs forever until interrupt()
is called. Whenever an event happens, calls the callback.
fn create_proxy(&self) -> EventsLoopProxy
Creates an EventsLoopProxy
that can be used to wake up the EventsLoop
from another
thread.