Jump to content

  • Log In with Google      Sign In   
  • Create Account


ChangeDisplaySettings causing threads to dead lock


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
3 replies to this topic

#1 GameCodingNinja   Members   -  Reputation: 162

Like
0Likes
Like

Posted 02 December 2012 - 09:43 AM

I think my threads are becoming dead locked... this is what's happening.

I create a thread and a mutex to load assets in the startup game state while display a startup graphic. It all works great. No problems unless I change the resolution to full screen the game for a different resolution. Windowed mode or full screen of same resolution all works fine.

I call ChangeDisplaySettings before creating the game window and DirectX.

I'm not sure what to make of this and I tried some work arounds but it seems like the threads get stuck at WaitForSingleObject. At least that's what it seems like.

Any suggestions?

Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7822

Like
1Likes
Like

Posted 02 December 2012 - 11:01 AM

If you're using D3D there's no need to call ChangeDisplaySettings - the D3D API has calls available that will do this automatically for you (Reset or ResizeTarget/ResizeBuffers).

Despite that, and going from your mention of using multiple threads, I expect that you're changing the mode from a different thread to the one used for creating the window and Device.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 GameCodingNinja   Members   -  Reputation: 162

Like
0Likes
Like

Posted 02 December 2012 - 11:23 AM

I expect that you're changing the mode from a different thread to the one used for creating the window and Device.


I'm changing it from the main game thread. The thread I'm using to load assets is created at the time of load and released when finished. Thanks for the info. I'll look into Reset or ResizeTarget/ResizeBuffers.

#4 GameCodingNinja   Members   -  Reputation: 162

Like
0Likes
Like

Posted 02 December 2012 - 11:54 AM

Looks like I didn't really need ChangeDisplaySettings. DirectX automatically resizes the screen display based on the settings passed to CreateDevice. The question remains why my threads dead lock when the display is resized on startup.

Edited by GameCodingNinja, 02 December 2012 - 12:26 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