Friday, May 22, 2015

c++ - D3D/DXGI handle fullscreen transition


I have a D3D11 application, and I want to add proper fullscreen suport. Now I can let DXGI switch my window to fullscreen for me, and I'm under the impression that DXGI will take care of everything needed to make the swap chain flip front and backbuffer instead of blitting them.


However, letting DXGI perform the swich seems unreliable with a multi monitor setup - secondary screens stay entirely black after the switch a great deal of the time, with no apparent reason or pattern to it.


It can take a few times switching back and forth before I get the fullscreen window and the rest of the desktop being shown on the other screens.


Apparently I'm not alone with this, Battlefield 3 and WoW seem to have similar issues for a lot of people.


Now, the actual question: I guess since even those AAA game dev companies can't get this to work, my biggest hope would be to somehow perform the switch to fullscreen myself.


Is there anything I can do to elevate my window/swapchain into proper, buffer-flipping fullscreen mode?



Answer



To my knowledge, the onlything that works is:


 DwmEnableComposition(DWM_EC_DISABLECOMPOSITION);


at the start of your application and:


DwmEnableComposition(DWM_EC_ENABLECOMPOSITION);

before quitting. For the transitions, proceed as usual. I have tried InvalidateRect(NULL, NULL, true) just after switching to fullscreen to no avail. Hope this helps.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...