[−][src]Struct amethyst_core::frame_limiter::FrameLimiter
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]
U: From<T>,
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> 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]
T: Any + Send + Sync,
impl<T> TryDefault for T where
T: Default,
[src]
T: Default,
fn try_default() -> Result<T, String>
[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]
T: Send + Sync + 'static,
impl<T> Any for T where
T: Any,
[src]
T: Any,