summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-08 22:50:22 +0200
committerSven Gothel <[email protected]>2014-06-08 22:50:22 +0200
commit14ff638b63fc7adaa59f351891f6a38806d7fa5d (patch)
tree0c61ee420775df3730da1452033463460a1cd954 /src/test
parent58153310faa4089417037e67e06c0812908cecd2 (diff)
NEWT Window: Remove deprecated methods: HiDPI + reparentWindow(..)
Remove HiDPI pixel- from/to window-unit conversion and getter methods: Rectangle HiDPI pixel- from/to window-units are erroneous in case of multiple monitor setup where a mixed pixel-scale exist, since the methods didn't take the monitor viewport and each of it's pixel-scale into account (expensive). Remove deprecated reparentWindow(..) methods.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java14
4 files changed, 25 insertions, 20 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
index 3a5e96880..714e75695 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
@@ -57,6 +57,7 @@ import java.util.List;
import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.Rectangle;
/**
@@ -127,9 +128,9 @@ public class TestScreenMode00cNEWT extends UITestCase {
Assert.assertNotNull(window0);
Rectangle window0WindowBounds = window0.getBounds();
- Rectangle window0SurfaceBounds = window0.getSurfaceBounds();
+ DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.0: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.0: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.0: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.0: Screen viewport : "+screen.getViewport()+" [pixels]");
final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
@@ -190,9 +191,9 @@ public class TestScreenMode00cNEWT extends UITestCase {
System.err.println("[1] has current cached : "+mmCachedCurrent);
System.err.println("[1] has current queried : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.1: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.1: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.1: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.1: Screen viewport : "+screen.getViewport()+" [pixels]");
Assert.assertTrue(monitor.isModeChangedByUs());
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
index 808571d05..cb9192a70 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
@@ -56,6 +56,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
import java.util.List;
import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.Rectangle;
/**
@@ -130,9 +131,9 @@ public class TestScreenMode01aNEWT extends UITestCase {
final MonitorDevice monitor = screen.getMonitorDevices().get(0);
Rectangle window0WindowBounds = window0.getBounds();
- Rectangle window0SurfaceBounds = window0.getSurfaceBounds();
+ DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.0: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.0: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.0: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.0: Screen viewport : "+screen.getViewport()+" [pixels], "+screen.getViewportInWindowUnits()+" [wu]");
System.err.println("Test.0: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
@@ -193,9 +194,9 @@ public class TestScreenMode01aNEWT extends UITestCase {
System.err.println("[1] has current cached : "+mmCachedCurrent);
System.err.println("[1] has current queried : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.1: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.1: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.1: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.1: Screen viewport : "+screen.getViewport()+" [pixels], "+screen.getViewportInWindowUnits()+" [wu]");
System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
index 6bf9831dc..e862e6b8e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
@@ -57,6 +57,7 @@ import com.jogamp.opengl.util.Animator;
import java.util.List;
import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.Rectangle;
import javax.media.nativewindow.util.RectangleImmutable;
@@ -157,9 +158,9 @@ public class TestScreenMode01bNEWT extends UITestCase {
GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
Assert.assertNotNull(window0);
Rectangle window0WindowBounds = window0.getBounds();
- Rectangle window0SurfaceBounds = window0.getSurfaceBounds();
+ DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.0: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.0: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.0: Window size : "+window0SurfaceSize+" [pixels]");
final Animator anim = new Animator(window0);
anim.start();
@@ -226,10 +227,10 @@ public class TestScreenMode01bNEWT extends UITestCase {
}
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.1: Screen : "+screen);
System.err.println("Test.1: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.1: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.1: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.1: Screen viewport : "+screen.getViewport()+" [pixels]");
System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
System.err.println("Test.1: Window main-mon : "+window0.getMainMonitor());
@@ -253,10 +254,10 @@ public class TestScreenMode01bNEWT extends UITestCase {
}
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.2: Screen : "+screen);
System.err.println("Test.2: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.2: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.2: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.2: Screen viewport : "+screen.getViewport()+" [pixels]");
System.err.println("Test.2: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
System.err.println("Test.2: Window main-mon : "+window0.getMainMonitor());
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
index 986f92273..bbc1cb2da 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
@@ -56,6 +56,8 @@ import com.jogamp.opengl.util.Animator;
import java.util.ArrayList;
import java.util.List;
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.Rectangle;
import javax.media.nativewindow.util.RectangleImmutable;
@@ -201,9 +203,9 @@ public class TestScreenMode01cNEWT extends UITestCase {
GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
Assert.assertNotNull(window0);
Rectangle window0WindowBounds = window0.getBounds();
- Rectangle window0SurfaceBounds = window0.getSurfaceBounds();
+ DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.0: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.0: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.0: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.0: Screen viewport : "+screen.getViewport()+" [pixels]");
final Animator anim = new Animator(window0);
@@ -222,9 +224,9 @@ public class TestScreenMode01cNEWT extends UITestCase {
monitor = window0.getMainMonitor();
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
System.err.println("Test.1: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.1: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.1: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.1: Screen viewport : "+screen.getViewport()+" [pixels]");
System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
if( !spanAcrossMonitors ) {
@@ -244,10 +246,10 @@ public class TestScreenMode01cNEWT extends UITestCase {
window0.setFullscreen(false);
window0WindowBounds = window0.getBounds();
- window0SurfaceBounds = window0.getSurfaceBounds();
+ window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());;
monitor = window0.getMainMonitor();
System.err.println("Test.2: Window bounds : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
- System.err.println("Test.2: Window bounds : "+window0SurfaceBounds+" [pixels]");
+ System.err.println("Test.2: Window size : "+window0SurfaceSize+" [pixels]");
System.err.println("Test.2: Screen viewport : "+screen.getViewport()+" [pixels]");
System.err.println("Test.2: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");