aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-09-05 02:28:41 +0200
committerSven Gothel <[email protected]>2023-09-05 02:28:41 +0200
commitb91fe4cd16646f134ce8242af30a9f69ecc6ca3e (patch)
treeb894bb087e289f138483c55104775c007ad28930 /src
parent05bb1255e9feab213fb2cc463049623a57c2e1fa (diff)
GraphUI Scene: Add invoke(boolean wait, GLRunnable) for convenience using GLAutoDrawable.invoke(..)
Diffstat (limited to 'src')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Scene.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
index 2cb392c83..c9b28b78a 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
@@ -374,6 +374,27 @@ public final class Scene implements Container, GLEventListener {
}
/**
+ * Enqueues a one-shot {@link GLRunnable},
+ * which will be executed within the next {@link GLAutoDrawable#display()} call
+ * if this {@link Scene} has been added as a {@link GLEventListener} and {@link #init(GLAutoDrawable)} has been called.
+ * <p>
+ * See {@link GLAutoDrawable#invoke(boolean, GLRunnable)}.
+ * </p>
+ *
+ * @param wait if <code>true</code> block until execution of <code>glRunnable</code> is finished, otherwise return immediately w/o waiting
+ * @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
+ * @return <code>true</code> if the {@link GLRunnable} has been processed or queued, otherwise <code>false</code>.
+ * @throws IllegalStateException in case of a detected deadlock situation ahead, see above.
+ * @see GLAutoDrawable#invoke(boolean, GLRunnable)
+ */
+ public boolean invoke(final boolean wait, final GLRunnable glRunnable) throws IllegalStateException {
+ if( null != cDrawable ) {
+ return cDrawable.invoke(wait, glRunnable);
+ }
+ return false;
+ }
+
+ /**
* Reshape scene using {@link #setupMatrix(PMVMatrix, int, int, int, int)} using {@link PMVMatrixSetup}.
* <p>
* {@inheritDoc}