Enum keeshond::renderer::ViewportMode
source · [−]pub enum ViewportMode {
Independent,
Pixel,
OneToOneDpiScaled,
OneToOneUnscaled,
}
Expand description
Determines how the game is scaled to fit the window or screen
Variants
Independent
The view is scaled up or down to fit the window in a resolution-independent way
Pixel
The view is rendered at a fixed size and then scaled up or down with minimal filtering. Use for pixel art style games.
OneToOneDpiScaled
The viewport base size is the same as the window size, taking display DPI into account. Enlarging the window means you see more of the scene. Use for editors and similar utilities.
OneToOneUnscaled
The viewport base size is the same as the window size. Enlarging the window means you see more of the scene. You probably want to use OneToOneDpiScaled instead, unless you are doing your own DPI scaling using current_display_scale_factor().
Trait Implementations
sourceimpl Clone for ViewportMode
impl Clone for ViewportMode
sourcefn clone(&self) -> ViewportMode
fn clone(&self) -> ViewportMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ViewportMode
impl Debug for ViewportMode
sourceimpl PartialEq<ViewportMode> for ViewportMode
impl PartialEq<ViewportMode> for ViewportMode
impl Copy for ViewportMode
impl StructuralPartialEq for ViewportMode
Auto Trait Implementations
impl RefUnwindSafe for ViewportMode
impl Send for ViewportMode
impl Sync for ViewportMode
impl Unpin for ViewportMode
impl UnwindSafe for ViewportMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Content for T where
T: Copy,
impl<T> Content for T where
T: Copy,
type Owned = T
type Owned = T
A type that holds a sized version of the content.
sourceunsafe fn read<F, E>(size: usize, f: F) -> Result<T, E> where
F: FnOnce(&mut T) -> Result<(), E>,
unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E> where
F: FnOnce(&mut T) -> Result<(), E>,
Prepares an output buffer, then turns this buffer into an Owned
.
User-provided closure F
must only write to and not read from &mut Self
. Read more
sourcefn get_elements_size() -> usize
fn get_elements_size() -> usize
Returns the size of each element.
sourcefn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Produces a pointer to the data.
sourcefn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
sourcefn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more