Skip to content

Commit

Permalink
SDL: fix glew on wayland by ignore glx
Browse files Browse the repository at this point in the history
glXGetProcAddress works on wayland if linking with x11.
As long as we don't use glx related funcs, it can be ignored.
The no glx error should be handled by SDL.
Glew is only used to init gl funcs.

related:
nigels-com/glew#172
  • Loading branch information
catsout committed Oct 18, 2022
1 parent cbe31af commit d304eee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SDL/SDLGLGraphicsContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d304eee

Please sign in to comment.