crash: start in fullscreen, change to a window, close the game.
This is sort of trial-and-error: there seems to be no documentation about
the proper order of shutting down a window. Shutting down D3D first
makes sense: restore the window to normal, then destroy it, so we don't
kill the window while D3D is still using it. But this seems to work, and
it's how we did it in 3.9.
(I think releasing D3D first is leaving traces behind in the window, which
then cause stale dereferences; the previous FreeLibrary() change was for
the same problem, and this seems to just be another incarnation of that.)
7c918fea: ntdll!RtlpWaitForCriticalSection [7c900000+18f8f+5b]
77d48bd9: USER32!GetWindowThreadProcessId [77d40000+8a80+159]
77d4b3cc: USER32!DefWindowProcW [77d40000+b33c+90]
7c90104b: ntdll!RtlEnterCriticalSection [7c900000+1005+46]
6d9ab228: D3D8!CheckFullscreen [6d9a0000+b060+1c8]
77d48734: USER32!GetDC [77d40000+86c7+6d]
77d4b4c0: USER32!DefWindowProcW [77d40000+b33c+184]
7c90eae3: ntdll!KiUserCallbackDispatcher [7c900000+ead0+13]
77d4daf6: USER32!DestroyWindow [77d40000+daea+c]
00539971: void GraphicsWindow::DestroyGraphicsWindow(void) [00400000+1398d1+a0]
(This should probably be used for more than this; this stuff needs a
cleanup ...)
(test case: pick a song with a stop near the beginning of the sample music,
eg. Fly With Me; no matter what the offset is set to, it should always show
the same pause on beat effects. This could do so while honoring the offset,
but getting that right in GameSoundManager is very tricky, and it's usually
not important for non-gameplay cosmetics.)
we're doing this partially in EndFrame (in FrameLimitBeforeVsync and/or the
actual vblank wait), and partially in RunGameLoop. These serve the same
purpose, so merge them.
(The renderer itself should have more control over this, but this is an
improvement.)