Jump to content
  • Advertisement
Sign in to follow this  
howie_007

ChangeDisplaySettings causing threads to dead lock

This topic is 2119 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 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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

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!