From 24cea1972cc2445c71eff851ba0e1e1d563b0d2d Mon Sep 17 00:00:00 2001 From: BearOso Date: Wed, 15 Mar 2023 15:54:43 -0500 Subject: [PATCH] win32: Don't allow Vulkan and OpenGL to be used in the same session. --- win32/win32_display.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/win32/win32_display.cpp b/win32/win32_display.cpp index 63d030b0..26a22c15 100644 --- a/win32/win32_display.cpp +++ b/win32/win32_display.cpp @@ -115,6 +115,8 @@ returns true if successful, false otherwise */ bool WinDisplayReset(void) { + static bool VulkanUsed = false; + static bool OpenGLUsed = false; S9xDisplayOutput->DeInitialize(); FlushMessageQueue(); @@ -129,10 +131,22 @@ bool WinDisplayReset(void) break; #endif case OPENGL: + if (VulkanUsed) + { + MessageBox(GUI.hWnd, TEXT("Changing to OpenGL requires a restart if you've already used Vulkan"), TEXT("Snes9x Display Driver"), MB_OK); + break; + } S9xDisplayOutput = &OpenGL; + OpenGLUsed = true; break; case VULKAN: + if (OpenGLUsed) + { + MessageBox(GUI.hWnd, TEXT("Changing to Vulkan requires a restart if you've already used OpenGL"), TEXT("Snes9x Display Driver"), MB_OK); + break; + } S9xDisplayOutput = &VulkanDriver; + VulkanUsed = true; break; }