I have been trying to figure out how to change the output of my swap chain. I tried recreating my swap chain, but I am getting an error from my IDXGIFactory2:
DXGI ERROR: IDXGIFactory::CreateSwapChain: Only one flip model swap chain can be associate with an HWND, IWindow, or composition surface at a time. ClearState() and Flush() may need to be called on the D3D11 device context to trigger deferred destruction of old swapchains. [ MISCELLANEOUS ERROR #297: ]
This is very weird because this is a D3D11 error! I don't have a device context! I can call ClearState()
but I can't call Flush()
! I tried calling ClearState()
but it didn't do anything.
So, I assume I must delete my swap chain and recreate it to change my output, but how do I do that? So far I am just calling ComPtr<IDXGISwapChain3>::Reset()
and then IDXGIFactory2::CreateSwapChainForHwnd()
.