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

source

pub fn new() -> WindowBuilder

Initializes a new WindowBuilder with default values.

source

pub fn with_dimensions(self, width: u32, height: u32) -> WindowBuilder

Requests the window to be of specific dimensions.

Width and height are in pixels.

source

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.

source

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.

source

pub fn with_title<T>(self, title: T) -> WindowBuilderwhere T: Into<String>,

Requests a specific title for the window.

source

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.

source

pub fn with_visibility(self, visible: bool) -> WindowBuilder

Sets whether the window will be initially hidden or visible.

source

pub fn with_transparency(self, transparent: bool) -> WindowBuilder

Sets whether the background of the window should be transparent.

source

pub fn with_decorations(self, decorations: bool) -> WindowBuilder

Sets whether the window should have a border, a title bar, etc.

source

pub fn with_multitouch(self) -> WindowBuilder

Enables multitouch

source

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

source§

fn clone(&self) -> WindowBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl WindowBuilderExt for WindowBuilder

source§

fn with_x11_visual<T>(self, visual_infos: *const T) -> WindowBuilder

source§

fn with_x11_screen(self, screen_id: i32) -> WindowBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.