don't recreate window when switching fullscreen mode at runtime

This commit is contained in:
2024-03-12 21:03:15 +11:00
parent 70817e6e6d
commit 4f1a3b0547

View File

@@ -600,14 +600,9 @@ int main(int argc, char *argv[])
if (keys[SDL_SCANCODE_F1]) // Is F1 Being Pressed?
{
keys[SDL_SCANCODE_F1] = false; // If So Make Key FALSE
FreeResources();
KillGLWindow(); // Kill Our Current Window
fullscreen = !fullscreen; // Toggle Fullscreen / Windowed Mode
// Recreate Our OpenGL Window
if (!CreateGLWindow("Lionel Brits & NeHe's 3D World Tutorial", 640, 480, 16, fullscreen))
{
return 0; // Quit If Window Was Not Created
}
// Toggle Fullscreen / Windowed Mode
fullscreen = !fullscreen;
SDL_SetWindowFullscreen(win, fullscreen);
}
}