diff --git a/src/Main.hs b/src/Main.hs index 69f373f..af117ba 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -68,7 +68,15 @@ pre = do quitGame :: KeyboardMessage -> Affection UserData () quitGame (MsgKeyboardEvent _ _ SDL.Pressed False sym) - | SDL.keysymKeycode sym == SDL.KeycodeEscape = quit + | SDL.keysymKeycode sym == SDL.KeycodeEscape = do + ad <- A.get + ud <- getAffection + SDL.glMakeCurrent (drawWindow ad) (glContext ad) + (ws, _) <- yieldSystemT (0, defStorage) (return ()) + putAffection ud + { worldState = ws + } + smLoad Load | otherwise = return () quitGame _ = return ()