diff --git a/win32/win32_display.cpp b/win32/win32_display.cpp index 4c7bafc3..63d030b0 100644 --- a/win32/win32_display.cpp +++ b/win32/win32_display.cpp @@ -42,7 +42,7 @@ DWMFLUSHPROC DwmFlushProc = NULL; DWMISCOMPOSITIONENABLEDPROC DwmIsCompositionEnabledProc = NULL; // Interface used to access the display output -IS9xDisplayOutput* S9xDisplayOutput = NULL; +IS9xDisplayOutput *S9xDisplayOutput=&Direct3D; #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -95,8 +95,16 @@ void WinRefreshDisplay(void) void WinChangeWindowSize(unsigned int newWidth, unsigned int newHeight) { - if (S9xDisplayOutput) - S9xDisplayOutput->ChangeRenderSize(newWidth,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 @@ -107,9 +115,10 @@ returns true if successful, false otherwise */ bool WinDisplayReset(void) { - if (S9xDisplayOutput == NULL) - { - switch (GUI.outputMethod) { + S9xDisplayOutput->DeInitialize(); + FlushMessageQueue(); + + switch(GUI.outputMethod) { default: case DIRECT3D: S9xDisplayOutput = &Direct3D; @@ -125,10 +134,8 @@ bool WinDisplayReset(void) case VULKAN: S9xDisplayOutput = &VulkanDriver; break; - } } - S9xDisplayOutput->DeInitialize(); bool initialized = S9xDisplayOutput->Initialize(GUI.hWnd); if (!initialized) { diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index cc477d5a..745487c0 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -7783,9 +7783,14 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) OutputMethod newOut = (OutputMethod)SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_GETITEMDATA, index, 0); if(GUI.outputMethod==newOut) break; - + if(GUI.FullScreen) + ToggleFullScreen(); GUI.outputMethod=newOut; - MessageBox(hDlg, TEXT("Changes to graphics output method will take place when Snes9x is restarted."), TEXT("Snes9x Display"), MB_OK | MB_ICONINFORMATION); + + WinDisplayReset(); + UpdateModeComboBox(GetDlgItem(hDlg,IDC_RESOLUTION)); + WinRefreshDisplay(); + UpdateWindow(GUI.hWnd); } break; case IDC_SHADER_ENABLED: