Struct glutin::WindowBuilder
source · pub struct WindowBuilder {
pub window: WindowAttributes,
/* private fields */
}
Expand description
Object that allows you to build windows.
Fields§
§window: WindowAttributes
The attributes to use to create the window.
Implementations§
source§impl WindowBuilder
impl WindowBuilder
sourcepub fn new() -> WindowBuilder
pub fn new() -> WindowBuilder
Initializes a new WindowBuilder
with default values.
sourcepub fn with_dimensions(self, width: u32, height: u32) -> WindowBuilder
pub fn with_dimensions(self, width: u32, height: u32) -> WindowBuilder
Requests the window to be of specific dimensions.
Width and height are in pixels.
sourcepub fn with_min_dimensions(self, width: u32, height: u32) -> WindowBuilder
pub fn with_min_dimensions(self, width: u32, height: u32) -> WindowBuilder
Sets a minimum dimension size for the window
Width and height are in pixels.
sourcepub fn with_max_dimensions(self, width: u32, height: u32) -> WindowBuilder
pub fn with_max_dimensions(self, width: u32, height: u32) -> WindowBuilder
Sets a maximum dimension size for the window
Width and height are in pixels.
sourcepub fn with_title<T>(self, title: T) -> WindowBuilderwhere
T: Into<String>,
pub fn with_title<T>(self, title: T) -> WindowBuilderwhere T: Into<String>,
Requests a specific title for the window.
sourcepub fn with_fullscreen(self, monitor: MonitorId) -> WindowBuilder
pub fn with_fullscreen(self, monitor: MonitorId) -> WindowBuilder
Requests fullscreen mode.
If you don’t specify dimensions for the window, it will match the monitor’s.
sourcepub fn with_visibility(self, visible: bool) -> WindowBuilder
pub fn with_visibility(self, visible: bool) -> WindowBuilder
Sets whether the window will be initially hidden or visible.
sourcepub fn with_transparency(self, transparent: bool) -> WindowBuilder
pub fn with_transparency(self, transparent: bool) -> WindowBuilder
Sets whether the background of the window should be transparent.
sourcepub fn with_decorations(self, decorations: bool) -> WindowBuilder
pub fn with_decorations(self, decorations: bool) -> WindowBuilder
Sets whether the window should have a border, a title bar, etc.
sourcepub fn with_multitouch(self) -> WindowBuilder
pub fn with_multitouch(self) -> WindowBuilder
Enables multitouch
sourcepub fn build(self, events_loop: &EventsLoop) -> Result<Window, CreationError>
pub fn build(self, events_loop: &EventsLoop) -> Result<Window, CreationError>
Builds the window.
Error should be very rare and only occur in case of permission denied, incompatible system, out of memory, etc.
Trait Implementations§
source§impl Clone for WindowBuilder
impl Clone for WindowBuilder
source§fn clone(&self) -> WindowBuilder
fn clone(&self) -> WindowBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more