/** * Special version of changeGLController(), won't call pause() or dispose() in old GLController. * Can for example be used if assets are transferred between GLController's. Can be called from * anywhere within a GLController. Will pause and dispose of old GLController. * * @throws IllegalArgumentException if new GLController is null * @param glController the new GLController */ public void changeGLControllerDontDispose(GLController glController) { if (glController == null) { throw new IllegalArgumentException("New GLController is null, not allowed."); } // Resumes new GLController glController.onResume(); this.glController = glController; catchBackKey(glController.catchBackKey()); }
/** * Changes GLController Can be called from anywhere within a GLController. Will pause and dipose * of old GLController. * * @throws IllegalArgumentException if new GLController is null * @param glController the new GLController */ @Deprecated // TODO: Not really deprecated, but is needed to make sure people don't use wrong // method in project. public void changeGLController(GLController glController) { if (glController == null) { throw new IllegalArgumentException("New GLController is null, not allowed."); } // Dispose of old GLController this.glController.onPause(); this.glController.dispose(); // Resumes new GLController glController.onResume(); this.glController = glController; catchBackKey(glController.catchBackKey()); }