From 989a20559ebaa387f8f253c8415e41f6da925d82 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 21 Mar 2023 09:42:49 +0100 Subject: GraphUI UISceneDemo*: Use lambdas for GLAutoDrawable.invoke(..) to reduce LOC GLAutoDrawable.invoke(..) API doc: Add semantics about GLRunnable return value. --- src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java | 9 +++------ src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/demos/com/jogamp/opengl') 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] -- cgit v1.2.3