Jump to content
  • Advertisement
Sign in to follow this  
kanato

[MDX] Turning VSync on/off without recreating swap chain?

This topic is 4239 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

Is there any way to turn VSync on and off without recreating the device or SwapChain? I tried this (after BeginScene/EndScene block):
 if (mDisplay.VSync == false)
                {
                    mSwap.PresentParameters.PresentationInterval = PresentInterval.Immediate;
                    mSwap.Present();
                }
                else
                {
                    mSwap.PresentParameters.PresentationInterval = PresentInterval.One;
                    mSwap.Present();
                }

And it seems that calling Present does not look at the SwapChain.PresentParameters structure. I can turn VSync on or off by creating the SwapChain with the Immediate or One flags, but I want to be able to change it without recreating the SwapChain. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
The PresentParameters property you're using is probably ignored and only available as readonly information. IIRC the proper way to do this is to call device.Reset with the updated parameters (and recreate various resources as usual). This may also implicitly recreate the swap chain though.

Hope this helps :)

Share this post


Link to post
Share on other sites
You'll need to reset your device in order to specify new presentation parameters.

Even then it is worth baring in mind that presentation parameter is often overuled by the device driver - look at your driver control panel and you'll probably see a "always off", "always on" and "application preference" configuration.

hth
Jack

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!