Struct winit::WindowBuilder
[−]
[src]
pub struct WindowBuilder { pub window: WindowAttributes, // some fields omitted }
Object that allows you to build windows.
Fields
window: WindowAttributes
The attributes to use to create the window.
Methods
impl WindowBuilder
[src]
fn new() -> WindowBuilder
Initializes a new WindowBuilder
with default values.
fn with_dimensions(self, width: u32, height: u32) -> WindowBuilder
Requests the window to be of specific dimensions.
Width and height are in pixels.
fn with_min_dimensions(self, width: u32, height: u32) -> WindowBuilder
Sets a minimum dimension size for the window
Width and height are in pixels.
fn with_max_dimensions(self, width: u32, height: u32) -> WindowBuilder
Sets a maximum dimension size for the window
Width and height are in pixels.
fn with_title<T: Into<String>>(self, title: T) -> WindowBuilder
Requests a specific title for the window.
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.
fn with_visibility(self, visible: bool) -> WindowBuilder
Sets whether the window will be initially hidden or visible.
fn with_transparency(self, transparent: bool) -> WindowBuilder
Sets whether the background of the window should be transparent.
fn with_decorations(self, decorations: bool) -> WindowBuilder
Sets whether the window should have a border, a title bar, etc.
fn with_multitouch(self) -> WindowBuilder
Enables multitouch
fn with_window_resize_callback(self, cb: fn(_: u32, _: u32)) -> WindowBuilder
Provides a resize callback that is called by Mac (and potentially other operating systems) during resize operations. This can be used to repaint during window resizing.
fn build(self) -> 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.
fn build_strict(self) -> Result<Window, CreationError>
Builds the window.
The context is build in a strict way. That means that if the backend couldn't give
you what you requested, an Err
will be returned.
Trait Implementations
impl WindowBuilderExt for WindowBuilder
[src]
fn with_x11_visual<T>(self, visual_infos: *const T) -> WindowBuilder
fn with_x11_screen(self, screen_id: i32) -> WindowBuilder
impl Clone for WindowBuilder
[src]
fn clone(&self) -> WindowBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more