예제 #1
0
 /**
  * Called by onResume or surfaceCreated. An actual resume should be done only when the surface is
  * ready. Note: Some Android variants may send multiple surfaceChanged events, so we don't need to
  * resume every time we get one of those events, only if it comes after surfaceDestroyed
  */
 public static void handleResume() {
   if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
     SDLActivity.mIsPaused = false;
     SDLActivity.nativeResume();
     mSurface.handleResume();
   }
 }
예제 #2
0
 /**
  * Called by onResume or surfaceCreated. An actual resume should be done only when the surface is
  * ready. Note: Some Android variants may send multiple surfaceChanged events, so we don't need to
  * resume every time we get one of those events, only if it comes after surfaceDestroyed
  */
 public static void handleResume() {
   if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
     SDLActivity.mIsPaused = false;
     SDLActivity.nativeResume();
     mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
   }
 }
예제 #3
0
 public static void startApp() {
   // Start up the C app thread
   if (mSDLThread == null) {
     mSDLThread = new Thread(new SDLMain(), "SDLThread");
     mSDLThread.start();
   } else {
     /*
      * Some Android variants may send multiple surfaceChanged events, so we don't need to resume every time
      * every time we get one of those events, only if it comes after surfaceDestroyed
      */
     if (mIsPaused) {
       SDLActivity.nativeResume();
       SDLActivity.mIsPaused = false;
     }
   }
 }