Do not call exit() when app put to background, we'll recreate GL textures from SDL (not done yet!)

This commit is contained in:
pelya
2010-09-28 17:37:24 +03:00
parent 73dcf3e75e
commit f1d23b2cf1
14 changed files with 80 additions and 75 deletions

View File

@@ -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;
}