From: Sylvain Beucler Date: Sat, 17 Mar 2012 11:39:45 +0000 (+0000) Subject: fghChooseConfigEGL returns 1/0 if found/not found X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=44723ddf7e6337d41562680d5ca89f23816577ac;p=freeglut fghChooseConfigEGL returns 1/0 if found/not found git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1177 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/egl/fg_window_egl.c b/src/egl/fg_window_egl.c index 75547ba..c2bca96 100644 --- a/src/egl/fg_window_egl.c +++ b/src/egl/fg_window_egl.c @@ -26,7 +26,7 @@ #include #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; } /** diff --git a/src/egl/fg_window_egl.h b/src/egl/fg_window_egl.h index a4beb69..37b8951 100644 --- a/src/egl/fg_window_egl.h +++ b/src/egl/fg_window_egl.h @@ -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 );