Struct glutin::WindowBuilder [-] [+] [src]

pub struct WindowBuilder<'a> {
    // some fields omitted
}

Object that allows you to build windows.

Methods

impl<'a> WindowBuilder<'a>

fn new() -> WindowBuilder<'a>

Initializes a new WindowBuilder with default values.

fn with_dimensions(self, width: u32, height: u32) -> WindowBuilder<'a>

Requests the window to be of specific dimensions.

Width and height are in pixels.

fn with_title(self, title: String) -> WindowBuilder<'a>

Requests a specific title for the window.

fn with_fullscreen(self, monitor: MonitorID) -> WindowBuilder<'a>

Requests fullscreen mode.

If you don't specify dimensions for the window, it will match the monitor's.

fn with_shared_lists(self, other: &'a Window) -> WindowBuilder<'a>

The created window will share all its OpenGL objects with the window in the parameter.

There are some exceptions, like FBOs or VAOs. See the OpenGL documentation.

fn with_gl_version(self, version: (u32, u32)) -> WindowBuilder<'a>

THIS FUNCTION IS DEPRECATED

fn with_gl(self, request: GlRequest) -> WindowBuilder<'a>

Sets how the backend should choose the OpenGL API and version.

fn with_gl_debug_flag(self, flag: bool) -> WindowBuilder<'a>

Sets the debug flag for the OpenGL context.

The default value for this flag is cfg!(debug_assertions), which means that it's enabled when you run cargo build and disabled when you run cargo build --release.

fn with_vsync(self) -> WindowBuilder<'a>

Requests that the window has vsync enabled.

fn with_visibility(self, visible: bool) -> WindowBuilder<'a>

Sets whether the window will be initially hidden or visible.

fn with_multisampling(self, samples: u16) -> WindowBuilder<'a>

Sets the multisampling level to request.

Panic

Will panic if samples is not a power of two.

fn with_depth_buffer(self, bits: u8) -> WindowBuilder<'a>

Sets the number of bits in the depth buffer.

fn with_stencil_buffer(self, bits: u8) -> WindowBuilder<'a>

Sets the number of bits in the stencil buffer.

fn with_pixel_format(self, color_bits: u8, alpha_bits: u8) -> WindowBuilder<'a>

Sets the number of bits in the color buffer.

fn with_stereoscopy(self) -> WindowBuilder<'a>

Request the backend to be stereoscopic.

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.