Struct glutin::WindowBuilder [] [src]

pub struct WindowBuilder<'a> {
    pub window: WindowAttributes,
    pub opengl: GlAttributes<&'a Window>,
    // some fields omitted
}

Object that allows you to build windows.

Fields

window: WindowAttributes

The attributes to use to create the window.

opengl: GlAttributes<&'a Window>

The attributes to use to create the context.

Methods

impl<'a> WindowBuilder<'a>
[src]

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_min_dimensions(self, width: u32, height: u32) -> WindowBuilder<'a>

Sets a minimum dimension size for the window

Width and height are in pixels.

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

Sets a maximum dimension size for the window

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(self, request: GlRequest) -> WindowBuilder<'a>

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

fn with_gl_profile(self, profile: GlProfile) -> WindowBuilder<'a>

Sets the desired OpenGL context profile.

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_gl_robustness(self, robustness: Robustness) -> WindowBuilder<'a>

Sets the robustness of the OpenGL context. See the docs of Robustness.

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 with_srgb(self, srgb_enabled: Option<bool>) -> WindowBuilder<'a>

Sets whether sRGB should be enabled on the window. None means "I don't care".

fn with_transparency(self, transparent: bool) -> WindowBuilder<'a>

Sets whether the background of the window should be transparent.

fn with_decorations(self, decorations: bool) -> WindowBuilder<'a>

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

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

Enables multitouch

fn with_parent(self, parent: Option<WindowID>) -> WindowBuilder<'a>

Sets the parent window

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.