public void Run() { this.Initialize(); this.Active = true; SDLMouse.ShowCursor(0); double t1 = Stopwatch.GetTimestamp(); //var evnt = new Event(); while (this.Active) { // Handle Timing double t2 = Stopwatch.GetTimestamp(); var elapsedTicks = t2 - t1; var elapsed = elapsedTicks / TimeSpan.TicksPerMillisecond; var elapsedS = elapsedTicks / TimeSpan.TicksPerSecond; t1 = t2; // Handle Keyboard Input _lastKeys = _keys; _keys = SDLKeyboard.GetKeyboardState().ToArray(); // Handle events - we only care about mouse clicks and movement while (SDLEvents.PollEvent2(out var evnt) != 0) { switch (evnt.Type) { case (uint)EventType.QUIT: break; case (uint)EventType.KEYDOWN: continue; default: Console.WriteLine($"Event: {evnt.Type}"); continue; } this.Active = false; break; } if (!this.OnUpdate(elapsedS)) { this.Active = false; } SDLVideo.SetWindowTitle(_window, $"Console Game Engine - FPS: {1.0 / elapsedS:F4}"); PresentFrame(); } SDLMouse.ShowCursor(1); }