[XNA 4.0] FPS slightly drops after clicking\moving window.

Started by
3 comments, last by Gotji 12 years, 9 months ago
Today I've started new project in XNA and I needed custom timer for my game. For this purpose I've used Stopwatch class. Then I modify my performance measurement tools and now they use my timer instead of GameTime. After those modifications I've observed very strange behavior. When I'm starting my game FPS is around 60(with enabled fixed time step and vertical sync) so its fine but when I click on title bar or move game window FPS drops to ~56.35 and it stays on this level. FirstI thought that there is some problem with my implementation but I've tested FpsCounter used by one of the XNA Framework developers(he also uses Stopwatchfor time measurement) and the behavior was the same.



Does anyoneknow what is the reason of this behavior ?
Advertisement
Do you have Game.IsFixedTimeStep = false?

Do you have Game.IsFixedTimeStep = false?


Nope, FixedTimeStep and SynchronizeWithVerticalRetrace is enabled.
Since you are using your own timer then turn Game.IsFixedTimeStep off. The XNA fixed time step with Vsync on will drop frames. There's a ton of threads about it:

http://forums.create.msdn.com/forums/t/23775.aspx
Thank you very much. Topic pointed by you and others mentioned in it are great. I was googling before posting here but i couldn't find anything. Now I can sleep well once againrolleyes.gif.

This topic is closed to new replies.

Advertisement