summaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-21 09:50:14 +0100
committerSven Gothel <[email protected]>2023-03-21 09:50:14 +0100
commit701b19241319079552ffc0d77b8913fb2f28dcd7 (patch)
treeda536c9bae41f1696a66330c659bbcb1f42db360 /src/demos/com/jogamp/opengl
parented6b881ed3e1ac3c30f0d5329be08b77b82a70cb (diff)
GraphUI UISceneDemo*: Add windowResized() callback to update window title showing current surfaceSize
Diffstat (limited to 'src/demos/com/jogamp/opengl')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java6
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java7
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo10.java4
3 files changed, 12 insertions, 5 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 028e0f6e3..5a3fc3a65 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
@@ -41,10 +41,8 @@ import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.GL;
-import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
-import com.jogamp.opengl.GLRunnable;
import com.jogamp.opengl.math.geom.AABBox;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.PMVMatrix;
@@ -101,6 +99,10 @@ public class UISceneDemo00 {
window.addGLEventListener(scene);
window.addWindowListener(new WindowAdapter() {
@Override
+ public void windowResized(final WindowEvent e) {
+ window.setTitle(UISceneDemo00.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
+ }
+ @Override
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
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 4649cc301..c4c82cb1c 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
@@ -43,11 +43,8 @@ import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.GL;
-import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLProfile;
-import com.jogamp.opengl.GLRunnable;
import com.jogamp.opengl.demos.es2.GearsES2;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.math.geom.AABBox;
@@ -109,6 +106,10 @@ public class UISceneDemo01 {
window.addGLEventListener(scene);
window.addWindowListener(new WindowAdapter() {
@Override
+ public void windowResized(final WindowEvent e) {
+ window.setTitle(UISceneDemo01.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
+ }
+ @Override
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo10.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo10.java
index b2fcf6de0..c62b887d2 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo10.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo10.java
@@ -197,6 +197,10 @@ public class UISceneDemo10 {
});
window.addWindowListener(new WindowAdapter() {
@Override
+ public void windowResized(final WindowEvent e) {
+ window.setTitle(UISceneDemo10.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
+ }
+ @Override
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}