Merge pull request #11923 from keithbowes/sdl2-out-of-x

Get the SDL2 video driver to work in Wayland/KMS
This commit is contained in:
Autechre 2021-02-01 23:13:38 +01:00 committed by GitHub
commit 6b11a9a928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);