Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
set minimum window size
Browse files Browse the repository at this point in the history
to prevent the window from shrinking when changing video modes.
  • Loading branch information
fabiangreffrath committed Jan 7, 2021
1 parent 27038bb commit 24e10c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prboom2/src/SDL/i_video.c
Expand Up @@ -1249,9 +1249,15 @@ void I_UpdateVideoMode(void)

if ((SCREENWIDTH == 320 && SCREENHEIGHT == 200) ||
(SCREENWIDTH == 640 && SCREENHEIGHT == 400))
{
SDL_SetWindowMinimumSize(sdl_window, REAL_SCREENWIDTH, 6*REAL_SCREENHEIGHT/5);
SDL_RenderSetLogicalSize(sdl_renderer, REAL_SCREENWIDTH, 6*REAL_SCREENHEIGHT/5);
}
else
{
SDL_SetWindowMinimumSize(sdl_window, REAL_SCREENWIDTH, REAL_SCREENHEIGHT);
SDL_RenderSetLogicalSize(sdl_renderer, REAL_SCREENWIDTH, REAL_SCREENHEIGHT);
}

screen = SDL_CreateRGBSurface(0, SCREENWIDTH, SCREENHEIGHT, V_GetNumPixelBits(), 0, 0, 0, 0);
buffer = SDL_CreateRGBSurface(0, REAL_SCREENWIDTH, REAL_SCREENHEIGHT, 32, 0, 0, 0, 0);
Expand Down

0 comments on commit 24e10c7

Please sign in to comment.