summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLAnimatorControl.java22
-rw-r--r--src/jogl/classes/javax/media/opengl/GLAutoDrawable.java1
-rw-r--r--src/jogl/classes/javax/media/opengl/GLCapabilities.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java15
4 files changed, 29 insertions, 11 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
index 01e5646f9..98d7bc48b 100644
--- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
+++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
@@ -79,7 +79,7 @@ public interface GLAnimatorControl {
public void resetCounter();
/**
- * Indicates whether this animator is currently running, ie started.
+ * Indicates whether this animator is running, ie. has been started and not stopped.
*
* @see #start()
* @see #stop()
@@ -89,7 +89,8 @@ public interface GLAnimatorControl {
boolean isStarted();
/**
- * Indicates whether this animator is currently running and not paused.
+ * Indicates whether this animator is running and animating,<br>
+ * the latter is true if it has {@link GLAutoDrawable}s to render and is not paused.
*
* @see #start()
* @see #stop()
@@ -99,7 +100,7 @@ public interface GLAnimatorControl {
boolean isAnimating();
/**
- * Indicates whether this animator is currently running and paused.
+ * Indicates whether this animator is running and paused.
*
* @see #start()
* @see #stop()
@@ -109,7 +110,7 @@ public interface GLAnimatorControl {
boolean isPaused();
/**
- * @return The animation thread if started, ie running.
+ * @return The animation thread if running, otherwise null.
*
* @see #start()
* @see #stop()
@@ -158,7 +159,7 @@ public interface GLAnimatorControl {
*
* @see #resume()
* @see #isAnimating()
- * @throws GLException if not started or not animating or already paused
+ * @throws GLException if not started or already paused
*/
void pause();
@@ -177,4 +178,15 @@ public interface GLAnimatorControl {
* @throws GLException if not started or not paused
*/
void resume();
+
+ /**
+ * Removes a drawable from the animator's list of rendering drawables.<br>
+ * This method should get called in case a drawable becomes invalid,
+ * and will not be recovered.<br>
+ * This allows the animator thread to become idle in case the last drawable
+ * has reached it's end of life.<br>
+ *
+ * @param drawable the to be removed drawable
+ */
+ void remove(GLAutoDrawable drawable);
}
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index 12ded8736..cde327a07 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -40,7 +40,6 @@
package javax.media.opengl;
-import javax.media.opengl.glu.*;
import com.jogamp.opengl.impl.Debug;
import java.security.*;
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index 3d2e2bcc9..82f83dc82 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -59,7 +59,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
private boolean doubleBuffered = true;
private boolean stereo = false;
private boolean hardwareAccelerated = true;
- private int depthBits = 24;
+ private int depthBits = 16;
private int stencilBits = 0;
private int accumRedBits = 0;
private int accumGreenBits = 0;
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index f2016a23c..265c7ff49 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -347,10 +347,17 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
}
if(null!=context) {
- boolean animatorWasAnimating = false;
+ boolean animatorPaused = false;
GLAnimatorControl animator = getAnimator();
if(null!=animator) {
- animatorWasAnimating = animator.isAnimating();
+ if(regenerate) {
+ if(animator.isStarted() && !animator.isPaused()) {
+ animator.pause();
+ animatorPaused = true;
+ }
+ } else {
+ animator.remove(this);
+ }
}
disposeRegenerate=regenerate;
@@ -376,8 +383,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
drawableHelper.invokeGL(drawable, context, disposeAction, null);
}
- if(regenerate && animatorWasAnimating && animator.isPaused()) {
- animator.resume();
+ if(animatorPaused) {
+ animator.resume();
}
}
if(!regenerate) {