Enum nannou::app::LoopMode
[−]
[src]
pub enum LoopMode { Rate { update_interval: Duration, }, Wait { updates_following_event: usize, update_interval: Duration, }, }
The mode in which the App is currently running the event loop.
Variants
Rate
Specifies that the application is continuously looping at a consistent rate.
An application running in the Rate loop mode will behave as follows:
-
Poll for and collect all pending user input.
update
is then called with all application events that have occurred. -
update
is called with anEvent::Update
. -
draw
is called. -
Check the time and sleep for the remainder of the
update_intervale
.
Fields of Rate
update_interval: Duration | The minimum interval between emitted updates. |
Wait
Fields of Wait
updates_following_event: usize | The number of |
update_interval: Duration | The minimum interval between emitted updates. |
Methods
impl LoopMode
[src]
pub const DEFAULT_RATE_FPS: f64
DEFAULT_RATE_FPS: f64 = 60.0
pub const DEFAULT_UPDATES_FOLLOWING_EVENT: usize
DEFAULT_UPDATES_FOLLOWING_EVENT: usize = 3
pub fn rate_fps(fps: f64) -> Self
[src]
Specify the Rate mode with the given frames-per-second.
pub fn wait(updates_following_event: usize) -> Self
[src]
Specify the Wait mode with the given number of updates following each non-Update
event.
Uses the default update interval.
pub fn wait_with_max_fps(updates_following_event: usize, max_fps: f64) -> Self
[src]
Specify the Wait mode with the given number of updates following each non-Update
event.
Waits long enough to ensure loop iteration never occurs faster than the given max_fps
.
pub fn wait_with_interval(
updates_following_event: usize,
update_interval: Duration
) -> Self
[src]
updates_following_event: usize,
update_interval: Duration
) -> Self
Specify the Wait mode with the given number of updates following each non-Update
event.
Waits long enough to ensure loop iteration never occurs faster than the given max_fps
.
Trait Implementations
impl Copy for LoopMode
[src]
impl Clone for LoopMode
[src]
fn clone(&self) -> LoopMode
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for LoopMode
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for LoopMode
[src]
fn eq(&self, __arg_0: &LoopMode) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LoopMode) -> bool
[src]
This method tests for !=
.