c# - XNA Lags when window has focus -


I am developing XNA game studin using XNA 3.1, and I have seen problems with some games, Despite where they handle many resources of interval systems, with an incomparable spare of the processor usage. When window is in focus from the game, the process # 1 (in the task manager) is used 100%, and this game shows minor interval signals (largely notable when repeated in the sound effects sequence). When the game window loses focus, it attracts real time and updates, but the use of the process decreases, and the gap disappears.

I tested it with different games, and the results remain the same, prove that I have nothing with code or code efficiency

Is this problem Is different from Xna 3.1, and it's okay for that? Or do I have to switch to 4.0 and hope that my game will not use anything that is not backward compatible?

The problem may be due to garbage collector every time the garbage collector runs, the frame rate is one or two It may be a drop-down for Windows, though it should not be a problem on Windows.

Add this code to your code and see how many heap memory has been created. Every time the price goes down, the garbage collector ends.

  SpriteBeach.Drint 64 (font, GC GateTall Memory (wrong) / 1000 / * kilobytes * /, new vector 2 (5, 30), color. White, 0f);   

SpriteBatch.DrawInt64 is a spritebatch extension that does not generate garbage at the int, blanket etc. You can optionally just use SpriteBatch.DrawString (..., (GC.GetTotalMemory (false) / 1000). Ostring (), ...)

SpriteBatchExceptionsCSS:

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -