Handle window close cleanly and show exit popup selection

This commit is contained in:
2025-11-22 11:43:20 +01:00
parent a257c5cd79
commit 838b5b1836
6 changed files with 39 additions and 15 deletions

View File

@ -700,7 +700,7 @@ int main(int, char **)
SDL_Event e;
while (SDL_PollEvent(&e))
{
if (e.type == SDL_EVENT_QUIT)
if (e.type == SDL_EVENT_QUIT || e.type == SDL_EVENT_WINDOW_CLOSE_REQUESTED)
running = false;
else {
// Route event to state manager handlers for per-state logic