aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/ShiftOS.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Frontend/ShiftOS.cs')
-rw-r--r--ShiftOS.Frontend/ShiftOS.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/ShiftOS.Frontend/ShiftOS.cs b/ShiftOS.Frontend/ShiftOS.cs
index 9ad83da..1ab0ad1 100644
--- a/ShiftOS.Frontend/ShiftOS.cs
+++ b/ShiftOS.Frontend/ShiftOS.cs
@@ -98,6 +98,8 @@ namespace ShiftOS.Frontend
}
+ private double timeSinceLastPurge = 0;
+
private Texture2D MouseTexture = null;
/// <summary>
@@ -214,6 +216,14 @@ namespace ShiftOS.Frontend
//Cause layout update on all elements
UIManager.LayoutUpdate();
+ timeSinceLastPurge += gameTime.ElapsedGameTime.TotalSeconds;
+
+ if(timeSinceLastPurge > 30)
+ {
+ GraphicsContext.StringCaches.Clear();
+ timeSinceLastPurge = 0;
+ }
+
base.Update(gameTime);
}
@@ -252,7 +262,7 @@ namespace ShiftOS.Frontend
{
var gfxContext = new GraphicsContext(GraphicsDevice.GraphicsDevice, spriteBatch, 0, 0, GraphicsDevice.PreferredBackBufferWidth, GraphicsDevice.PreferredBackBufferHeight);
var color = Color.White;
- double fps = 1 / gameTime.ElapsedGameTime.TotalSeconds;
+ double fps = Math.Round(1 / gameTime.ElapsedGameTime.TotalSeconds);
if (fps <= 20)
color = Color.Red;
gfxContext.DrawString($@"ShiftOS 1.0 Beta 4