diff options
| author | RogueAI42 <[email protected]> | 2017-08-01 17:48:12 +1000 |
|---|---|---|
| committer | RogueAI42 <[email protected]> | 2017-08-01 17:48:12 +1000 |
| commit | 9cad19bf1a099cf2ca166f1151d406d7ebef4d2a (patch) | |
| tree | 171832029be05404a87bc428c21b612e9193b820 /ShiftOS.Frontend/ShiftOS.cs | |
| parent | aa3de1b749800a6f82f4b04d559af33e0f450610 (diff) | |
| parent | 6fd95f912823efc2901e7735df63e1aefa2ebb73 (diff) | |
| download | shiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.tar.gz shiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.tar.bz2 shiftos_thereturn-9cad19bf1a099cf2ca166f1151d406d7ebef4d2a.zip | |
Merge remote-tracking branch 'upstream/monogame' into monogame
Diffstat (limited to 'ShiftOS.Frontend/ShiftOS.cs')
| -rw-r--r-- | ShiftOS.Frontend/ShiftOS.cs | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/ShiftOS.Frontend/ShiftOS.cs b/ShiftOS.Frontend/ShiftOS.cs index 866f7f5..61a20fb 100644 --- a/ShiftOS.Frontend/ShiftOS.cs +++ b/ShiftOS.Frontend/ShiftOS.cs @@ -235,10 +235,11 @@ namespace ShiftOS.Frontend timeSinceLastPurge += gameTime.ElapsedGameTime.TotalSeconds; - if(timeSinceLastPurge > 30) + if(timeSinceLastPurge > 2) { GraphicsContext.StringCaches.Clear(); timeSinceLastPurge = 0; + GC.Collect(); } @@ -309,38 +310,21 @@ namespace ShiftOS.Frontend double fps = Math.Round(1 / gameTime.ElapsedGameTime.TotalSeconds); if (fps <= 20) color = Color.Red; - gfxContext.DrawString($@"ShiftOS 1.0 Beta 4 -Copyright (c) 2017 Michael VanOverbeek, Rylan Arbour, RogueAI, william341 -This is an unstable build. -FPS: {(fps)} -An FPS below 20 can cause glitches in keyboard and mouse handling. It is advised that if you are getting these -framerates, press CTRL+E to disable fancy effects, close any apps you are not using, and try running in windowed mode -or in a lower resolution. - -If all else fails, you can set a breakpoint somewhere in the ShiftOS.Update() or ShiftOS.Draw() methods in the game's source -code and use Visual Studio's debugger to step through the code to find bottlenecks. - -If a method takes more than 30 milliseconds to complete, that is a sign that it is bottlenecking the game and may need to be -optimized. - -Try using the SkinTextures cache when rendering skin elements, and try using the GraphicsContext.DrawString() method when drawing -text. In this build, we are aware that this method causes bottlenecking, we are working on a caching system for fonts so we do not need to -use the System.Drawing.Graphics class to draw text. - -UI render target count: {UIManager.TextureCaches.Count} -Skin texture caches: {UIManager.SkinTextures.Count} -Open windows (excluding dialog boxes): {AppearanceManager.OpenForms.Count} - -Experimental effects enabled: {UIManager.ExperimentalEffects} -Fullscreen: {UIManager.Fullscreen} -Game resolution: {graphicsDevice.PreferredBackBufferWidth}x{graphicsDevice.PreferredBackBufferHeight} - -Mouse state: -X: {LastMouseState.X} -Y: {LastMouseState.Y} -Last left click MS: {mouseMS} - -", 0, 0, color, new System.Drawing.Font("Lucida Console", 9F, System.Drawing.FontStyle.Bold)); + gfxContext.DrawString($@"ShiftOS +======================= + +Copyright (c) 2017 ShiftOS Developers + +Debug information - {fps} FPS + +CTRL+D: toggle debug menu +CTRL+E: toggle experimental effects (experimental effects enabled: {UIManager.ExperimentalEffects}) +Use the ""debug"" Terminal Command for engine debug commands. + +Red text means low framerate, a low framerate could be a sign of CPU hogging code or a memory leak. + + +Text cache: {GraphicsContext.StringCaches.Count}", 0, 0, color, new System.Drawing.Font("Lucida Console", 9F, System.Drawing.FontStyle.Bold)); } spriteBatch.End(); |
