diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp index 7759dd3f698..b99858dd69e 100644 --- a/src/osd/sdl/sdlmain.cpp +++ b/src/osd/sdl/sdlmain.cpp @@ -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();