diff --git a/src/Game.cs b/src/Game.cs index c2713a5e..76d11a4b 100644 --- a/src/Game.cs +++ b/src/Game.cs @@ -79,7 +79,8 @@ namespace MoonWorks { while (accumulator >= timestep) { - SDL.SDL_PumpEvents(); + HandleSDLEvents(); + Input.Update(); Update(timestep); @@ -95,6 +96,19 @@ namespace MoonWorks } } + private void HandleSDLEvents() + { + while (SDL.SDL_PollEvent(out var _event) == 1) + { + switch (_event.type) + { + case SDL.SDL_EventType.SDL_QUIT: + quit = true; + break; + } + } + } + protected abstract void Update(double dt); protected abstract void Draw();