[][src]Trait piston_window::EventLoop

pub trait EventLoop {
    fn get_event_settings(&self) -> EventSettings;
fn set_event_settings(&mut self, settings: EventSettings); fn set_ups(&mut self, frames: u64) { ... }
fn ups(self, frames: u64) -> Self { ... }
fn set_ups_reset(&mut self, frames: u64) { ... }
fn ups_reset(self, frames: u64) -> Self { ... }
fn set_max_fps(&mut self, frames: u64) { ... }
fn max_fps(self, frames: u64) -> Self { ... }
fn set_swap_buffers(&mut self, enable: bool) { ... }
fn swap_buffers(self, enable: bool) -> Self { ... }
fn set_bench_mode(&mut self, enable: bool) { ... }
fn bench_mode(self, enable: bool) -> Self { ... }
fn set_lazy(&mut self, enable: bool) { ... }
fn lazy(self, enable: bool) -> Self { ... } }

Methods implemented for changing event loop settings.

Required methods

fn get_event_settings(&self) -> EventSettings

Returns event loop settings.

fn set_event_settings(&mut self, settings: EventSettings)

Sets event loop settings.

Loading content...

Provided methods

fn set_ups(&mut self, frames: u64)

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. When set to 0, update events are disabled.

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. When set to 0, update events are disabled.

fn set_ups_reset(&mut self, frames: u64)

The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up.

fn ups_reset(self, frames: u64) -> Self

The number of delayed updates before skipping them to catch up. When set to 0, it will always try to catch up.

fn set_max_fps(&mut self, frames: u64)

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 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 set_swap_buffers(&mut self, enable: bool)

Enable or disable automatic swapping of buffers.

fn swap_buffers(self, enable: bool) -> Self

Enable or disable automatic swapping of buffers.

fn set_bench_mode(&mut self, enable: bool)

Enable or disable benchmark mode. When enabled, it will render and update without sleep and ignore input. Used to test performance by playing through as fast as possible. Requires lazy to be set to false.

fn bench_mode(self, enable: bool) -> Self

Enable or disable benchmark mode. When enabled, it will render and update without sleep and ignore input. Used to test performance by playing through as fast as possible. Requires lazy to be set to false.

fn set_lazy(&mut self, enable: bool)

Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input.

fn lazy(self, enable: bool) -> Self

Enable or disable rendering only when receiving input. When enabled, update events are disabled. Idle events are emitted while receiving input.

Loading content...

Implementors

impl EventLoop for EventSettings[src]

fn set_ups(&mut self, frames: u64)[src]

fn ups(self, frames: u64) -> Self[src]

fn set_ups_reset(&mut self, frames: u64)[src]

fn ups_reset(self, frames: u64) -> Self[src]

fn set_max_fps(&mut self, frames: u64)[src]

fn max_fps(self, frames: u64) -> Self[src]

fn set_swap_buffers(&mut self, enable: bool)[src]

fn swap_buffers(self, enable: bool) -> Self[src]

fn set_bench_mode(&mut self, enable: bool)[src]

fn bench_mode(self, enable: bool) -> Self[src]

fn set_lazy(&mut self, enable: bool)[src]

fn lazy(self, enable: bool) -> Self[src]

impl EventLoop for Events[src]

fn set_ups(&mut self, frames: u64)[src]

fn ups(self, frames: u64) -> Self[src]

fn set_ups_reset(&mut self, frames: u64)[src]

fn ups_reset(self, frames: u64) -> Self[src]

fn set_max_fps(&mut self, frames: u64)[src]

fn max_fps(self, frames: u64) -> Self[src]

fn set_swap_buffers(&mut self, enable: bool)[src]

fn swap_buffers(self, enable: bool) -> Self[src]

fn set_bench_mode(&mut self, enable: bool)[src]

fn bench_mode(self, enable: bool) -> Self[src]

fn set_lazy(&mut self, enable: bool)[src]

fn lazy(self, enable: bool) -> Self[src]

impl<W> EventLoop for PistonWindow<W> where
    W: Window
[src]

fn set_ups(&mut self, frames: u64)[src]

fn ups(self, frames: u64) -> Self[src]

fn set_ups_reset(&mut self, frames: u64)[src]

fn ups_reset(self, frames: u64) -> Self[src]

fn set_max_fps(&mut self, frames: u64)[src]

fn max_fps(self, frames: u64) -> Self[src]

fn set_swap_buffers(&mut self, enable: bool)[src]

fn swap_buffers(self, enable: bool) -> Self[src]

fn set_bench_mode(&mut self, enable: bool)[src]

fn bench_mode(self, enable: bool) -> Self[src]

fn set_lazy(&mut self, enable: bool)[src]

fn lazy(self, enable: bool) -> Self[src]

Loading content...