Original Post
I've spent the last couple weeks just trying to modify an SDK sample so that I can switch between windowed mode, fullscreen windowed mode, and fullscreen exclusive mode. (By fullscreen windowed mode, I mean a window that takes up the whole screen, but has no title bar or borders).
Right now my app starts up in fullscreen windowed mode, and I'm having trouble switching to fullscreen exclusive mode. My app appears to function correctly as far as a user would be able to tell, but I get a message in my VS debug output saying:
[indent=1]DXGI Warning: IDXGISwapChain::Present: Fullscreen presentation inefficiencies incurred due to application not using IDXGISwapChain::ResizeBuffers appropriately, specifying a DXGI_MODE_DESC not available in IDXGIOutput::GetDisplayModeList, or not using DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH. DXGI_SWAP_CHAIN_DESC::BufferDesc = { 1366, 768, { 69300000, 1155208 }, R8G8B8A8_UNORM, 0, 0 }; DXGI_SWAP_CHAIN_DESC::SampleDesc = { 1, 0 }; DXGI_SWAP_CHAIN_DESC::Flags = 0x2;
I just can't figure out what DX doesn't like about my code.
When the user presses 'F', I switch to fullscreen exclusive mode by doing the following:
- call g_pSwapChain->ResizeTarget
- call g_pSwapChain->SetFullscreenState
When I get a WM_SIZE message, I do the following:
- Release the RenderTargetView
- Release the DepthStencil
- Release the DepthStencilView
- Release the front buffer (my only buffer)
- call SwapChain->ResizeBuffers
- create the RenderTargetView with a NULL D3D11_RENDER_TARGET_VIEW_DESC
- create the depth stencil and depth stencil view
- call g_pImmediateContext->OMSetRenderTargets
I am definitely using DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH. Also, the DXGI_MODE_DESC that I'm using is one that I get from IDXGIOutput::FindClosestMatchingMode.
Am I missing something here?
I want to get this display mode stuff out of the way so I can actually start making a game!