pub struct EventSettings {
    pub max_fps: u64,
    pub ups: u64,
    pub ups_reset: u64,
    pub swap_buffers: bool,
    pub bench_mode: bool,
    pub lazy: bool,
}
Expand description

Stores event loop settings.

Fields§

§max_fps: 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.

§ups: 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.

§ups_reset: u64

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

§swap_buffers: bool

Enable or disable automatic swapping of buffers.

§bench_mode: 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.

§lazy: bool

Enable or disable rendering only when receiving input. When enabled, update and idle events are disabled.

Implementations§

source§

impl EventSettings

source

pub fn new() -> EventSettings

Creates new with default settings.

Trait Implementations§

source§

impl Clone for EventSettings

source§

fn clone(&self) -> EventSettings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EventSettings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for EventSettings

source§

fn default() -> EventSettings

Returns the “default value” for a type. Read more
source§

impl EventLoop for EventSettings

source§

fn get_event_settings(&self) -> Self

Returns event loop settings.
source§

fn set_event_settings(&mut self, settings: Self)

Sets event loop settings.
source§

fn set_ups(&mut self, frames: u64)

The number of updates per second Read more
source§

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

The number of updates per second Read more
source§

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.
source§

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.
source§

fn set_max_fps(&mut self, frames: u64)

The maximum number of frames per second Read more
source§

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

The maximum number of frames per second Read more
source§

fn set_swap_buffers(&mut self, enable: bool)

Enable or disable automatic swapping of buffers.
source§

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

Enable or disable automatic swapping of buffers.
source§

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.
source§

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.
source§

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.
source§

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.
source§

impl Copy for EventSettings

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.