Get the SDL2 video driver to work in Wayland/KMS

This commit is contained in:
Keith Bowes 2021-01-20 15:48:31 -05:00
parent 2520337ddc
commit 125154e831

View File

@ -440,10 +440,16 @@ static void *sdl2_gfx_init(const video_info_t *video,
#if defined(_WIN32)
sdl2_set_handles(vid->window, RARCH_DISPLAY_WIN32);
#elif defined(HAVE_X11)
sdl2_set_handles(vid->window, RARCH_DISPLAY_X11);
#elif defined(HAVE_COCOA)
sdl2_set_handles(vid->window, RARCH_DISPLAY_OSX);
#else
const char *video_driver = SDL_GetCurrentVideoDriver();
if (strcmp(video_driver, "x11") == 0)
sdl2_set_handles(vid->window, RARCH_DISPLAY_X11);
else if (strcmp(video_driver, "wayland") == 0)
sdl2_set_handles(vid->window, RARCH_DISPLAY_WAYLAND);
else
sdl2_set_handles(vid->window, RARCH_DISPLAY_NONE);
#endif
sdl_refresh_viewport(vid);