diff options
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java index 6c07b3626..ee6b59fc0 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java +++ b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java @@ -123,10 +123,13 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous e.setConsumed(true); glWindow.invokeOnCurrentThread(new Runnable() { public void run() { - if(glWindow.getAnimator().isPaused()) { - glWindow.getAnimator().resume(); - } else { - glWindow.getAnimator().pause(); + final GLAnimatorControl anim = glWindow.getAnimator(); + if( null != anim ) { + if( anim.isPaused()) { + anim.resume(); + } else { + anim.pause(); + } } } } ); break; |