SDL_PollEvent freezes on alt-tab |
lemmn
|
I am using Windows 10 and visual studio 2015, and SDL 2.0.4.
I believe this is a minimal repro case.. I had to cut out a lot of code to get down to this, so I'm sorry if there is extra code here. This program just draws a square on the screen and then should quit when you press the space bar. Repro steps: - run the program - press alt-tab while the game is running - notice the game program locking up The bug happens when I hit alt-tab. If I do that, then the game becomes locked up at the call to PeekMessage() inside of WIN_PumpEvents(), with this callstack if I break:
And the render thread is running happily. This bug only happens in full screen. If I remove this code: flags |= SDL_WINDOW_FULLSCREEN; then the game runs fine, and I do not get any freeze on using alt-tab. I have a feeling that the render thread might be the problem, but I must be able to render in a separate thread for this game. I followed this guide and everything seems to be working fine, apart from this freeze https://github.com/vheuken/SDL-Render-Thread-Example/blob/master/main.cpp
|
|||||||||||||||
|
lemmn
|
Ok, I would like to fix a few more things but I can't edit and I don't want to post the same thing over and over.
|
|||||||||||
|
lemmn
|
Ok, I would like to fix a few more things but I can't edit and I don't want to post the same thing over and over.
|
|||||||||||
|
lemmn
|
I notice I also have problems with resizing the window. The program crashes. Am I trying to do something that isn't possible???
This game's main loop where I process input needs to spin extremely fast! Because i need sub-millisecond accuracy on input handling. I need to get those events as fast as possible. So, my rendering cannot happen in the loop where I handle input. I need to be able to either render or handle input in a separate thread. Is either thing possible? |
|||||||||||
|