Skip to content

Commit

Permalink
Store last fullscreen and HiDPI settings to registry and apply on sta…
Browse files Browse the repository at this point in the history
…rtup
  • Loading branch information
shinyquagsire23 committed Sep 7, 2022
1 parent 28838a9 commit 04b3c71
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Win95/Window.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Platform/stdControl.h"
#include "stdPlatform.h"
#include "Win95/DebugConsole.h"
#include "Platform/wuRegistry.h"

#include "jk.h"

Expand All @@ -34,6 +35,8 @@ void Window_SetHiDpi(int val)

Window_needsRecreate = 1;
}

wuRegistry_SaveBool("Window_isHiDpi", Window_isHiDpi);
}

void Window_SetFullscreen(int val)
Expand All @@ -43,6 +46,9 @@ void Window_SetFullscreen(int val)
Window_isFullscreen = val;
Window_needsRecreate = 1;
}

wuRegistry_SaveBool("Window_isFullscreen", Window_isFullscreen);

}

//static wm_handler Window_ext_handlers[16] = {0};
Expand Down Expand Up @@ -1161,8 +1167,8 @@ int Window_Main_Linux(int argc, char** argv)

#endif

Window_RecreateSDL2Window();

Window_RecreateSDL2Window();
glewInit();

//SDL_RenderClear(displayRenderer);
Expand All @@ -1186,6 +1192,12 @@ int Window_Main_Linux(int argc, char** argv)

result = Main_Startup(cmdLine);

int fullscreen = wuRegistry_GetBool("Window_isFullscreen", 0);
int hidpi = wuRegistry_GetBool("Window_isHiDpi", 0);
Window_SetFullscreen(fullscreen);
Window_SetHiDpi(hidpi);
Window_RecreateSDL2Window();

if (!result) return result;

if (Main_bHeadless)
Expand Down

0 comments on commit 04b3c71

Please sign in to comment.