views:

68

answers:

1

Hi, this is my question... There is a way to check when the application has gone fullscreen in DXGI (DX10/11). For going Fullscreen I mean that the system has COMPLETED the mode change. Cause i need it for my application to prevent deadlock and to adjust timing. (I have a multithreaded engine and the Present is not on the message pump thread causing deadlock on mode-change randomly)) Actually I make it wait 1 second continuing to process messages on the message pump thread and it work, but i want something more DETERMINISTIC that says to me "hey, the mode change is complete, you are now in fullscreen mode". :D

Any idea?

+1  A: 

Is there any reason you can't run the rendering and message pump threads as the same thread?

According to the docs there is nothing that tells you the change is complete.

Strangely, though, DXGI relies on getting responses back from internal SendMessage calls (which occur via the message pump in a multi-threaded environment). So I don't see how delaying your message pump fixes problems. All it will do is make DXGI wait an extra second before continuing to do its stuff. A dead-lock usually implies that you are doing something that causes the message pump to block waiting for the rendering thread to do something.

Goz
I can't run them on the same thread as i'm allowing the possibility for multiple engines and threads for each engine (one of them is the draw thread (btw, works fine on DX9 mode)).It seems that if I wait for the mode change to be complete DXGI doesn't go anymore in deadlock. (for wait, i'm still processing the messages and doing a fake present with the test flag active for a second or such)
feal87
I've in the meantime found another temporary solution to the problem.My task scheduler wait for all child thread to complete before continuing its work. The wait is done using WaitHandles and the call WaitAll(). I put a timeout of 1 sec on this call, if the call fail (1 sec is passed), it process all windows messages and then restart waiting. (this way everything works fine)
feal87