Sharp performance drop!?

So I'm developing my game on my pc, and the framerate is steady at 75 fps as I'm adding stuff to it.

I take a break and play a game for awhile (on my pc), and when I get back, the fps is now 53! I've tried restarting my pc, but it's still 53! What the heck's going on

I don't think it's my code, because my laptop still gets 60fps like it always did, and it has crappier hardware than my pc. Please, can someone tell me what's going on

Update:

Okay, this is insane. I just tested it on my brother's computer, who has the same manufacturer of video card, and my program's down to 53fps on that machine, too. But then, I took a copy of my program that I had compiled yesterday, and it ran at 53fps too!

This isn't possible! That old copy of my program was never touched by my editor today, and it ran at 75fps yesterday. But now, both machines run it at 53fps... and my crappy laptop still outshines them both at 60fps... I'm not crazy, I was getting 75fps the whole time I was developing!! So what the heck's going on




Answer this question

Sharp performance drop!?

  • Firobo

    This happened to me a lot, the solution was to explicitly set the PresentationInterval  value of the present parameters you use to create the device from PresentInterval.Default (which is the default value if you don't set it) to either PresentInterval.One or PresentInterval.Immediate

     

    Assuming your Presentation Parameters are called presentParams...

    presentParams.PresentationInterval = PresentInterval.One;

    PresentInterval.One (which fixes the frame rate to be the screen refresh rate)

    PresentInterval.Immediate (if you want to render as fast as possible)

    I'm pretty certain this is the problem since the same thing that is happening to you happened to me. At seemingly random the framerate would just dip for no reason yet sometimes it was perfect.

    I personally always set present interval to be One. Since then, i've never had the problem and all my graphics render at a constant 60fps (my refresh rate).

    Hope this helps!


  • Trygve

    Sweet. Thanks a bundle, this is one of the first times that I've encountered a bug that was easy to fix!

  • Sharp performance drop!?