For years our game launched with no problems. The window would open (blank white), turn black after a fraction of a second, and then the opening screen would display.
Since a Windows update earlier this year, the game will - seemingly at random - occasionally ‘stick’ on the blank white window, permanently. Even recreating the window makes no difference.
It reports no errors or GL errors (a couple of warnings from shader compilation that are there regardless of whether it works or not), and continues to run and render quite happily. You just can’t see anything.
I’ve single-stepped through the GLFW initialisation and there are no differences that I can find between a successful and unsuccessful launch. Everything’s initialised correctly, the window and wgl data is identical.
I’ve broken into and single-stepped through the screen swap and presentation - no errors, everything looks completely above board and identical to successful launches.
I’ve used ‘apitrace’ to capture successful and unsuccessful launches. The traces are identical.
I’ve used qapitrace to replay the (identical) traces. Both render perfectly most of the time, and both will, at random, sometimes result in a blank grey window instead, as though qapitrace is falling foul of the same bug.
I am, frankly, at a complete loss. Players are reporting this bug now and I don’t have a clue what to do to fix it.
Has anyone else encountered this?
EDIT: I’ve found a simplest repro case:
- Set up the various glfwWindowHints
- Call glfwCreateWindow
- Call glfwSwapBuffers
Most of the time, this leaves me looking at a black window (‘swap buffers’ has correctly presented the empty render buffer). If this happens, the game will then work just fine.
Sometimes, those three steps leave me looking at a white window. Swap buffers has done nothing. If this happens, the game will run okay but the window will remain blank and white no matter how often swapbuffers is called.