Enum mini_sdl::Timing

source ·
pub enum Timing {
    Vsync,
    Immediate,
    VsyncLimitFPS(f64),
    ImmediateLimitFPS(f64),
}
Expand description

The timing strategy used on every frame advance.

Variants§

§

Vsync

The best, smoothest option! Frame timing will be perfectly in sync with the display. However, you will need to use delta-timing in your game logic to account for different display frequencies, considering that that both 60Hz and 120Hz displays are common.

§

Immediate

Simply draw as fast as possible. Will max out CPU use, drain battery faster, etc.

§

VsyncLimitFPS(f64)

Like Vsync, but prevents frame rate from going past a limit. Easier said than done, micro stutter CAN HAPPEN If the display frequency doesn’t match the limit, and the results will also vary wildly per platform.

§

ImmediateLimitFPS(f64)

Simply limits the frame rate without attempting Vsync. May yield better results on some platforms.

Trait Implementations§

source§

impl Debug for Timing

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Timing

source§

fn default() -> Timing

Returns the “default value” for a type. Read more
source§

impl PartialEq for Timing

source§

fn eq(&self, other: &Timing) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Timing

Auto Trait Implementations§

§

impl Freeze for Timing

§

impl RefUnwindSafe for Timing

§

impl Send for Timing

§

impl Sync for Timing

§

impl Unpin for Timing

§

impl UnwindSafe for Timing

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.