diff -r 1b49b680f319 src/video/SDL_egl.c --- a/src/video/SDL_egl.c Wed Nov 13 11:18:37 2013 -0300 +++ b/src/video/SDL_egl.c Thu Nov 14 15:29:11 2013 +0200 @@ -398,7 +398,7 @@ SDL_EGL_MakeCurrent(_this, NULL, NULL); _this->egl_data->eglDestroyContext(_this->egl_data->egl_display, egl_context); } - + /* FIXME: This "crappy fix" comes from the X11 code, * it's required so you can create a GLX context, destroy it and create a EGL one */ SDL_EGL_UnloadLibrary(_this); @@ -407,6 +407,10 @@ EGLSurface * SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) { + /* Needed on Android so a new window with a */ + /* different kind of context can be recreated. */ + SDL_EGL_LoadLibrary(_this, NULL, (NativeDisplayType) 0); + return _this->egl_data->eglCreateWindowSurface( _this->egl_data->egl_display, _this->egl_data->egl_config, diff -r 1b49b680f319 src/video/android/SDL_androidwindow.c --- a/src/video/android/SDL_androidwindow.c Wed Nov 13 11:18:37 2013 -0300 +++ b/src/video/android/SDL_androidwindow.c Thu Nov 14 15:29:11 2013 +0200 @@ -102,6 +102,10 @@ if(window->driverdata) { data = (SDL_WindowData *) window->driverdata; + if (data->egl_surface != EGL_NO_SURFACE) { + SDL_EGL_DestroySurface(_this, data->egl_surface); + data->egl_surface = EGL_NO_SURFACE; + } if(data->native_window) { ANativeWindow_release(data->native_window); }