Struct event_loop::WindowEvents
[−]
[src]
pub struct WindowEvents<W, E> where W: Window, E: EventMap<W::Event> {
// some fields omitted
}
An event loop iterator
Warning: Because the iterator polls events from the window back-end, it must be used on the same thread as the window back-end (usually main thread), unless the window back-end supports multi-thread event polling.
Methods
impl<W, E> WindowEvents<W, E> where W: Window, E: EventMap<W::Event>
fn new(window: Rc<RefCell<W>>) -> WindowEvents<W, E>
Creates a new event iterator with default UPS and FPS settings.
fn ups(self, frames: u64) -> Self
The number of updates per second
This is the fixed update rate on average over time. If the event loop lags, it will try to catch up.
fn max_fps(self, frames: u64) -> Self
The maximum number of frames per second
The frame rate can be lower because the next frame is always scheduled from the previous frame. This causes the frames to "slip" over time.
fn swap_buffers(self, enable: bool) -> Self
Enable or disable automatic swapping of buffers.