Jump to content
  • Advertisement
Sign in to follow this  
Alundra

VSync dynamic on/off, Window from handle

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

Hi,

I have two questions on the same topic who is the render window.

The first question is about the VSync, you set it in DXGI_SWAP_CHAIN_DESC :

sd.BufferDesc.RefreshRate.Numerator = 60;
sd.BufferDesc.RefreshRate.Denominator = 1;

Set like that, the DXGI_SWAP_CHAIN_DESC is set for VSync on for 60hz.

sd.BufferDesc.RefreshRate.Numerator = 0;
sd.BufferDesc.RefreshRate.Denominator = 1;

Set like that, the DXGI_SWAP_CHAIN_DESC is set for VSync off.

In the end of rendering :

if( VSync )
  SwapChain->Present( 1, 0 );
else
  SwapChain->Present( 0, 0 );

Is it possible to switch VSync ON/OFF dynamicly ?

What I mean is about in a GUI have a checkbox to set ON/OFF the VSync.

 

My second question is about create a window from handle.

Using the DXGI_SWAP_CHAIN_DESC, you need to set Windowed param (true of false).

How set this param from a HWND not created manually ?

 

Thanks

Edited by Alundra

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!