fghChooseConfigEGL returns 1/0 if found/not found
authorSylvain Beucler <beuc@beuc.net>
Sat, 17 Mar 2012 11:39:45 +0000 (11:39 +0000)
committerSylvain Beucler <beuc@beuc.net>
Sat, 17 Mar 2012 11:39:45 +0000 (11:39 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1177 7f0cb862-5218-0410-a997-914c9d46530a

src/egl/fg_window_egl.c
src/egl/fg_window_egl.h

index 75547ba..c2bca96 100644 (file)
@@ -26,7 +26,7 @@
 #include <GL/freeglut.h>
 #include "fg_internal.h"
 
-void fghChooseConfigEGL(EGLConfig* config) {
+int fghChooseConfigEGL(EGLConfig* config) {
   const EGLint attribs[] = {
     EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
 #ifdef GL_ES_VERSION_2_0
@@ -49,8 +49,12 @@ void fghChooseConfigEGL(EGLConfig* config) {
   
   EGLint num_config;
   if (!eglChooseConfig(fgDisplay.pDisplay.egl.Display,
-                      attribs, config, 1, &num_config))
-    fgError("eglChooseConfig: error %x\n", eglGetError());
+                      attribs, config, 1, &num_config)) {
+    fgWarn("eglChooseConfig: error %x\n", eglGetError());
+    return 0;
+  }
+
+  return 1;
 }
 
 /**
index a4beb69..37b8951 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef __FG_WINDOW_EGL_H__
 #define __FG_WINDOW_EGL_H__
 
-extern void fghChooseConfigEGL(EGLConfig* config);
+extern int fghChooseConfigEGL(EGLConfig* config);
 extern void fghPlatformOpenWindowEGL( SFG_Window* window );
 extern void fghCreateNewContextEGL( SFG_Window* window );
 extern void fghPlatformCloseWindowEGL( SFG_Window* window );