summaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java15
-rw-r--r--src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java9
2 files changed, 21 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
index 410907bee..321d4ee57 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLStateKeeper.java
@@ -56,6 +56,7 @@ public interface GLStateKeeper {
* @return <code>true</code> if GL state preservation is supported in implementation and on current platform, <code>false</code> otherwise.
* @see #preserveGLStateAtDestroy(boolean)
* @see #getPreservedGLState()
+ * @see #clearPreservedGLState()
*/
public boolean isGLStatePreservationSupported();
@@ -73,6 +74,7 @@ public interface GLStateKeeper {
* @return <code>true</code> if supported and successful, <code>false</code> otherwise.
* @see #isGLStatePreservationSupported()
* @see #getPreservedGLState()
+ * @see #clearPreservedGLState()
*/
public boolean preserveGLStateAtDestroy(boolean value);
@@ -81,7 +83,18 @@ public interface GLStateKeeper {
* otherwise <code>null</code>.
* @see #isGLStatePreservationSupported()
* @see #preserveGLStateAtDestroy(boolean)
+ * @see #clearPreservedGLState()
*/
public GLEventListenerState getPreservedGLState();
-
+
+ /**
+ * Clears the preserved {@link GLEventListenerState} from this {@link GLStateKeeper}, without destroying it.
+ *
+ * @return the preserved and cleared {@link GLEventListenerState} if preservation was performed,
+ * otherwise <code>null</code>.
+ * @see #isGLStatePreservationSupported()
+ * @see #preserveGLStateAtDestroy(boolean)
+ * @see #getPreservedGLState()
+ */
+ public GLEventListenerState clearPreservedGLState();
}
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
index 2f405a8c6..1eb7c618c 100644
--- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
+++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
@@ -121,8 +121,6 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
System.err.println("GLAutoDrawableBase.setPreserveGLStateAtDestroy: ("+Thread.currentThread().getName()+"): "+preserveGLELSAtDestroy+" -> "+value+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle()));
}
preserveGLELSAtDestroy = value;
- } else {
-
}
return res;
}
@@ -135,6 +133,13 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
return glels;
}
+ @Override
+ public final GLEventListenerState clearPreservedGLState() {
+ final GLEventListenerState r = glels;
+ glels = null;
+ return r;
+ }
+
/**
* Pulls the {@link GLEventListenerState} from this {@link GLAutoDrawable}.
*