diff options
author | Sven Gothel <[email protected]> | 2010-10-28 01:24:58 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-28 01:24:58 +0200 |
commit | 99d205d0c5f047ef9a6a6e21f351abe415ed3b15 (patch) | |
tree | e4d080682d90e7dd0d865383ba581101e018a6f4 /src/newt/classes/com | |
parent | e6225fce71daa90a2a2b631550ba048c2a84ff25 (diff) |
Animator Fix/Cleanup
- Fix AnimatorBase: Finally using 'com.jogamp.opengl.util.AWTAnimatorImpl',
wrong FQN lead to never use it, hence deadlock in case of AWT usage (AWT-EDT).
- Animator
- remove volatile for synced state isAnimated
- new state isPaused, since shouldPause give the wrong answer for isPaused()
- Cleanup wait condition for lifecycle tasks (start/stop/pause/resume)
- 'AnimatorImpl' -> 'DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl'
- 'AWTAnimatorImpl implements AnimatorBase.AnimatorImpl',
hence no derivation of a complete overwritten AnimatorImpl needed.
- GLWindow.destroyActionPreLock()
- Stop animator if unrecoverable, else pause only.
Tests:
- No explicit animator stop, hence tests implicit stop/pause
by GLDrawableHelper and/or GLWindow.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index f6901e54a..7836bec68 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -280,10 +280,14 @@ public class GLWindow implements GLAutoDrawable, Window { /** Window.LifecycleHook */ public synchronized void destroyActionPreLock(boolean unrecoverable) { GLAnimatorControl animator = GLWindow.this.getAnimator(); - // since we have no 'recreation model' for dispose here yet, - // we simply stop the animator if started. - if(null!=animator && animator.isStarted()) { - animator.stop(); + if(null!=animator) { + if(unrecoverable) { + if(animator.isStarted()) { + animator.stop(); + } + } else if(animator.isAnimating()) { + animator.pause(); + } } } |