diff options
author | Sven Gothel <[email protected]> | 2010-09-23 14:53:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-09-23 14:53:25 +0200 |
commit | 34fffab0bb25bbf8a4cd2bf372e018748982b9bc (patch) | |
tree | 11b2967f39afde7547d820f069e706a71cef4338 /src/jogl/classes/javax/media/opengl/awt | |
parent | e62a91e26ba01a8970658681891edebcee7461e1 (diff) |
NEWT: Animator API Change - Changed Lifecycle of Display/Screen (part 4)
Change GLAutoDrawable interface: setAnimator(Thread) -> setAnimator(GLAnimatorControl)
to minimize the setAnimator(..) calls and
to allow fine grained control over the animation, ie in case of reparenting
where the animation shall pause while changing the window(s).
Introducing GLAnimatorControl interface:
- abstract class AnimatorBase implements GLAnimatorControl
- class Animator extends AnimatorBase
- class FPSAnimator extends AnimatorBase
This also changes FPSAnimator, since it is no more derived from Animator,
use it's superclass or superinterface instead.
+++
- Fix GLJPanel.paintComponent(): Don't issue reshape/display
in case an external animator thread is animating.
- Fix: Documentation [API]
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 10 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 11 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index f150b2507..705b12783 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -377,8 +378,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { (int) ((getHeight() + bounds.getHeight()) / 2)); return; } - - if( null == getAnimator() ) { + if( this.drawableHelper.isExternalAnimatorAnimating() ) { display(); } } @@ -494,11 +494,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { drawableHelper.removeGLEventListener(listener); } - public void setAnimator(Thread animator) { - drawableHelper.setAnimator(animator); + public void setAnimator(GLAnimatorControl animatorControl) { + drawableHelper.setAnimator(animatorControl); } - public Thread getAnimator() { + public GLAnimatorControl getAnimator() { return drawableHelper.getAnimator(); } diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index d0d97fe31..72b782f9a 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -286,6 +287,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { return; } + if ( drawableHelper.isExternalAnimatorAnimating() ) { + return; + } + if (backend == null || !isInitialized) { createAndInitializeBackend(); } @@ -380,11 +385,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { drawableHelper.removeGLEventListener(listener); } - public void setAnimator(Thread animator) { - drawableHelper.setAnimator(animator); + public void setAnimator(GLAnimatorControl animatorControl) { + drawableHelper.setAnimator(animatorControl); } - public Thread getAnimator() { + public GLAnimatorControl getAnimator() { return drawableHelper.getAnimator(); } |