Select EGL config when creating the EGL surface
authorGabriel Jacobo <gabomdq@gmail.com>
Mon, 02 Dec 2013 10:08:57 -0300
changeset 8041 afd62b3fda31
parent 8039 3b0346b37e0f
child 8042 7863121cb7d5
Select EGL config when creating the EGL surface
src/video/SDL_egl.c
--- 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,