Framerate decoupling

I'm trying to decouple the framerate from Update() so i can have more than 60 FPS.

I saw this post with

private void graphics_ModifyDevice(object sender, ModifyDeviceEventArgs e)
{
e.GraphicsDeviceInformation.PresentationParameters[0].PresentationInterval = PresentInterval.Immediate;
}

but couldnt get that to work... any help/ideas
I know I'll have to use the ElapsedRealTime in my FPS code but not sure where to put it at.



Answer this question

Framerate decoupling

  • Slugger25

    Well, if you take out all that code, then the Update method will be called in sync with the refresh rate of your monitor :)

  • SKK*

    Try this. I don't have a good test case to prove its working, but with my limited testing, it seems to do what you are looking for.

    First, Add a handler to handle the PreparingDeviceSettings event of your graphics object.

            graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);

    In the PreparingDeviceSettings event, set the PresentationInterval to Immediate.

            void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
            {
                e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.Immediate;
            }


  • Tigers21

    Rick Mogstad wrote:
    Well, if you take out all that code, then the Update method will be called in sync with the refresh rate of your monitor :)


    yes, but in effect limiting the FPS to 60 again which would defeat the purpose!


  • Eugene S.B.

    What would you prefer the limit be Many games will limit you to 60, without really any issue.

  • markgrif

    A good way to slow it down is to tie it to your refresh rate

  • SQLIdiot

    yeah, great idea because it'd basically be the same as doing it in Update() like Ive been trying to do (for the past 20 minutes).
    How would you go about doing this I'm new to directX and c# (i know c++ and used opengl every now and then)


  • Noorul Ahmed

    Thats great thanks - been looking for a good way as I'm running Vista with default ATI drivers which don't allow you any customization of settings at all!

  • gougliak

    yeah, that worked.... now to slow down the counter!
    cause its updating around 10,000 times a second (no models or anything yet, want to get my test base perfect first)

    thanks man


  • Framerate decoupling