From 111df04c0f7be740108cc3536eda3629572714d8 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 2 Mar 2022 14:46:55 -0800 Subject: [PATCH] fix some Window stuff --- src/Window.cs | 10 +++++++--- src/WindowCreateInfo.cs | 12 ++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Window.cs b/src/Window.cs index d66d23f..e408fe8 100644 --- a/src/Window.cs +++ b/src/Window.cs @@ -6,9 +6,9 @@ namespace MoonWorks public class Window : IDisposable { internal IntPtr Handle { get; } - public ScreenMode ScreenMode { get; } - public uint Width { get; } - public uint Height { get; } + public ScreenMode ScreenMode { get; private set; } + public uint Width { get; private set; } + public uint Height { get; private set; } private bool IsDisposed; @@ -53,6 +53,8 @@ namespace MoonWorks windowFlag = SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP; } + ScreenMode = screenMode; + SDL.SDL_SetWindowFullscreen(Handle, (uint) windowFlag); } @@ -65,6 +67,8 @@ namespace MoonWorks public void SetWindowSize(uint width, uint height) { SDL.SDL_SetWindowSize(Handle, (int) width, (int) height); + Width = width; + Height = height; } protected virtual void Dispose(bool disposing) diff --git a/src/WindowCreateInfo.cs b/src/WindowCreateInfo.cs index 1660f47..83713f3 100644 --- a/src/WindowCreateInfo.cs +++ b/src/WindowCreateInfo.cs @@ -6,5 +6,17 @@ public uint WindowWidth; public uint WindowHeight; public ScreenMode ScreenMode; + + public WindowCreateInfo( + string windowTitle, + uint windowWidth, + uint windowHeight, + ScreenMode screenMode + ) { + WindowTitle = windowTitle; + WindowWidth = windowWidth; + WindowHeight = windowHeight; + ScreenMode = screenMode; + } } }