VSync dynamic on/off, Window from handle

Started by
-1 comments, last by Alundra 10 years, 12 months ago

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

This topic is closed to new replies.

Advertisement