[master] 6b63516 - Wayland: fix error detection during call to glewInit().

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 6b63516 - Wayland: fix error detection during call to glewInit(). "ManoloFLTK" 23:17 Sep 21 top right image
 
commit 6b63516890a77ce61a9670510a730811c02a3b09
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu Sep 22 08:07:46 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu Sep 22 08:07:46 2022 +0200

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

 examples/OpenGL3-glut-test.cxx | 2 +-
 examples/OpenGL3test.cxx       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git examples/OpenGL3-glut-test.cxx examples/OpenGL3-glut-test.cxx
index 31639b5..4a8994c 100644
--- examples/OpenGL3-glut-test.cxx
+++ examples/OpenGL3-glut-test.cxx
@@ -200,7 +200,7 @@ int main (int argc, char* argv[])
 #ifndef __APPLE__
   GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above
 #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
   if (err != GLEW_OK) Fl::error("glewInit() failed returning %u", err);
   fprintf(stderr, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
diff --git examples/OpenGL3test.cxx examples/OpenGL3test.cxx
index 08c1711..9acbaf3 100644
--- examples/OpenGL3test.cxx
+++ examples/OpenGL3test.cxx
@@ -149,7 +149,7 @@ public:
 #  ifdef FLTK_USE_WAYLAND
       // glewInit returns GLEW_ERROR_NO_GLX_DISPLAY with Wayland
       // 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
       if (err) Fl::warning("glewInit() failed returning %u", err);
       else add_output("Using GLEW %s\n", glewGetString(GLEW_VERSION));
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.