Example #1
0
 public static void postUpdate() {
   if (!idleHandlerActive) {
     queue.addIdleHandler(glView);
     idleHandlerActive = true;
     // Log.i(logTag, "start idle handler");
   }
 }
Example #2
0
 @Override
 public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
   /*Log.i(logTag, "surfaceChanged " + Integer.toString(w) + " " + Integer.toString(h)
   + " " + getHolder().getSurfaceFrame().toString());*/
   if (mEglHelper.mEglContext == null) {
     // Log.i(logTag, "context lost");
     return;
   }
   if (!initNative) {
     handler = new Handler();
     nativeInit(w, h);
     queue = Looper.myQueue();
     queue.addIdleHandler(this);
     idleHandlerActive = true;
     initNative = true;
   } else {
     nativeResize(w, h);
     postUpdate();
     if (initSurface == true
         && android.os.Build.VERSION.SDK_INT
             >= 11) // HACK: resize is from a screen rotation, do swap() again or display may not
     // render, Android bug? Custom rotation animation in pre 3.0 redraws the screen
     // at least one more time anyway
     {
       // Log.i(logTag, "extra swap after rotation");
       mEglHelper.swap();
     }
   }
   initSurface = true;
 }
Example #3
0
 public static void stopUpdate() {
   // Log.i(logTag, "stop idle handler");
   queue.removeIdleHandler(glView);
   idleHandlerActive = false;
 }