Commit d0fddfab84e4e8df3daa894542d37c457fc4f597

Gabriel Jacobo 2013-10-10T00:30:03

Fixes Bug 2134 - [Android] Black screen after resume (sometimes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c
index 0357397..9be49cf 100644
--- a/src/video/android/SDL_androidevents.c
+++ b/src/video/android/SDL_androidevents.c
@@ -72,6 +72,8 @@ Android_PumpEvents(_THIS)
 
 #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 @@ Android_PumpEvents(_THIS)
                 isPausing = 1;
             }
             else {
-                android_egl_context_backup();
                 isPausing = 0;
                 isPaused = 1;
             }