diff options
author | Sven Gothel <[email protected]> | 2010-10-27 16:39:20 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-27 16:39:20 +0200 |
commit | e6225fce71daa90a2a2b631550ba048c2a84ff25 (patch) | |
tree | 863985817e72b5b9fc855de3be4f2154fa86dedf /src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | |
parent | e6131c6b2cbf8d1e5a05f0343612f5083b55aaa9 (diff) |
WindowImpl/GLWindow LifecycleHook:
- 'destroyAction' -> 'destroyActionPreLock' 'destroyActionInLock',
to be able to stop animation before locking.
GLDrawableHelper.invokeGL() dispose case (initAction == null):
- pause animator if animating before makeCurrent (locking)
GLCanvas/GLJPanel dispose: recreate case
- resume animator if was animating
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt/GLJPanel.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index 192695955..10aeefaf5 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -213,7 +213,14 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { Exception ex1 = new Exception("Info: dispose("+regenerate+") - start"); ex1.printStackTrace(); } + if (backend != null) { + boolean animatorWasAnimating = false; + GLAnimatorControl animator = getAnimator(); + if(null!=animator) { + animatorWasAnimating = animator.isAnimating(); + } + disposeRegenerate=regenerate; disposeContext=backend.getContext(); disposeDrawable=backend.getDrawable(); @@ -242,6 +249,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { if(null==disposeContext) { isInitialized = false; } + + if(regenerate && animatorWasAnimating && animator.isPaused()) { + animator.resume(); + } } if(DEBUG) { |