summaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-21 09:42:49 +0100
committerSven Gothel <[email protected]>2023-03-21 09:42:49 +0100
commit989a20559ebaa387f8f253c8415e41f6da925d82 (patch)
tree308739709b977f8787d9f17eeb5512570db33948 /src/demos/com/jogamp
parent59a7fdeb4ed36f0014ba1fdcc0ec144c04aaa2d5 (diff)
GraphUI UISceneDemo*: Use lambdas for GLAutoDrawable.invoke(..) to reduce LOC
GLAutoDrawable.invoke(..) API doc: Add semantics about GLRunnable return value.
Diffstat (limited to 'src/demos/com/jogamp')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java9
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
index df0f681ad..028e0f6e3 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
@@ -159,12 +159,9 @@ public class UISceneDemo00 {
// Move on GL thread to have vsync for free
// Otherwise we would need to employ a sleep(..) w/ manual vsync
- window.invoke(true, new GLRunnable() {
- @Override
- public boolean run(final GLAutoDrawable drawable) {
- shape.move(dx, 0f, 0f);
- return true;
- }
+ window.invoke(true, (drawable) -> {
+ shape.move(dx, 0f, 0f);
+ return true;
});
}
final float has_dur_s = ( ( Clock.currentNanos() / 1000 ) - t0_us ) / 1e6f; // [us]
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
index 436c0d847..4649cc301 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
@@ -168,12 +168,9 @@ public class UISceneDemo01 {
// Move on GL thread to have vsync for free
// Otherwise we would need to employ a sleep(..) w/ manual vsync
- window.invoke(true, new GLRunnable() {
- @Override
- public boolean run(final GLAutoDrawable drawable) {
- shape.move(dx, 0f, 0f);
- return true;
- }
+ window.invoke(true, (drawable) -> {
+ shape.move(dx, 0f, 0f);
+ return true;
});
}
final float has_dur_s = ( ( Clock.currentNanos() / 1000 ) - t0_us ) / 1e6f; // [us]