Ejemplo n.º 1
0
 // Called when we lose the surface
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   Log.v("SDL", "surfaceDestroyed()");
   // Call this *before* setting mIsSurfaceReady to 'false'
   SDLActivity.handlePause();
   SDLActivity.mIsSurfaceReady = false;
   SDLActivity.onNativeSurfaceDestroyed();
 }
Ejemplo n.º 2
0
  // Events
  @Override
  protected void onPause() {
    Log.v("SDL", "onPause()");
    super.onPause();

    if (SDLActivity.mBrokenLibraries) {
      return;
    }

    SDLActivity.handlePause();
  }
Ejemplo n.º 3
0
  // Called when we lose the surface
  @Override
  public void surfaceDestroyed(SurfaceHolder holder) {
    Log.v("SDL", "surfaceDestroyed()");
    // Call this *before* setting mIsSurfaceReady to 'false'
    SDLActivity.handlePause();
    SDLActivity.mIsSurfaceReady = false;

    /* We have to clear the current context and destroy the egl surface here
     * Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume
     * Ref: http://stackoverflow.com/questions/8762589/eglcreatewindowsurface-on-ics-and-switching-from-2d-to-3d
     */

    EGL10 egl = (EGL10) EGLContext.getEGL();
    egl.eglMakeCurrent(
        SDLActivity.mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
    egl.eglDestroySurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface);
    SDLActivity.mEGLSurface = EGL10.EGL_NO_SURFACE;
  }
Ejemplo n.º 4
0
 // Events
 @Override
 protected void onPause() {
   Log.v("SDL", "onPause()");
   super.onPause();
   SDLActivity.handlePause();
 }