Fixed screen staying black sometimes after restoring app from background

This commit is contained in:
Sergii Pylypenko
2014-12-18 21:50:52 +02:00
parent 1d8c6bcc5d
commit 622966dd9b
3 changed files with 2 additions and 3 deletions

View File

@@ -1004,10 +1004,10 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
if(mRenderer.mPaused) if(mRenderer.mPaused)
return; return;
mRenderer.mPaused = true; mRenderer.mPaused = true;
super.onPause();
mRenderer.nativeGlContextLostAsyncEvent(); mRenderer.nativeGlContextLostAsyncEvent();
if( mRenderer.accelerometer != null ) // For some reason it crashes here often - are we getting this event before initialization? if( mRenderer.accelerometer != null ) // For some reason it crashes here often - are we getting this event before initialization?
mRenderer.accelerometer.stop(); mRenderer.accelerometer.stop();
super.onPause();
}; };
public boolean isPaused() { public boolean isPaused() {

View File

@@ -1211,6 +1211,7 @@ void SDL_ANDROID_VideoContextRecreated()
ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics
} }
} }
SDL_ANDROID_CallJavaSwapBuffers(); // Swap buffers once to force screen redraw
} }
}; };

View File

@@ -29,8 +29,6 @@ TODO, which will get actually done
- SDL: control mouse with right analog gamepad stick. - SDL: control mouse with right analog gamepad stick.
- SDL: sometimes the screen stays black after restoring from background.
- XSDL: support Android intent x11://localhost:6000 - http://www.openintents.org/node/905 - XSDL: support Android intent x11://localhost:6000 - http://www.openintents.org/node/905
- XSDL: screen follows mouse when on-screen keyboard is shown. - XSDL: screen follows mouse when on-screen keyboard is shown.