Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


setting fullscreen exclusive mode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 codeToad   Members   -  Reputation: 142

Like
0Likes
Like

Posted 19 May 2012 - 11:46 PM

Posted Image

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:

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?Posted Image

I want to get this display mode stuff out of the way so I can actually start making a game!

Sponsor:

#2 codeToad   Members   -  Reputation: 142

Like
0Likes
Like

Posted 20 May 2012 - 10:04 PM

Alright!!! I got fullscreen exclusive mode working without that warning in the debug output. I did three things:
  • 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???)
  • I changed my DXGI_SWAP_CHAIN_DESC's SwapEffect to DXGI_SWAP_EFFECT_SEQUENTIAL.
  • 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.

Edited by codeToad, 20 May 2012 - 10:21 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS