[][src]Enum minifb::ScaleMode

pub enum ScaleMode {
    Stretch,
    AspectRatioStretch,
    Center,
    UpperLeft,
}

On some OS (X11 for example) it's possible a window can resize even if no resize has been set. This causes some issues depending on how the content of an input buffer should be displayed then it's possible to set this scaling mode to get a better behavior.

Variants

Stretch

Stretch the buffer in the whole window meaning if your buffer is 256x256 and window is 1024x1024 it will be scaled up 4 times

AspectRatioStretch

Keep the correct aspect ratio to be displayed while scaling up fully in the other axis. Fill area will be filed with Window::set_bg_color (default 0, 0, 0)

Center

Places the buffer in the middle of the window without any scaling. Fills the borders with color set Window::set_background_color (default 0, 0, 0) If the window is smaller than the buffer the center of the buffer will be displayed

UpperLeft

Same as Center but places the buffer in the upper left corner of the window.

Trait Implementations

impl Clone for ScaleMode[src]

impl Copy for ScaleMode[src]

impl Debug for ScaleMode[src]

impl PartialEq<ScaleMode> for ScaleMode[src]

impl StructuralPartialEq for ScaleMode[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.