Do not call exit() when app put to background, we'll recreate GL textures from SDL (not done yet!)
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
fixed with a hammer and rasp to work with libSDL port */
|
||||
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package com.sourceforge.sc2;
|
||||
package com.googlecode.opentyrian;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
@@ -543,6 +543,8 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
*/
|
||||
public abstract void onSurfaceCreated(GL10 gl, EGLConfig config);
|
||||
|
||||
public abstract void onSurfaceDestroyed();
|
||||
|
||||
/**
|
||||
* Called when the surface changed size.
|
||||
* <p>
|
||||
@@ -943,6 +945,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
r.run();
|
||||
}
|
||||
if (mPaused) {
|
||||
mRenderer.onSurfaceDestroyed();
|
||||
mEglHelper.finish();
|
||||
mNeedStart = true;
|
||||
}
|
||||
@@ -984,6 +987,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
if( mEglHelper.swap() )
|
||||
return true;
|
||||
// We've lost GL context - recreate it
|
||||
mRenderer.onSurfaceDestroyed();
|
||||
mEglHelper.finish();
|
||||
mNeedStart = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user