aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs')
-rw-r--r--src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs b/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs
index 199f723e..355dcf6c 100644
--- a/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs
+++ b/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs
@@ -151,8 +151,22 @@ namespace Ryujinx.Headless.SDL2.OpenGL
GL.Clear(ClearBufferMask.ColorBufferBit);
SwapBuffers();
- Renderer?.Window.SetSize(DefaultWidth, DefaultHeight);
- MouseDriver.SetClientSize(DefaultWidth, DefaultHeight);
+ if (IsFullscreen)
+ {
+ // NOTE: grabbing the main display's dimensions directly as OpenGL doesn't scale along like the VulkanWindow.
+ // we might have to amend this if people run this on a non-primary display set to a different resolution.
+ SDL_Rect displayBounds;
+ SDL_GetDisplayBounds(0, out displayBounds);
+
+ Renderer?.Window.SetSize(displayBounds.w, displayBounds.h);
+ MouseDriver.SetClientSize(displayBounds.w, displayBounds.h);
+ }
+
+ else
+ {
+ Renderer?.Window.SetSize(DefaultWidth, DefaultHeight);
+ MouseDriver.SetClientSize(DefaultWidth, DefaultHeight);
+ }
}
protected override void InitializeRenderer() { }