[−][src]Enum nannou::app::LoopMode
The mode in which the App is currently running the event loop and emitting Update
events.
Variants
Synchronises Update
events with requests for a new image by the swap chain.
The result of using this loop mode is similar to using vsync in traditional applications. E.g. if you have one window running on a monitor with a 60hz refresh rate, your update will get called at a fairly consistent interval that is close to 60 times per second.
Specifies that the application is continuously looping at a consistent rate.
NOTE: This currently behaves the same as RefreshSync
. Need to upate this to handled a
fix step properly in the future. See #456.
Fields of Rate
update_interval: Duration
The minimum interval between emitted updates.
Waits for user input events to occur before calling event
with an Update
event.
This is particularly useful for low-energy GUIs that only need to update when some sort of input has occurred. The benefit of using this mode is that you don't waste CPU cycles looping or updating when you know nothing is changing in your model or view.
Loops for the given number of updates and then finishes.
This is similar to the Wait loop mode, except that windowing, application and input
events will not cause the loop to update or view again after the initial
number_of_updates
have already been applied.
This is useful for sketches where you only want to draw one frame, or if you know exactly how many updates you require for an animation, etc.
Fields of NTimes
number_of_updates: usize
The number of updates that must be emited regardless of non-update events
Implementations
impl LoopMode
[src]
pub const DEFAULT_RATE_FPS: f64
[src]
pub const UPDATES_PER_WAIT_EVENT: u32
[src]
The minimum number of updates that will be emitted after an event is triggered in Wait mode.
pub fn refresh_sync() -> Self
[src]
A simplified constructor for the default RefreshSync
loop mode.
Assumes a display refresh rate of ~60hz and in turn specifies a minimum_update_latency
of
~8.33ms. The windows
field is set to None
.
pub fn rate_fps(fps: f64) -> Self
[src]
Specify the Rate mode with the given frames-per-second.
pub fn wait() -> Self
[src]
Specify the Wait mode.
pub fn loop_ntimes(number_of_updates: usize) -> Self
[src]
Specify the Ntimes mode with one update
Waits long enough to ensure loop iteration never occurs faster than the given max_fps
.
pub fn loop_once() -> Self
[src]
Specify the Ntimes mode with one update
Trait Implementations
impl Clone for LoopMode
[src]
impl Debug for LoopMode
[src]
impl Default for LoopMode
[src]
impl PartialEq<LoopMode> for LoopMode
[src]
impl StructuralPartialEq for LoopMode
[src]
Auto Trait Implementations
impl RefUnwindSafe for LoopMode
impl Send for LoopMode
impl Sync for LoopMode
impl Unpin for LoopMode
impl UnwindSafe for LoopMode
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,