summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
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/jogl/classes/com
parent4d1d546aee01fe27e6b331b23be9be7cc3a5f883 (diff)
Graph: Have RegionRenderer.reshapeNotify(..) track x/y as well (vieport); GraphUI.Scene using RegionRenderer's viewport (no duplicate)
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 8dba6dfac..9fef381f4 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -158,12 +158,12 @@ public class RegionRenderer {
public final boolean isInitialized() { return initialized; }
- /** Copies the current viewport in given target and returns it for chaining. */
+ /** Copies the current int[4] viewport in given target and returns it for chaining. */
public final int[/*4*/] getViewport(final int[/*4*/] target) {
System.arraycopy(viewport, 0, target, 0, 4);
return target;
}
- /** Borrows the current viewport w/o copying. */
+ /** Borrows the current int[4] viewport w/o copying. */
public final int[/*4*/] getViewport() {
return viewport;
}
@@ -279,13 +279,15 @@ public class RegionRenderer {
/**
* No PMVMatrix operation is performed here.
*/
- public final void reshapeNotify(final int width, final int height) {
+ public final void reshapeNotify(final int x, final int y, final int width, final int height) {
+ viewport[0] = x;
+ viewport[1] = y;
viewport[2] = width;
viewport[3] = height;
}
public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) {
- reshapeNotify(width, height);
+ reshapeNotify(0, 0, width, height);
final float ratio = (float)width/(float)height;
final PMVMatrix p = rs.getMatrix();
p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
@@ -297,7 +299,7 @@ public class RegionRenderer {
* Perspective orthogonal, method calls {@link #reshapeNotify(int, int, int, int)}.
*/
public final void reshapeOrtho(final int width, final int height, final float near, final float far) {
- reshapeNotify(width, height);
+ reshapeNotify(0, 0, width, height);
final PMVMatrix p = rs.getMatrix();
p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
p.glLoadIdentity();