Trait event_loop::EventLoop [] [src]

pub trait EventLoop: Sized {
    fn set_ups(&mut self, frames: u64);
    fn set_max_fps(&mut self, frames: u64);
    fn set_swap_buffers(&mut self, enable: bool);
    fn set_bench_mode(&mut self, enable: bool);

    fn ups(self, frames: u64) -> Self { ... }
    fn max_fps(self, frames: u64) -> Self { ... }
    fn swap_buffers(self, enable: bool) -> Self { ... }
    fn bench_mode(self, enable: bool) -> Self { ... }
}

Methods implements for event loop settings.

Required 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.

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

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.

Provided Methods

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.

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.

Implementors