• Advertisement
Sign in to follow this  

XNA 4.0, game constantly switching between 30 and 60 fps?

This topic is 2332 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here's a link to my source : http://dl.dropbox.com/u/40043006/Minecraft%202D%20Stuff/messingWith2DBlocksInconsistantFPS.zip

I don't understand why its doing this, but it keeps alternating back and forth between 30 and 60 FPS. It used to just do this every now and then for only a couple of seconds at a time, but as soon as I implemented some terrain it does it constantly now. I can't think of anything that would make it do it constantly, so if someone could help me out that would be great!

Share this post


Link to post
Share on other sites
Advertisement
Disable vsync: it's trying to sync frame updates with the monitor refresh rate to avoid tearing (where the monitor displays parts of more than one frame because the buffer was updated during the refresh). You want PresentationInterval.Immediate when you're creating your device (and, if that doesn't help, check your graphics card settings).

Share this post


Link to post
Share on other sites
Yep, it worked, thanks! Just to double check, the correct way to disable Vsync is with this line in the Initialize method right? graphics.SynchronizeWithVerticalRetrace = false;

Share this post


Link to post
Share on other sites
Oops, sorry. That's right: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphicsdevicemanager.synchronizewithverticalretrace.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement