pub struct WindowDescriptor {Show 13 fields
pub width: f32,
pub height: f32,
pub position: Option<[f32; 2]>,
pub resize_constraints: WindowResizeConstraints,
pub scale_factor_override: Option<f64>,
pub title: String,
pub present_mode: PresentMode,
pub resizable: bool,
pub decorations: bool,
pub cursor_visible: bool,
pub cursor_locked: bool,
pub mode: WindowMode,
pub transparent: bool,
}
Expand description
Describes the information needed for creating a window.
Fields§
§width: f32
The requested logical width of the window’s client area.
May vary from the physical width due to different pixel density on different monitors.
height: f32
The requested logical height of the window’s client area.
May vary from the physical height due to different pixel density on different monitors.
position: Option<[f32; 2]>
The position on the screen that the window will be centered at.
If set to None
, some platform-specific position will be chosen.
resize_constraints: WindowResizeConstraints
Sets minimum and maximum resize limits.
scale_factor_override: Option<f64>
Overrides the window’s ratio of physical pixels to logical pixels.
If there are some scaling problems on X11 try to set this option to Some(1.0)
.
title: String
Sets the title that displays on the window top bar, on the system task bar and other OS specific places.
present_mode: PresentMode
The window’s PresentMode
.
Used to select whether or not VSync is used
resizable: bool
Sets whether the window is resizable.
decorations: bool
Sets whether the window should have borders and bars.
cursor_visible: bool
Sets whether the cursor is visible when the window has focus.
cursor_locked: bool
Sets whether the window locks the cursor inside its borders when the window has focus.
mode: WindowMode
Sets the WindowMode
.
transparent: bool
Sets whether the background of the window should be transparent.
Trait Implementations§
Source§impl Clone for WindowDescriptor
impl Clone for WindowDescriptor
Source§fn clone(&self) -> WindowDescriptor
fn clone(&self) -> WindowDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WindowDescriptor
impl Debug for WindowDescriptor
Auto Trait Implementations§
impl Freeze for WindowDescriptor
impl RefUnwindSafe for WindowDescriptor
impl Send for WindowDescriptor
impl Sync for WindowDescriptor
impl Unpin for WindowDescriptor
impl UnwindSafe for WindowDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.