Multithreaded game fails on SwapBuffers in render thread at exit

Posted by user782220 on Game Development See other posts from Game Development or by user782220
Published on 2012-07-20T06:54:05Z Indexed on 2012/10/05 21:56 UTC
Read the original article Hit count: 165

Filed under:
|
|
|

The render loop and windows message loop run on separate threads. The way the program exits is that after PostQuitMessage is called in WM_DESTROY the message loop thread signals the render loop thread to exit. As far as I can tell before the render loop thread can even process the signal it tries SwapBuffers and that fails.

My question, is there something about how Windows processes WM_DESTROY and WM_QUIT, in maybe DefWindowProc that causes various objects associated with rendering to go away even though I haven't explicitly deleted anything? And that would explain why the rendering thread is making bad calls at exit?

© Game Development or respective owner

Related posts about opengl

Related posts about Windows