mirror of https://github.com/snes9xgit/snes9x.git
win32: Flush message queue between driver changes.
This commit is contained in:
parent
d8584b9d94
commit
1d0dab45da
|
@ -147,7 +147,11 @@ void COpenGL::DeInitialize()
|
|||
wglDeleteContext(hRC);
|
||||
hRC = NULL;
|
||||
}
|
||||
if (hDC)
|
||||
{
|
||||
ReleaseDC(hWnd, hDC);
|
||||
hDC = NULL;
|
||||
}
|
||||
hWnd = NULL;
|
||||
afterRenderWidth = 0;
|
||||
afterRenderHeight = 0;
|
||||
|
|
|
@ -98,6 +98,15 @@ void WinChangeWindowSize(unsigned int newWidth, unsigned int newHeight)
|
|||
S9xDisplayOutput->ChangeRenderSize(newWidth,newHeight);
|
||||
}
|
||||
|
||||
static void FlushMessageQueue()
|
||||
{
|
||||
for (MSG msg; PeekMessage(&msg, GUI.hWnd, 0, 0, PM_NOREMOVE);)
|
||||
{
|
||||
GetMessage(&msg, GUI.hWnd, 0, 0);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
/* WinDisplayReset
|
||||
initializes the currently selected display output and
|
||||
reinitializes the core graphics rendering
|
||||
|
@ -107,8 +116,7 @@ returns true if successful, false otherwise
|
|||
bool WinDisplayReset(void)
|
||||
{
|
||||
S9xDisplayOutput->DeInitialize();
|
||||
if (S9xDisplayOutput == (IS9xDisplayOutput *)&VulkanDriver && GUI.outputMethod == OPENGL)
|
||||
Sleep(500);
|
||||
FlushMessageQueue();
|
||||
|
||||
switch(GUI.outputMethod) {
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue