[][src]Struct amethyst_core::frame_limiter::FrameLimiter

pub struct FrameLimiter { /* fields omitted */ }

Frame limiter resource.

FrameLimiter is used internally by amethyst to limit the frame rate to the rate specified by the user. It is added as a resource to the world so that user code may change the frame rate limit at runtime if necessary.

Methods

impl FrameLimiter[src]

pub fn new(strategy: FrameRateLimitStrategy, fps: u32) -> Self[src]

Creates a new frame limiter.

pub fn set_rate(&mut self, strategy: FrameRateLimitStrategy, fps: u32)[src]

Sets the maximum fps and frame rate limiting strategy.

pub fn from_config(config: FrameRateLimitConfig) -> Self[src]

Creates a new frame limiter with the given config.

pub fn start(&mut self)[src]

Resets the frame start time to the current instant.

This resets the frame limiter's internal tracking of when the last frame started to the current instant. Be careful when calling start, as doing so will cause the current frame to be longer than normal if not called at the very beginning of the frame.

pub fn wait(&mut self)[src]

Blocks the current thread until the allotted frame time has passed.

wait is used internally by Application to limit the frame rate of the game to the configured rate. This should likely never be called directly by game logic.

Trait Implementations

impl Default for FrameLimiter[src]

impl Debug for FrameLimiter[src]

Auto Trait Implementations

impl Unpin for FrameLimiter

impl Sync for FrameLimiter

impl Send for FrameLimiter

impl UnwindSafe for FrameLimiter

impl RefUnwindSafe for FrameLimiter

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> TryDefault for T where
    T: Default
[src]

fn unwrap_default() -> Self[src]

Calls try_default and panics on an error case.

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> Any for T where
    T: Any
[src]