From 559ecad2a2387ba0aa34ce9e35ca8a2c5a31e655 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 17 Feb 2015 01:14:49 +0100 Subject: 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 --- .../opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/test') 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 supportedModes = new ArrayHashSet(); 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 monitors = screen.getMonitorDevices(); Assert.assertTrue(monitors.size()>0); + + // Dump all Monitor's and its modes int j=0; for(final Iterator 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 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 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(); -- cgit v1.2.3