示例#1
0
 @Override
 public void onResume() {
   super.onResume();
   Log.d(TAG, "onResume");
   if (engine.isAlive()) {
     engine.resumeEngine();
   }
   if (gameView != null) {
     gameView.onResume();
   }
   Log.d(TAG, "finished resuming");
 }
示例#2
0
  @Override
  public void onDestroy() {
    super.onDestroy();
    Log.d(TAG, "onDestroy");
    engine.end();

    if (engine.isAlive()) {
      Log.w(TAG, "Engine is still alive!");
    } else {
      Log.i(TAG, "Engine is dead.");
      engine = null;
    }
    pipe.close();
    pipe = null;
  }
示例#3
0
 /**
  * Subclasses must call this at the end of their onCreate() call.
  *
  * @param near The near clipping distance.
  * @param far The far clipping distance.
  */
 protected void start(float near, float far) {
   if (!created) {
     throw new IllegalStateException("GameActivity subclass must call super.onCreate() first!");
   }
   Log.d(TAG, "GameActivity Start!");
   engine.start();
   gameView.setRenderer(new GameRenderer(pipe, near, far));
   super.setContentView(gameView); // TODO change to super.setContentView(content);
 }
示例#4
0
 @Override
 public void onPause() {
   super.onPause();
   Log.d(TAG, "onPause");
   if (gameView != null) {
     gameView.onPause();
   } else {
     Log.w(TAG, "pausing while gameView is null!");
   }
   engine.pause();
 }