My application has a internal graphics settings panel that lets the user to change the graphics settings that includes all three options mentioned in the title including V-sync and windowed/fullscreen switching. My approach (given that it'll go full-screen to full-screen) to implement such system follows:
- Release all back buffer references.
- Go to windowed mode from full-screen using
swapchain->SetFullscreenState(FALSE, NULL)
- perform
swapchain->Release();
- Prepare to recreate swapchain.
- Create new DXGI_SWAP_CHAIN_DESC from parameters collected from user settings panel
- perform
pFactory->CreateSwapChain(device, &swap_desc, &swapchain);
- Recreate the back buffer and views on success.
- Switch to full-screen using
swapchain->SetFullscreenState(TRUE, NULL);
Now, is it possible to just use the IDXGISwapChain::ResizeBuffers and IDXGISwapChain::ResizeTarget methods since those are dedicated for such tasks? Since those take Height, Width, DXGI_MODE_DESC it seems like it is possible to set new resolution and refresh rate using the the two above mentioned methods. Is there any risk here? And most importantly, I cannot find any way to update the swapchain's multisampling count and quality level without doing a fresh swapchain reset.