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

Started by
2 comments, last by TheUnbeliever 12 years, 6 months ago
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!
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).
[TheUnbeliever]
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;
Oops, sorry. That's right: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphicsdevicemanager.synchronizewithverticalretrace.aspx
[TheUnbeliever]

This topic is closed to new replies.

Advertisement