diff options
-rw-r--r-- | core/src/window/settings.rs | 8 | ||||
-rw-r--r-- | winit/src/conversion.rs | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/src/window/settings.rs b/core/src/window/settings.rs index c1f36a6c..9432eaaa 100644 --- a/core/src/window/settings.rs +++ b/core/src/window/settings.rs @@ -35,6 +35,12 @@ pub struct Settings { /// The initial logical dimensions of the window. pub size: Size, + /// Whether the window should start maximized. + pub maximized: bool, + + /// Whether the window should start fullscreen. + pub fullscreen: bool, + /// The initial position of the window. pub position: Position, @@ -80,6 +86,8 @@ impl Default for Settings { fn default() -> Self { Self { size: Size::new(1024.0, 768.0), + maximized: false, + fullscreen: false, position: Position::default(), min_size: None, max_size: None, diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 8e6f7aae..01c6abc8 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -23,6 +23,12 @@ pub fn window_attributes( width: settings.size.width, height: settings.size.height, }) + .with_maximized(settings.maximized) + .with_fullscreen( + settings + .fullscreen + .then_some(winit::window::Fullscreen::Borderless(None)), + ) .with_resizable(settings.resizable) .with_enabled_buttons(if settings.resizable { winit::window::WindowButtons::all() |