Skip to content

Commit 70f6850

Browse files
committed
Work around the GLEW issue on Wayland
When running the client using SDL's Wayland driver, glewInit() was returning GLEW_ERROR_NO_GLX_DISPLAY. This was messing up our OpenGL state because we were bailing out of initContext(). We don't use any GLX extensions, so it seems like it's safe for us to just ignore this and continue. Fixes #377
1 parent 4fd2478 commit 70f6850

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ogl/OpenGLGState.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,9 +1323,13 @@ void OpenGLGState::initContext()
13231323
}
13241324

13251325
GLenum err = glewInit();
1326-
if (GLEW_OK != err)
1326+
// Running the client using SDL's Wayland driver causes glewInit() to return GLEW_ERROR_NO_GLX_DISPLAY. We do not
1327+
// check for or use GLX extensions, so I think it's safe to allow for this error code.
1328+
// https://github.com/nigels-com/glew/issues/417
1329+
// https://github.com/BZFlag-Dev/bzflag/issues/377
1330+
if (GLEW_OK != err && GLEW_ERROR_NO_GLX_DISPLAY != err)
13271331
{
1328-
printf("Error: %s\n", glewGetErrorString(err));
1332+
printf("initContext() Error: %s\n", glewGetErrorString(err));
13291333
return;
13301334
}
13311335

0 commit comments

Comments
 (0)