From 6874f325899eb973eb48676f0bbaaa459fb0020a Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Sun, 6 Sep 2020 11:24:59 -0700 Subject: [PATCH] Fix crash when SDL_VIDEODRIVER=wayland glewInit returns an error when using the SDL wayland backend because distro-provided packages are built for GLX instead of EGL. --- src/video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video.c b/src/video.c index 3a1907d..23842a2 100644 --- a/src/video.c +++ b/src/video.c @@ -183,7 +183,8 @@ int gfx_init(void) ERROR("SDL_GL_CreateContext failed: %s", SDL_GetError()); glewExperimental = GL_TRUE; - if (glewInit() != GLEW_OK) + GLenum err = glewInit(); + if (err != GLEW_OK && err != GLEW_ERROR_NO_GLX_DISPLAY) ERROR("glewInit failed"); SDL_GL_SetSwapInterval(0);