Struct event_loop::EventSettings
source · 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
impl EventSettings
sourcepub fn new() -> EventSettings
pub fn new() -> EventSettings
Creates new with default settings.
Trait Implementations§
source§impl Clone for EventSettings
impl Clone for EventSettings
source§fn clone(&self) -> EventSettings
fn clone(&self) -> EventSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EventSettings
impl Debug for EventSettings
source§impl Default for EventSettings
impl Default for EventSettings
source§fn default() -> EventSettings
fn default() -> EventSettings
source§impl EventLoop for EventSettings
impl EventLoop for EventSettings
source§fn get_event_settings(&self) -> Self
fn get_event_settings(&self) -> Self
source§fn set_event_settings(&mut self, settings: Self)
fn set_event_settings(&mut self, settings: Self)
source§fn set_ups_reset(&mut self, frames: u64)
fn set_ups_reset(&mut self, frames: u64)
0
, it will always try to catch up.source§fn ups_reset(self, frames: u64) -> Self
fn ups_reset(self, frames: u64) -> Self
0
, it will always try to catch up.source§fn set_max_fps(&mut self, frames: u64)
fn set_max_fps(&mut self, frames: u64)
source§fn set_swap_buffers(&mut self, enable: bool)
fn set_swap_buffers(&mut self, enable: bool)
source§fn swap_buffers(self, enable: bool) -> Self
fn swap_buffers(self, enable: bool) -> Self
source§fn set_bench_mode(&mut self, enable: bool)
fn set_bench_mode(&mut self, enable: bool)
lazy
to be set to false
.source§fn bench_mode(self, enable: bool) -> Self
fn bench_mode(self, enable: bool) -> Self
lazy
to be set to false
.