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.
This commit is contained in:
Nunuhara Cabbage
2020-09-06 11:25:26 -07:00
parent 2bda2b0ea8
commit 6874f32589
+2 -1
View File
@@ -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);