From fc34ca6875bb1d8d0311c8bb38672ffc9578d20d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 12 Jun 2024 12:21:18 +0300 Subject: [PATCH] ignore GLEW_ERROR_NO_GLX_DISPLAY (issue #240) --- src/window/Window.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/window/Window.cpp b/src/window/Window.cpp index 5437e927..9e0b1bad 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -144,10 +144,16 @@ int Window::initialize(DisplaySettings* settings){ glfwMakeContextCurrent(window); glewExperimental = GL_TRUE; + GLenum glewErr = glewInit(); if (glewErr != GLEW_OK){ - logger.error() << "failed to initialize GLEW:\n" << glewGetErrorString(glewErr); - return -1; + if (glewErr == GLEW_ERROR_NO_GLX_DISPLAY) { + // see issue #240 + logger.warning() << "glewInit() returned GLEW_ERROR_NO_GLX_DISPLAY; ignored"; + } else { + logger.error() << "failed to initialize GLEW:\n" << glewGetErrorString(glewErr); + return -1; + } } glViewport(0,0, width, height);