(SDL2) Add ifdefs for HAVE_X11 and HAVE_WAYLAND

This commit is contained in:
twinaphex 2021-02-01 23:18:06 +01:00
parent 6aa01b2ce7
commit 732fce9a04

View File

@ -443,12 +443,19 @@ static void *sdl2_gfx_init(const video_info_t *video,
#elif defined(HAVE_COCOA)
sdl2_set_handles(vid->window, RARCH_DISPLAY_OSX);
#else
#if defined(HAVE_X11) || defined(HAVE_WAYLAND)
const char *video_driver = SDL_GetCurrentVideoDriver();
#endif
#ifdef HAVE_X11
if (strcmp(video_driver, "x11") == 0)
sdl2_set_handles(vid->window, RARCH_DISPLAY_X11);
else if (strcmp(video_driver, "wayland") == 0)
else
#endif
#ifdef HAVE_WAYLAND
if (strcmp(video_driver, "wayland") == 0)
sdl2_set_handles(vid->window, RARCH_DISPLAY_WAYLAND);
else
#endif
sdl2_set_handles(vid->window, RARCH_DISPLAY_NONE);
#endif