mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8653 from DynamoFox/force-sdl2-video-driver-selection-on-linux
Fix game launch on Wayland-only systems with SDL2.30+
This commit is contained in:
commit
41cd82c2d3
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue