Wayland: fix error detection during call to glewInit().

This commit is contained in:
ManoloFLTK 2022-09-22 08:07:46 +02:00
parent debbba19ec
commit 6b63516890
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ int main (int argc, char* argv[])
#ifndef __APPLE__ #ifndef __APPLE__
GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above
#ifdef FLTK_USE_WAYLAND #ifdef FLTK_USE_WAYLAND
if (err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK; if (fl_wl_display() && err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK;
#endif #endif
if (err != GLEW_OK) Fl::error("glewInit() failed returning %u", err); if (err != GLEW_OK) Fl::error("glewInit() failed returning %u", err);
fprintf(stderr, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION)); fprintf(stderr, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));

View File

@ -149,7 +149,7 @@ public:
# ifdef FLTK_USE_WAYLAND # ifdef FLTK_USE_WAYLAND
// glewInit returns GLEW_ERROR_NO_GLX_DISPLAY with Wayland // glewInit returns GLEW_ERROR_NO_GLX_DISPLAY with Wayland
// see https://github.com/nigels-com/glew/issues/273 // see https://github.com/nigels-com/glew/issues/273
if (err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK; if (fl_wl_display() && err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK;
# endif # endif
if (err) Fl::warning("glewInit() failed returning %u", err); if (err) Fl::warning("glewInit() failed returning %u", err);
else add_output("Using GLEW %s\n", glewGetString(GLEW_VERSION)); else add_output("Using GLEW %s\n", glewGetString(GLEW_VERSION));