diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Render.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index c4ed147..1089ad4 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -110,9 +110,17 @@ void Render::render_scene(Scene const& scene, GFX::Texture const& texture) const void Render::setup_gl() { GLenum error = glewInit(); - if (error != GLEW_OK) { - std::string error_string(reinterpret_cast<Char const*>(glewGetErrorString(error))); - throw std::runtime_error("Failed to load GL functions: " + error_string); + + // We get a NO_GLX_DISPLAY error on Linux/Wayland during GLEW initialization. + // Since we're not using GLX (under Wayland), it is presumably fine to ignore this error, + // and it seems to appear due to some sort of confusion in GLEW when to use GLX or EGL. + // See this GLEW issue: https://github.com/nigels-com/glew/issues/273 + if (error != GLEW_OK && error != GLEW_ERROR_NO_GLX_DISPLAY) { + Char error_code[8]; + snprintf(error_code, sizeof(error_code), "%X", error); + + std::string error_string { reinterpret_cast<Char const *>(glewGetErrorString(error)) }; + throw std::runtime_error("Failed to load GL functions: " + error_string + " (0x" + error_code + ")"); } } |
