Fullscreen arguments: only read on startup

This commit is contained in:
Louis Gombert
2025-03-10 23:16:35 +01:00
parent 5e5fdffd87
commit 5cff7af614
3 changed files with 23 additions and 14 deletions

View File

@@ -364,19 +364,6 @@ int opengl_Setup(oeApplication *app, const int *width, const int *height) {
}
}
int winArg = FindArgChar("-windowed", 'w');
int fsArg = FindArgChar("-fullscreen", 'f');
if ((fsArg) && (winArg)) {
LOG_FATAL.printf("ERROR: %s AND %s specified!", GameArgs[winArg], GameArgs[fsArg]);
return (0);
} else if (winArg) {
// Override default value from database
Game_fullscreen = false;
} else if (fsArg) {
Game_fullscreen = true;
}
if (!Already_loaded) {
char gl_library[256];
int arg;
@@ -1162,6 +1149,22 @@ void rend_SetFullScreen(bool fullscreen) {
}
}
bool rend_InitWindowMode() {
int winArg = FindArgChar("-windowed", 'w');
int fsArg = FindArgChar("-fullscreen", 'f');
if ((fsArg) && (winArg)) {
LOG_FATAL.printf("ERROR: %s AND %s specified!", GameArgs[winArg], GameArgs[fsArg]);
return false;
} else if (winArg) {
// Override default value from database
Game_fullscreen = false;
} else if (fsArg) {
Game_fullscreen = true;
}
return true;
}
// Resets the texture cache
void opengl_ResetCache() {
if (OpenGL_cache_initted) {