Beispiel #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin(transformMatrix: _ecs.ScaleMatrix);
            _ecs.Render(gameTime.ElapsedGameTime.TotalSeconds);

            var deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            _frameCounter.Update(deltaTime);

            var fps = string.Format("FPS: {0}", _frameCounter.AverageFramesPerSecond);

            //spriteBatch.DrawString(_font, fps, new Vector2(1, 1), Color.Red);

            spriteBatch.End();

            base.Draw(gameTime);
        }