Jump to content
  • Advertisement
Sign in to follow this  
Shnoutz

DirectX 11 another fullscreen problem thread.

This topic is 2549 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a small DirectX 11 application and I am having issues with setting up the fullscreen/window mode switching.

My first problem is that my application does not catch the WM_SIZE message when I do Alt+Enter (am I missing a flag somewhere?)... I noticed that if I start my application in window mode, resize the client window manually and then press Alt+Enter, it will catch a WM_SIZE message otherwise it doesn't.


I get the annoying when it doesn't catch WM_SIZE (thus not calling ResizeBuffers):
"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 = { 1024, 768, { 0, 0 }, R8G8B8A8_UNORM, 0, 0 }; DXGI_SWAP_CHAIN_DESC::SampleDesc = { 4, 0 }; DXGI_SWAP_CHAIN_DESC::Flags = 0x2"

The second problem I have is I get a bunch of :

"First-chance exception at 0x7665b9bc in Test.exe: Microsoft C++ exception: _com_error at memory location 0x0045f4a8.."
When switching modes.

Can anyone help?

I can post some code if needed.

Share this post


Link to post
Share on other sites
Advertisement
An easier way can be to not handle WM_SIZE, and instead handle any required resize the first thing you do in your main loop.
Use GetClientRect to get the window size, get the back-buffer size using GetDesc from the D3D11 back-buffer, and use GetFullscreenState on your swap-chain to see if the fullscreen mode has changed. If either the sizes don't match or the fullscreen state is not what it was the previous frame, call ResizeBuffers.

Share this post


Link to post
Share on other sites

An easier way can be to not handle WM_SIZE, and instead handle any required resize the first thing you do in your main loop.
Use GetClientRect to get the window size, get the back-buffer size using GetDesc from the D3D11 back-buffer, and use GetFullscreenState on your swap-chain to see if the fullscreen mode has changed. If either the sizes don't match or the fullscreen state is not what it was the previous frame, call ResizeBuffers.


It works, thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!