aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-14 16:41:37 +0100
committerSven Gothel <[email protected]>2023-03-14 16:41:37 +0100
commit94c01e08a59929220686e131d1ce706e5cec6e16 (patch)
tree5e883061b8cfbc93df346d8a92baff2cc99a3bcc /src/demos/com/jogamp
parent4d1d546aee01fe27e6b331b23be9be7cc3a5f883 (diff)
Graph: Have RegionRenderer.reshapeNotify(..) track x/y as well (vieport); GraphUI.Scene using RegionRenderer's viewport (no duplicate)
Diffstat (limited to 'src/demos/com/jogamp')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java27
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java8
3 files changed, 18 insertions, 19 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java b/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java
index 7ab5e6b8c..7fc1d4dd2 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java
@@ -169,7 +169,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
renderer.reshapeOrtho(width, height, 0.1f, 1000.0f);
pixelScale = 1.0f;
} else {
- renderer.reshapeNotify(width, height);
+ renderer.reshapeNotify(x, y, width, height);
}
renderer.enable(gl, false);
}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java
index 588a51fd4..cb1aaa041 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java
@@ -632,8 +632,8 @@ public class GPUUISceneGLListener0A implements GLEventListener {
strings[i++] = "- Mouse Scroll Over Object\n"+
" - General\n"+
- " - Z Translation\n"+
- " - Ctrl: Y-Rotation (Shift: X-Rotation)\n"+
+ " - X-Rotation\n"+
+ " - Shift: Y-Rotation\n"+
" - Tilt, Space and Corner\n"+
" - Their respective action via wheel\n"+
" (shift = other value)\n"+
@@ -641,6 +641,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
"- Mouse Drag On Object\n"+
" - Click on Object and drag mouse\n"+
" - Current postion in status line at bottom\n"+
+ " - Resize when click on 1/4 bottom-left or bottom-right corner.\n"+
"\n"+
"- Tilt Button Rotate Whole Button Group";
@@ -766,16 +767,16 @@ public class GPUUISceneGLListener0A implements GLEventListener {
//
// Layout all shapes: Relational move regarding object coordinates
//
- System.err.println("Reshape: Scene Plane.0 "+scene.getScenePlane());
- final float lastWidth = scene.getScenePlane().getWidth();
- final float lastHeight = scene.getScenePlane().getHeight();
+ System.err.println("Reshape: Scene Plane.0 "+scene.getBounds());
+ final float lastWidth = scene.getBounds().getWidth();
+ final float lastHeight = scene.getBounds().getHeight();
System.err.println("Reshape: Scene Plane.0 "+lastWidth+" x "+lastHeight);
scene.reshape(drawable, x, y, width, height);
- System.err.println("Reshape: Scene Plane.1 "+scene.getScenePlane());
+ System.err.println("Reshape: Scene Plane.1 "+scene.getBounds());
- final float dw = scene.getScenePlane().getWidth() - lastWidth;
- final float dh = scene.getScenePlane().getHeight() - lastHeight;
+ final float dw = scene.getBounds().getWidth() - lastWidth;
+ final float dh = scene.getBounds().getHeight() - lastHeight;
final float dz = 0f;
final float dyTop = dh * relTop;
@@ -795,8 +796,8 @@ public class GPUUISceneGLListener0A implements GLEventListener {
// System.err.println("Button["+i+"].RM: "+buttons.get(i));
}
- final float dxMiddleAbs = scene.getScenePlane().getWidth() * relMiddle;
- final float dyTopLabelAbs = scene.getScenePlane().getHeight() - 2f*jogampLabel.getLineHeight();
+ final float dxMiddleAbs = scene.getBounds().getWidth() * relMiddle;
+ final float dyTopLabelAbs = scene.getBounds().getHeight() - 2f*jogampLabel.getLineHeight();
jogampLabel.setPosition(dxMiddleAbs, dyTopLabelAbs, dz);
truePtSizeLabel.setPosition(dxMiddleAbs, dyTopLabelAbs, dz);
truePtSizeLabel.setPosition(dxMiddleAbs, dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight(), 0f);
@@ -839,9 +840,9 @@ public class GPUUISceneGLListener0A implements GLEventListener {
// System.err.println("GPUUISceneGLListener0A: display");
if(null == labels[currentText]) {
- final float pixelSizeFixed = fontSizeFixedPVV * scene.getScenePlane().getHeight();
- final float dyTop = scene.getScenePlane().getHeight() - 2f*jogampLabel.getLineHeight();
- final float dxMiddle = scene.getScenePlane().getWidth() * relMiddle;
+ final float pixelSizeFixed = fontSizeFixedPVV * scene.getBounds().getHeight();
+ final float dyTop = scene.getBounds().getHeight() - 2f*jogampLabel.getLineHeight();
+ final float dxMiddle = scene.getBounds().getWidth() * relMiddle;
labels[currentText] = new Label(scene.getVertexFactory(), renderModes, font, pixelSizeFixed, strings[currentText]);
labels[currentText].setColor(0.1f, 0.1f, 0.1f, 1.0f);
labels[currentText].setEnabled(enableOthers);
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 89ca5445e..7ba6c135b 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo00.java
@@ -250,9 +250,7 @@ public class UISceneDemo00 implements GLEventListener {
final RegionRenderer renderer = scene.getRenderer();
final PMVMatrix pmv = new PMVMatrix();
- pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
- pmv.glLoadIdentity();
- scene.translate(pmv); // pmv.glTranslatef(0f, 0f, sceneDist);
+ scene.setupMatrix(pmv, 0, 0);
// flip to GL window coordinates, origin bottom-left
final int[] viewport = renderer.getViewport(new int[4]);
@@ -308,11 +306,11 @@ public class UISceneDemo00 implements GLEventListener {
// shape.move(0f, 0f, 0f);
System.err.println("Reshape: Shape "+shape);
- System.err.println("Reshape: Scene Plane.R "+scene.getScenePlane());
+ System.err.println("Reshape: Scene Plane.R "+scene.getBounds());
scene.reshape(drawable, xstart, ystart, width, height);
- System.err.println("Reshape: Scene Plane.R "+scene.getScenePlane());
+ System.err.println("Reshape: Scene Plane.R "+scene.getBounds());
if( drawable instanceof Window ) {
((Window)drawable).setTitle(UISceneDemo00.class.getSimpleName()+": "+drawable.getSurfaceWidth()+" x "+drawable.getSurfaceHeight());