src/video/SDL_egl.c
changeset 8041 afd62b3fda31
parent 8021 f96e12e0ade9
child 8045 3c2694255705
--- a/src/video/SDL_egl.c	Fri Nov 29 10:06:08 2013 -0300
+++ b/src/video/SDL_egl.c	Mon Dec 02 10:08:57 2013 -0300
@@ -225,8 +225,7 @@
         *_this->gl_config.driver_path = '\0';
     }
     
-    /* We need to select a config here to satisfy some video backends such as X11 */
-    return SDL_EGL_ChooseConfig(_this);
+    return 0;
 }
 
 int
@@ -452,6 +451,10 @@
 EGLSurface *
 SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) 
 {
+    if (SDL_EGL_ChooseConfig(_this) != 0) {
+        return -1;
+    }
+    
     return _this->egl_data->eglCreateWindowSurface(
             _this->egl_data->egl_display,
             _this->egl_data->egl_config,