mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
27 lines
672 B
C#
27 lines
672 B
C#
using Microsoft.Xna.Framework;
|
|
|
|
namespace MonoGame.Extended
|
|
{
|
|
public class FramesPerSecondCounterComponent : DrawableGameComponent
|
|
{
|
|
private readonly FramesPerSecondCounter _fpsCounter;
|
|
|
|
public FramesPerSecondCounterComponent(Game game)
|
|
: base(game)
|
|
{
|
|
_fpsCounter = new FramesPerSecondCounter();
|
|
}
|
|
|
|
public int FramesPerSecond => _fpsCounter.FramesPerSecond;
|
|
|
|
public override void Update(GameTime gameTime)
|
|
{
|
|
_fpsCounter.Update(gameTime);
|
|
}
|
|
|
|
public override void Draw(GameTime gameTime)
|
|
{
|
|
_fpsCounter.Draw(gameTime);
|
|
}
|
|
}
|
|
} |