Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 kanato   Members   -  Reputation: 568

Like
0Likes
Like

Posted 14 November 2006 - 06:27 PM

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?

Sponsor:

#2 remigius   Members   -  Reputation: 1172

Like
0Likes
Like

Posted 14 November 2006 - 08:04 PM

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 :)

Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!

#3 jollyjeffers   Crossbones+   -  Reputation: 1542

Like
0Likes
Like

Posted 14 November 2006 - 11:11 PM

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
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS