ChangeDisplaySettings causing threads to dead lock

Started by
2 comments, last by howie_007 11 years, 4 months ago
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?
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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


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.
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.

This topic is closed to new replies.

Advertisement