Skip to main content
GameDev.net gamedev.net
🔒 Locked

setting fullscreen exclusive mode

Started by codeToad May 20, 2012 at 5:46 AM 0 replies 2.9k views
Original Post
codeToad
codeToad
sad.png

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:

  1. call g_pSwapChain->ResizeTarget
  2. call g_pSwapChain->SetFullscreenState

When I get a WM_SIZE message, I do the following:

  1. Release the RenderTargetView
  2. Release the DepthStencil
  3. Release the DepthStencilView
  4. Release the front buffer (my only buffer)
  5. call SwapChain->ResizeBuffers
  6. create the RenderTargetView with a NULL D3D11_RENDER_TARGET_VIEW_DESC
  7. create the depth stencil and depth stencil view
  8. 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?huh.png

I want to get this display mode stuff out of the way so I can actually start making a game!
codeToad
codeToad
Alright!!! I got fullscreen exclusive mode working without that warning in the debug output. I did three things:

  1. when creating my device and swapchain, I changed my DXGI_SWAP_CHAIN_DESC's BufferCount from 1 to 2. (I assumed the "inefficiency" DX was complaining about had to do with performing a blit instead of a flip. Well, how can it perform a flip when I only had 1 buffer???)
  2. I changed my DXGI_SWAP_CHAIN_DESC's SwapEffect to DXGI_SWAP_EFFECT_SEQUENTIAL.
  3. When creating my DXGI_SWAP_CHAIN_DESC variable, I was setting BufferDesc.RefreshRate to an enumerated refresh rate value from the primary monitor. Some how it dawned on my that DX may be trying to reuse this refresh rate when I moved my app to my 2nd monitor. So now I just call ZeroMemory on the refresh rate here.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.