Enum minifb::Scale

source ·
pub enum Scale {
    FitScreen,
    X1,
    X2,
    X4,
    X8,
    X16,
    X32,
}
Expand description

Scale will scale the frame buffer and the window that is being sent in when calling the update function. This is useful if you for example want to display a 320 x 256 window on a screen with much higher resolution which would result in that the window is very small.

Variants§

§

FitScreen

This mode checks your current screen resolution and will caluclate the largest window size that can be used within that limit and resize it. Useful if you have a small buffer to display on a high resolution screen.

§

X1

1X scale (which means leave the corrdinates sent into Window::new untouched)

§

X2

2X window scale (Example: 320 x 200 -> 640 x 400)

§

X4

4X window scale (Example: 320 x 200 -> 1280 x 800)

§

X8

8X window scale (Example: 320 x 200 -> 2560 x 1600)

§

X16

16X window scale (Example: 320 x 200 -> 5120 x 3200)

§

X32

32 window scale (Example: 320 x 200 -> 10240 x 6400)

Trait Implementations§

source§

impl Clone for Scale

source§

fn clone(&self) -> Scale

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Scale

source§

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

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

impl Copy for Scale

Auto Trait Implementations§

§

impl RefUnwindSafe for Scale

§

impl Send for Scale

§

impl Sync for Scale

§

impl Unpin for Scale

§

impl UnwindSafe for Scale

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.