From dfddc24d0e2d1315b09342ed9fd25908a1c4e59b Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 30 Sep 2022 13:02:51 -0700 Subject: [PATCH] add PresentMode to WindowCreateInfo --- src/Game.cs | 5 ++--- src/Graphics/RefreshEnums.cs | 11 +++++++---- src/Window.cs | 2 +- src/WindowCreateInfo.cs | 3 +++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Game.cs b/src/Game.cs index 2a37582..21026eb 100644 --- a/src/Game.cs +++ b/src/Game.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using SDL2; using MoonWorks.Audio; using MoonWorks.Graphics; @@ -37,7 +37,6 @@ namespace MoonWorks public Game( WindowCreateInfo windowCreateInfo, - PresentMode presentMode, FrameLimiterSettings frameLimiterSettings, int targetTimestep = 60, bool debugMode = false @@ -70,7 +69,7 @@ namespace MoonWorks MainWindow = new Window(windowCreateInfo, GraphicsDevice.WindowFlags); - if (!GraphicsDevice.ClaimWindow(MainWindow, presentMode)) + if (!GraphicsDevice.ClaimWindow(MainWindow, windowCreateInfo.PresentMode)) { throw new System.SystemException("Could not claim window!"); } diff --git a/src/Graphics/RefreshEnums.cs b/src/Graphics/RefreshEnums.cs index 1362a90..1c859c4 100644 --- a/src/Graphics/RefreshEnums.cs +++ b/src/Graphics/RefreshEnums.cs @@ -1,9 +1,6 @@ using System; -/* Recreate all the enums in here so we don't need to explicitly - * reference the RefreshCS namespace when using MoonWorks.Graphics - */ -namespace MoonWorks.Graphics +namespace MoonWorks { public enum PresentMode { @@ -12,7 +9,13 @@ namespace MoonWorks.Graphics FIFO, FIFORelaxed } +} +/* Recreate all the enums in here so we don't need to explicitly + * reference the RefreshCS namespace when using MoonWorks.Graphics + */ +namespace MoonWorks.Graphics +{ public enum PrimitiveType { PointList, diff --git a/src/Window.cs b/src/Window.cs index e1f1cdb..a890650 100644 --- a/src/Window.cs +++ b/src/Window.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using SDL2; diff --git a/src/WindowCreateInfo.cs b/src/WindowCreateInfo.cs index a4aed7e..e930593 100644 --- a/src/WindowCreateInfo.cs +++ b/src/WindowCreateInfo.cs @@ -6,6 +6,7 @@ public uint WindowWidth; public uint WindowHeight; public ScreenMode ScreenMode; + public PresentMode PresentMode; public bool SystemResizable; public bool StartMaximized; @@ -14,6 +15,7 @@ uint windowWidth, uint windowHeight, ScreenMode screenMode, + PresentMode presentMode, bool systemResizable = false, bool startMaximized = false ) { @@ -21,6 +23,7 @@ WindowWidth = windowWidth; WindowHeight = windowHeight; ScreenMode = screenMode; + PresentMode = presentMode; SystemResizable = systemResizable; StartMaximized = startMaximized; }