commit dd2c93f86c6fb18a983570c60012a503d1aa539a
Author: Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Thu Sep 17 18:30:10 2015 +0200
Commit: Fabian Greffrath <fabian@greffrath.com>
CommitDate: Thu Sep 17 18:30:10 2015 +0200
Video: In fullscreen mode, use desktop dimensions to calculate texture size
We do not change the video mode to run fullscreen but scale to fill
the desktop that "screen" is assigned to. So, use desktop dimensions
to calculate the size of the upscaled texture.
---
src/i_video.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/i_video.c b/src/i_video.c
index 45ed61f9..73447780 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1835,6 +1835,22 @@ static void SetVideoMode(screen_mode_t *mode, int w, int h)
w, h, SDL_GetError());
}
+ // If we are running fullscreen, the whole screen is our "window".
+
+ if (fullscreen)
+ {
+ SDL_DisplayMode mode;
+
+ // We do not change the video mode to run fullscreen but scale to fill
+ // the desktop that "screen" is assigned to. So, use desktop dimensions
+ // to calculate the size of the upscaled texture.
+
+ SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(screen), &mode);
+
+ h = mode.h;
+ w = mode.w;
+ }
+
// The SDL_RENDERER_TARGETTEXTURE flag is required to render the
// intermediate texture into the upscaled texture.