From 46a753bbee487bfdda2e31b989fe9b979ce473fa Mon Sep 17 00:00:00 2001 From: Manuel Alfayate Corchete Date: Sat, 15 Feb 2025 13:20:44 +0100 Subject: [PATCH] [SDL2] Add missing SDL_QUIT event management and small bracket correction. (#499) --- src/platform/sdl2/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/sdl2/main.cpp b/src/platform/sdl2/main.cpp index 06cf925..6e719ab 100644 --- a/src/platform/sdl2/main.cpp +++ b/src/platform/sdl2/main.cpp @@ -345,6 +345,9 @@ void inputUpdate() { while (SDL_PollEvent(&event) == 1) { // while there are still events to be processed switch (event.type) { + case SDL_QUIT: + Core::isQuit = true; + case SDL_KEYDOWN: { int scancode = event.key.keysym.scancode; InputKey key = codeToInputKey(scancode); @@ -417,6 +420,7 @@ void inputUpdate() { case SDL_CONTROLLERDEVICEREMOVED: { joyRemove(event.cdevice.which); break; + } // Joystick reading using the old SDL Joystick interface case SDL_JOYBUTTONDOWN: @@ -475,7 +479,6 @@ void inputUpdate() { } break; } - } } } }