mirror of
https://github.com/ScrelliCopter/Lesson10-SDL3.git
synced 2025-02-21 07:19:26 +11:00
don't recreate window when switching fullscreen mode at runtime
This commit is contained in:
11
Lesson10.c
11
Lesson10.c
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user