Sign in to follow this  

ChangeDisplaySettings causing threads to dead lock

This topic is 1871 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 [b]different[/b] 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
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
[quote name='mhagain' timestamp='1354467719' post='5006310']
I expect that you're changing the mode from a different thread to the one used for creating the window and Device.
[/quote]

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

This topic is 1871 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this