Struct sdl2::video::WindowBuilder
source · pub struct WindowBuilder { /* private fields */ }
Expand description
The type that allows you to build windows.
Implementations§
source§impl WindowBuilder
impl WindowBuilder
sourcepub fn new(
v: &VideoSubsystem,
title: &str,
width: u32,
height: u32,
) -> WindowBuilder
pub fn new( v: &VideoSubsystem, title: &str, width: u32, height: u32, ) -> WindowBuilder
Initializes a new WindowBuilder
.
sourcepub fn build(&self) -> Result<Window, WindowBuildError>
pub fn build(&self) -> Result<Window, WindowBuildError>
Builds the window.
sourcepub fn window_flags(&self) -> u32
pub fn window_flags(&self) -> u32
Gets the underlying window flags.
sourcepub fn set_window_flags(&mut self, flags: u32) -> &mut WindowBuilder
pub fn set_window_flags(&mut self, flags: u32) -> &mut WindowBuilder
Sets the underlying window flags. This will effectively undo any previous build operations, excluding window size and position.
sourcepub fn position(&mut self, x: i32, y: i32) -> &mut WindowBuilder
pub fn position(&mut self, x: i32, y: i32) -> &mut WindowBuilder
Sets the window position.
sourcepub fn position_centered(&mut self) -> &mut WindowBuilder
pub fn position_centered(&mut self) -> &mut WindowBuilder
Centers the window.
sourcepub fn fullscreen(&mut self) -> &mut WindowBuilder
pub fn fullscreen(&mut self) -> &mut WindowBuilder
Sets the window to fullscreen.
sourcepub fn fullscreen_desktop(&mut self) -> &mut WindowBuilder
pub fn fullscreen_desktop(&mut self) -> &mut WindowBuilder
Sets the window to fullscreen at the current desktop resolution.
sourcepub fn opengl(&mut self) -> &mut WindowBuilder
pub fn opengl(&mut self) -> &mut WindowBuilder
Sets the window to be usable with an OpenGL context
sourcepub fn vulkan(&mut self) -> &mut WindowBuilder
pub fn vulkan(&mut self) -> &mut WindowBuilder
Sets the window to be usable with a Vulkan instance
Hides the window.
sourcepub fn borderless(&mut self) -> &mut WindowBuilder
pub fn borderless(&mut self) -> &mut WindowBuilder
Removes the window decoration.
sourcepub fn resizable(&mut self) -> &mut WindowBuilder
pub fn resizable(&mut self) -> &mut WindowBuilder
Sets the window to be resizable.
sourcepub fn minimized(&mut self) -> &mut WindowBuilder
pub fn minimized(&mut self) -> &mut WindowBuilder
Minimizes the window.
sourcepub fn maximized(&mut self) -> &mut WindowBuilder
pub fn maximized(&mut self) -> &mut WindowBuilder
Maximizes the window.
sourcepub fn input_grabbed(&mut self) -> &mut WindowBuilder
pub fn input_grabbed(&mut self) -> &mut WindowBuilder
Sets the window to have grabbed input focus.
sourcepub fn allow_highdpi(&mut self) -> &mut WindowBuilder
pub fn allow_highdpi(&mut self) -> &mut WindowBuilder
Creates the window in high-DPI mode if supported (>= SDL 2.0.1)
sourcepub fn always_on_top(&mut self) -> &mut WindowBuilder
pub fn always_on_top(&mut self) -> &mut WindowBuilder
Window should always above others (>= SDL 2.0.5)
sourcepub fn metal_view(&mut self) -> &mut WindowBuilder
pub fn metal_view(&mut self) -> &mut WindowBuilder
Create a SDL_MetalView when constructing the window. This is required when using the raw_window_handle feature on MacOS. Has no effect no other platforms.
sourcepub fn set_shaped(&mut self) -> &mut WindowBuilder
pub fn set_shaped(&mut self) -> &mut WindowBuilder
Sets shaped state, to create via SDL_CreateShapedWindow instead of SDL_CreateWindow