Sign in to follow this  
Gotji

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

Recommended Posts

Gotji    100
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 ?

Share this post


Link to post
Share on other sites
Gotji    100
[quote name='EJH' timestamp='1310495000' post='4834425']
Do you have Game.IsFixedTimeStep = false?
[/quote]

Nope, FixedTimeStep and SynchronizeWithVerticalRetrace is enabled.

Share this post


Link to post
Share on other sites
EJH    315
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

Share this post


Link to post
Share on other sites
Gotji    100
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 again[img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img].

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this