diff options
author | Sven Gothel <[email protected]> | 2015-03-27 13:01:44 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-27 13:01:44 +0100 |
commit | 3b7a8f5f4e89adf84fd871c1440859ed3d89802e (patch) | |
tree | f261be0fa8a85e3237d8e6dc4a1b9839beec4045 /src/newt/classes/com/jogamp | |
parent | eae39dbad70d6ecfe0f47766ee8afe99890e7337 (diff) |
StereoDeviceUtil: Only rotate if current mode doesn't match required rotation. Add verbosity.
Allowing user to permanently rotate the device ..
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/util/stereo/StereoDeviceUtil.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/util/stereo/StereoDeviceUtil.java b/src/newt/classes/com/jogamp/newt/opengl/util/stereo/StereoDeviceUtil.java index 762608fd4..24eba6ec1 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/util/stereo/StereoDeviceUtil.java +++ b/src/newt/classes/com/jogamp/newt/opengl/util/stereo/StereoDeviceUtil.java @@ -72,7 +72,10 @@ public class StereoDeviceUtil { final Screen screen = NewtFactory.createScreen(display, 0); screen.addReference(); final MonitorDevice monitor = screen.getMainMonitor(rect); - if( adjustRotation && 0 != deviceReqRotation ) { + System.err.println("StereoDevice Monitor: "+monitor); + final MonitorMode currentMode = monitor.getCurrentMode(); + if( adjustRotation && deviceReqRotation != currentMode.getRotation() ) { + System.err.println("StereoDevice Current Mode: "+currentMode+", requires rotation: "+deviceReqRotation); final DimensionImmutable deviceRotRes; if( 90 == deviceReqRotation || 270 == deviceReqRotation ) { deviceRotRes = new Dimension(deviceRes.getHeight(), deviceRes.getWidth()); @@ -83,8 +86,12 @@ public class StereoDeviceUtil { final List<MonitorMode> mmodes1 = MonitorModeUtil.filterByResolution(mmodes0, deviceRotRes); final List<MonitorMode> mmodes2 = MonitorModeUtil.filterByRotation(mmodes1, deviceReqRotation); if( mmodes2.size() > 0 ) { - monitor.setCurrentMode(mmodes2.get(0)); + final MonitorMode newMode = mmodes2.get(0); + System.err.println("StereoDevice Set Mode: "+newMode); + monitor.setCurrentMode(newMode); } + } else { + System.err.println("StereoDevice Keeps Mode: "+currentMode); } return monitor; } |