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(self, title: String) -> 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 build(self) -> Result<WindowCreationError>

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<WindowCreationError>

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]