SDL: fix glew on wayland by ignore glx

glXGetProcAddress works on wayland if linking with x11.
As long as we don't use glx related funcs,
no_glx_error can be ignored.
SDL should handle the no_glx_error brefore glewInit.
Glew is only used to init gl funcs.

related:
https://github.com/nigels-com/glew/issues/172
This commit is contained in:
catsout 2022-10-18 20:33:58 +08:00
parent cbe31af8cf
commit 83fccd0835

View File

@ -394,7 +394,9 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std:
if (gl_extensions.IsCoreContext) {
glewExperimental = true;
}
if (GLEW_OK != glewInit()) {
GLenum glew_err = glewInit();
// glx is not required, igore.
if (glew_err != GLEW_OK && glew_err != GLEW_ERROR_NO_GLX_DISPLAY) {
printf("Failed to initialize glew!\n");
return 1;
}