protected override void Update(GameTime gameTime) { DeltaTimeMilli = (float)gameTime.ElapsedGameTime.TotalMilliseconds; DeltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds; TotalTime = gameTime.TotalGameTime; counterElapsed += gameTime.ElapsedGameTime; PolyInput.Update(gameTime); if (PolyInput.Keyboard.Pressed(Microsoft.Xna.Framework.Input.Keys.P)) { debugInformation = !debugInformation; } if (ExitOnEscapeKeyPress == true && PolyInput.Keyboard.Pressed(Microsoft.Xna.Framework.Input.Keys.Escape)) { Exit(); return; } base.Update(gameTime); if (counterElapsed > TimeSpan.FromSeconds(1)) { counterElapsed -= TimeSpan.FromSeconds(1); FPS = frameCount; frameCount = 0; } }
protected override void Initialize() { base.Initialize(); Tracker.Initialize(); PolyInput.Initialize(); SpriteBatch = new SpriteBatch(GraphicsDevice); }
protected override void OnExiting(object sender, EventArgs args) { base.OnExiting(sender, args); PolyInput.ShutDown(); }