set display resolution when toggle exclusive fullscreen (#1061)

If the game is started in windowed mode, when switching to exclusive fullscreen
mode, the the size of the window is applied to renderer instead of the size of
fullscreen. Tested on Win10.
This commit is contained in:
Roman Fomin 2023-05-18 01:24:26 +07:00 committed by GitHub
parent cc058df7e0
commit 112fa537b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,6 +283,13 @@ void I_ToggleExclusiveFullScreen(void)
if (exclusive_fullscreen)
{
SDL_DisplayMode mode;
if (SDL_GetCurrentDisplayMode(video_display, &mode) != 0)
{
I_Error("Could not get display mode for video display #%d: %s",
video_display, SDL_GetError());
}
SDL_SetWindowSize(screen, mode.w, mode.h);
SDL_SetWindowFullscreen(screen, SDL_WINDOW_FULLSCREEN);
}
else