Fix game launch on Wayland-only systems with SDL2.30+

This commit is contained in:
DynamoFox 2024-07-26 18:14:55 +02:00
parent 08f955bff0
commit a013372be4

View file

@ -1019,6 +1019,13 @@ int CGraphicsBackend_SDL_GL::Init(const char *pName, int *pScreen, int *pWidth,
SDL_GetVersion(&Linked);
dbg_msg("sdl", "SDL version %d.%d.%d (compiled = %d.%d.%d)", Linked.major, Linked.minor, Linked.patch,
Compiled.major, Compiled.minor, Compiled.patch);
#if CONF_PLATFORM_LINUX && SDL_VERSION_ATLEAST(2, 0, 22)
// needed to workaround SDL from forcing exclusively X11 if linking against the GLX flavour of GLEW instead of the EGL one
// w/o this on Wayland systems (no XWayland support) SDL's Video subsystem will fail to load (starting from SDL2.30+)
if(Linked.major == 2 && Linked.minor >= 30)
SDL_SetHint(SDL_HINT_VIDEODRIVER, "x11,wayland");
#endif
}
if(!SDL_WasInit(SDL_INIT_VIDEO))