From 34fffab0bb25bbf8a4cd2bf372e018748982b9bc Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 23 Sep 2010 14:53:25 +0200 Subject: 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] --- src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java') diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java index 50b91b729..e4bf8d711 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 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 @@ -40,11 +41,11 @@ import javax.media.opengl.*; up this behavior if desired. */ class AnimatorImpl { - public void display(Animator animator, + public void display(AnimatorBase animator, boolean ignoreExceptions, boolean printExceptions) { Iterator iter = animator.drawableIterator(); - while (iter.hasNext()) { + while (animator.isAnimating() && !animator.getShouldStop() && !animator.getShouldPause() && iter.hasNext()) { GLAutoDrawable drawable = (GLAutoDrawable) iter.next(); try { drawable.display(); @@ -60,7 +61,7 @@ class AnimatorImpl { } } - public boolean skipWaitForStop(Thread thread) { + public boolean skipWaitForCompletion(Thread thread) { return (Thread.currentThread() == thread); } } -- cgit v1.2.3