Blob Blame History Raw
diff -up quesoglc-0.7.2/src/global.c~ quesoglc-0.7.2/src/global.c
--- quesoglc-0.7.2/src/global.c~	2009-01-18 18:51:18.000000000 +0100
+++ quesoglc-0.7.2/src/global.c	2024-01-20 14:05:40.454063448 +0100
@@ -58,6 +58,7 @@
  */
 
 #include "internal.h"
+#include <stdio.h>
 #include <stdlib.h>
 
 #ifdef __GNUC__
@@ -454,6 +455,7 @@ void APIENTRY glcContext(GLint inContext
   __GLCcontext *currentContext = NULL;
   __GLCcontext *ctx = NULL;
   __GLCthreadArea *area = NULL;
+  GLenum err;
 
   GLC_INIT_THREAD();
 
@@ -568,8 +570,11 @@ void APIENTRY glcContext(GLint inContext
    * QuesoGLC docs tell that the behaviour of GLC is undefined if no GL context
    * is current while issuing GL commands.
    */
-  if (glewInit() != GLEW_OK)
-    __glcRaiseError(GLC_RESOURCE_ERROR);
+  err = glewInit();
+  if (err != GLEW_OK && err != GLEW_ERROR_NO_GLX_DISPLAY) {
+    fprintf(stderr, "GLC: glewInit() error %d\n", err);
+    __glcRaiseError(GLC_RESOURCE_ERROR);
+  }
 }