예제 #1
0
  @Override
  public void setScreen(Screen screen) {
    if (screen == null) throw new IllegalArgumentException("Screen must not be null");

    this.screen.pause();
    this.screen.dispose();
    screen.resume();
    screen.update(0);
    this.screen = screen;
  }
예제 #2
0
  @Override
  public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    glGraphics.setGL(gl);

    synchronized (stateChanged) {
      if (state == GLGameState.Initialized) {
        screen = getStartScreen();
        ((GameScreen) screen).listener = listener;
      }
      state = GLGameState.Running;
      screen.resume();
      startTime = System.nanoTime();
    }
  }