mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2026-04-23 00:07:15 +08:00
cmd/ebitenmobile: call setPreserveEGLContextOnPause(true) whatever the option is
We found that an app freezes for a little while when resuming it. In order to improve user experience, always use setPreserveEGLContextOnPause(true) whichever StrictContextRestoration is true or false.
This commit is contained in:
@@ -96,6 +96,7 @@ class EbitenSurfaceView extends GLSurfaceView implements Renderer {
|
||||
private void initialize() {
|
||||
setEGLContextClientVersion(3);
|
||||
setEGLConfigChooser(8, 8, 8, 8, 0, 0);
|
||||
setPreserveEGLContextOnPause(true);
|
||||
// setRenderer must be called before setRenderRequester.
|
||||
// Or, the application crashes.
|
||||
setRenderer(new EbitenRenderer());
|
||||
@@ -125,7 +126,6 @@ class EbitenSurfaceView extends GLSurfaceView implements Renderer {
|
||||
@Override
|
||||
public synchronized void setStrictContextRestoration(boolean strictContextRestoration) {
|
||||
strictContextRestoration_ = strictContextRestoration;
|
||||
setPreserveEGLContextOnPause(!strictContextRestoration);
|
||||
}
|
||||
|
||||
private synchronized boolean hasStrictContextRestoration() {
|
||||
|
||||
Reference in New Issue
Block a user