Throw a fatal error if combination of bgfx video and wayland videodriver has been detected (#9888)

This commit is contained in:
Julian Sikorski 2022-06-25 18:35:01 +02:00 committed by GitHub
parent 9956c942da
commit 8394243872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -437,21 +437,10 @@ void sdl_osd_interface::init(running_machine &machine)
}
stemp = options().video_driver();
if (stemp != nullptr)
if (stemp != nullptr && strcmp(stemp, OSDOPTVAL_AUTO) != 0)
{
if (strcmp(stemp, OSDOPTVAL_AUTO) != 0)
{
osd_printf_verbose("Setting SDL videodriver '%s' ...\n", stemp);
osd_setenv(SDLENV_VIDEODRIVER, stemp, 1);
}
else
{
#if defined(__linux__)
// bgfx does not work with wayland
osd_printf_verbose("Setting SDL videodriver '%s' ...\n", "x11");
osd_setenv(SDLENV_VIDEODRIVER, "x11", 1);
#endif
}
osd_printf_verbose("Setting SDL videodriver '%s' ...\n", stemp);
osd_setenv(SDLENV_VIDEODRIVER, stemp, 1);
}
stemp = options().render_driver();
@ -510,6 +499,11 @@ void sdl_osd_interface::init(running_machine &machine)
osd_printf_error("Could not initialize SDL %s\n", SDL_GetError());
exit(-1);
}
// bgfx does not work with wayland
if ((strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) && ((strcmp(options().video(), "auto") == 0) || (strcmp(options().video(), "bgfx") == 0)))
fatalerror("Error: BGFX video does not work with wayland videodriver. Please change either of the options.");
osd_sdl_info();
defines_verbose();