summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-02-17 01:14:49 +0100
committerSven Gothel <[email protected]>2015-02-17 01:14:49 +0100
commit559ecad2a2387ba0aa34ce9e35ca8a2c5a31e655 (patch)
treea9ba7f77524851deb54269fc455aa529edfbd018 /src/test
parent42d88f99cfa62304943a7b37700653e627b13e61 (diff)
NEWT MonitorDevice: Identify cloned devices (fully covered) ; Windows: Iterate-over and identify all adapter:monitor. (Bug 1129)
- Identify cloned devices (fully covered) - MonitorDevice gets 'isCloned()' to identify whether it is a cloned device, i.e. fully covered by another monitor. This detection may happen natively but will always performed platform agnostic. - getMainMonitor(..) now exclude 'cloned' devices - Windows: Iterate-over and identify all adapter:monitor - Since we also list cloned monitor, we need to iterate over all adapter and all it's monitor-devices. - The native monitor-id is now defined as: ( adapter-idx << 8 ) | monitor-idx. - Bug 1129 <- listed under this bug entry for convenience
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
index e103fc490..5285673e9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
@@ -112,7 +112,7 @@ public class TestScreenMode00aNEWT extends UITestCase {
final Rectangle viewport = new Rectangle(0, 0, 1920, 1080);
final ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>();
supportedModes.add(modeOut);
- final MonitorDevice monOut = new MonitorDeviceImpl(null, -1, sizeMM, modeOut, null, viewport, viewport, supportedModes);
+ final MonitorDevice monOut = new MonitorDeviceImpl(null, -1, false, sizeMM, modeOut, null, viewport, viewport, supportedModes);
System.err.println("01 out : "+monOut);
cache.monitorDevices.add(monOut);
{
@@ -169,13 +169,12 @@ public class TestScreenMode00aNEWT extends UITestCase {
final List<MonitorDevice> monitors = screen.getMonitorDevices();
Assert.assertTrue(monitors.size()>0);
+
+ // Dump all Monitor's and its modes
int j=0;
for(final Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
final MonitorDevice monitor = iMonitor.next();
System.err.println(j+": "+monitor);
- final float[] pixelPerMM = monitor.getPixelsPerMM(new float[2]);
- System.err.println(j+" pp/mm ["+pixelPerMM[0]+", "+pixelPerMM[1]+"]");
- System.err.println(j+" pp/in ["+pixelPerMM[0]*25.4f+", "+pixelPerMM[1]*25.4f+"]");
final List<MonitorMode> modes = monitor.getSupportedModes();
Assert.assertTrue(modes.size()>0);
int i=0;
@@ -189,7 +188,16 @@ public class TestScreenMode00aNEWT extends UITestCase {
mmPre = mm;
}
Assert.assertTrue(allMonitorModes.containsAll(modes));
+ }
+ // Dump all Monitor's and its DPI and current/original mode
+ j=0;
+ for(final Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
+ final MonitorDevice monitor = iMonitor.next();
+ System.err.println(j+": "+monitor);
+ final float[] pixelPerMM = monitor.getPixelsPerMM(new float[2]);
+ System.err.println(j+" pixel/mm ["+pixelPerMM[0]+", "+pixelPerMM[1]+"]");
+ System.err.println(j+" pixel/in ["+pixelPerMM[0]*25.4f+", "+pixelPerMM[1]*25.4f+"]");
final MonitorMode sm_o = monitor.getOriginalMode();
Assert.assertNotNull(sm_o);
final MonitorMode sm_c = monitor.queryCurrentMode();