win32: Don't allow Vulkan and OpenGL to be used in the same session.

This commit is contained in:
BearOso 2023-03-15 15:54:43 -05:00
parent 5e02a77d59
commit 24cea1972c
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}