aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-02-16 06:23:43 +0100
committerSven Gothel <[email protected]>2015-02-16 06:23:43 +0100
commit70faf070f50ea66fd4cc8f5f586614810f378787 (patch)
treec4e1175587337386620c823927c017c6fd68c727 /src/newt/classes/com/jogamp
parent1eea4278f1be5900f0d990d0a7d352923def217c (diff)
Bug 1129 - NEWT MonitorDevice's physical size on Windows must be read via EDID
On Windows, one must read the monitor's EDID data as stored in the registry, no 'simple' API works otherwise. The proper way requires utilizing the Windows Setup-API. This code is inspired by Ofek Shilon's code and blog post: <http://ofekshilon.com/2014/06/19/reading-specific-monitor-dimensions/> See: function 'NewtEDID_GetMonitorSizeFromEDIDByModelName' In contrast to Ofek's code, function 'NewtEDID_GetMonitorSizeFromEDIDByDevice' uses the proper link from DISPLAY_DEVICE.DeviceID -> SP_DEVICE_INTERFACE_DETAIL_DATA.DevicePath, where DISPLAY_DEVICE.DeviceID is the monitor's enumeration via: EnumDisplayDevices(adapterName, monitor_idx, &ddMon, EDD_GET_DEVICE_INTERFACE_NAME); Hence the path to the registry-entry is well determined instead of just comparing the monitor's model name.
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index d638b3ae5..e15f52730 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -1004,6 +1004,11 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
glWindow.addGLEventListener(new GLEventListener() {
@Override
public void init(final GLAutoDrawable drawable) {
+ final MonitorDevice monitor = glWindow.getMainMonitor();
+ System.err.println("Main Monitor: "+monitor);
+ final float[] pixelPerMM = monitor.getPixelsPerMM(new float[2]);
+ System.err.println(" pp/mm ["+pixelPerMM[0]+", "+pixelPerMM[1]+"]");
+ System.err.println(" pp/in ["+pixelPerMM[0]*25.4f+", "+pixelPerMM[1]*25.4f+"]");
final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null));
System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());