Re: SWT GLCanvas with DPI scaling in Eclipse
Posted by Felix Hirsch on Sep 19, 2018; 8:22am
URL: https://forum.jogamp.org/SWT-GLCanvas-with-DPI-scaling-in-Eclipse-tp4038566p4039228.html
With Eclipse 4.8 (SWT 3.107) Display class provides a new method Display.getDPI (inherrited from Device class) as well as Monitor class provides Monitor.getZoom() (int). As far as I understand the monitor zoom is normalized at a value of 100.
This is not very comfortable but I think you can recalculated the bounds of your controls back to its pixel values with it.
If you have to stay at Eclipse 4.6 you still can use DPIUtil class which lies in swt.internal. This is not public API but when working with GL you sometimes need the exact pixel values. Maybe you can provide a Facade which encapsulates the non public API and replace it later with the new methods from Eclipse 4.8.
Hope this helps
Felix