Fixes Bug 2134 - [Android] Black screen after resume (sometimes)
authorGabriel Jacobo <gabomdq@gmail.com>
Thu, 10 Oct 2013 00:30:03 -0300
changeset 7795 6acc7df4a175
parent 7794 7995e0920bf9
child 7796 75c80f36038e
Fixes Bug 2134 - [Android] Black screen after resume (sometimes)
src/video/android/SDL_androidevents.c
--- a/src/video/android/SDL_androidevents.c	Wed Oct 09 11:30:01 2013 -0300
+++ b/src/video/android/SDL_androidevents.c	Thu Oct 10 00:30:03 2013 -0300
@@ -72,6 +72,8 @@
 
 #if SDL_ANDROID_BLOCK_ON_PAUSE
     if (isPaused && !isPausing) {
+        /* Make sure this is the last thing we do before pausing */
+        android_egl_context_backup();
         if(SDL_SemWait(Android_ResumeSem) == 0) {
 #else
     if (isPaused) {
@@ -92,7 +94,6 @@
                 isPausing = 1;
             }
             else {
-                android_egl_context_backup();
                 isPausing = 0;
                 isPaused = 1;
             }