diff -r f830e73e2acf android-project/src/org/libsdl/app/SDLActivity.java --- a/android-project/src/org/libsdl/app/SDLActivity.java vie may 25 18:21:22 2012 -0400 +++ b/android-project/src/org/libsdl/app/SDLActivity.java lun may 28 19:24:45 2012 -0300 @@ -77,7 +77,7 @@ protected void onResume() { Log.v("SDL", "onResume()"); super.onResume(); - SDLActivity.nativeResume(); + // Don't call SDLActivity.nativeResume(); here, it will be called via SDLSurface::surfaceChanged->SDLActivity::startApp } protected void onDestroy() { @@ -249,12 +249,14 @@ return false; } - if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) { - Log.e("SDL", "Old EGL Context doesnt work, trying with a new one"); - createEGLContext(); + if (egl.eglGetCurrentContext() != SDLActivity.mEGLContext) { if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) { - Log.e("SDL", "Failed making EGL Context current"); - return false; + Log.e("SDL", "Old EGL Context doesnt work, trying with a new one"); + createEGLContext(); + if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) { + Log.e("SDL", "Failed making EGL Context current"); + return false; + } } } SDLActivity.mEGLSurface = surface; @@ -426,7 +428,6 @@ public void surfaceCreated(SurfaceHolder holder) { Log.v("SDL", "surfaceCreated()"); holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); - SDLActivity.createEGLSurface(); enableSensor(Sensor.TYPE_ACCELEROMETER, true); }