From 40a2b31e9041a476b86d2794c74f7258c0653bd7 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 28 Jul 2022 16:06:37 -0700 Subject: [PATCH] add StartMaximized flag to WindowCreateInfo --- src/Window.cs | 7 ++++++- src/WindowCreateInfo.cs | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Window.cs b/src/Window.cs index 7108d217..c5176e5f 100644 --- a/src/Window.cs +++ b/src/Window.cs @@ -1,4 +1,4 @@ -using System; +using System; using SDL2; namespace MoonWorks @@ -30,6 +30,11 @@ namespace MoonWorks windowFlags |= SDL.SDL_WindowFlags.SDL_WINDOW_RESIZABLE; } + if (windowCreateInfo.StartMaximized) + { + windowFlags |= SDL.SDL_WindowFlags.SDL_WINDOW_MAXIMIZED; + } + ScreenMode = windowCreateInfo.ScreenMode; Handle = SDL.SDL_CreateWindow( diff --git a/src/WindowCreateInfo.cs b/src/WindowCreateInfo.cs index 78b5a75d..a4aed7e4 100644 --- a/src/WindowCreateInfo.cs +++ b/src/WindowCreateInfo.cs @@ -7,19 +7,22 @@ public uint WindowHeight; public ScreenMode ScreenMode; public bool SystemResizable; + public bool StartMaximized; public WindowCreateInfo( string windowTitle, uint windowWidth, uint windowHeight, ScreenMode screenMode, - bool systemResizable = false + bool systemResizable = false, + bool startMaximized = false ) { WindowTitle = windowTitle; WindowWidth = windowWidth; WindowHeight = windowHeight; ScreenMode = screenMode; SystemResizable = systemResizable; + StartMaximized = startMaximized; } } }