Jogamp
JOGL/NEWT: Animator fixes
authorSven Gothel <sgothel@jausoft.com>
Sun, 21 Nov 2010 02:41:22 +0000 (03:41 +0100)
committerSven Gothel <sgothel@jausoft.com>
Sun, 21 Nov 2010 02:41:22 +0000 (03:41 +0100)
commit2aa296771e3e8dd6cf027f27b0455d1803244bfe
tree514c532f9ddff7f84e9e6fb75e883f04c71ec74f
parent6f73de7c5bb85d0175c8dda7c55317923017bbe0
JOGL/NEWT: Animator fixes

Consider use cases with many drawables and no drawables at start,
this had to be reflected all over this patch set, implementation,
usage and test cases.

- GLAnimatorControl
  - refine API doc / states
  - add 'void remove(GLAutoDrawable drawable);'

- Animator*:

  - using RecursiveLock 'stateSync' for all actions out of the big synchronized (animator) block:

     - get status methods (thread, isPaused, ..), hence no more synchronized

     - display drawables change, utilizing synced ArrayList swap

    This removes the need for volatiles usage shouldPause/shouldStop within the display method.

  - added blocking wait for state change for add(GLAutoDrawable)/remove(GLAutoDrawable) method

  - remove flawed double checked locking in anim thread (pause/idle condition)

  - thread is now a daemon thread, hence it won't hinder the JVM from shutdown

  -

- Animator use change:

  - Always resume after pause, except in case of final destroy -> NEWT invalidate / GLCanvas,
    this considers use cases with many drawables and no drawables at start.

  - GLDrawableHelper: Don't pause at implicit dispose()
19 files changed:
make/scripts/tests.sh
src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java
src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
src/jogl/classes/com/jogamp/opengl/util/Animator.java
src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
src/jogl/classes/javax/media/opengl/GLCapabilities.java
src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01NEWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01aAWT.java
src/newt/classes/com/jogamp/newt/Window.java
src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
http://JogAmp.org git info: FAQ, tutorial and man pages.