I'm going to make some materials for low-level rendering, but I need to know the actual DPI display to create the right size.
I found one way to do this: java.awt.Toolkit.getDefaultToolkit().getScreenResolution() - but it returns an incorrect result on OS X with a retina display, it is 1/2 of the actual DPI. (In my case, it should be 220, but it's 110)
Thus, any other, more correct API should be accessible, or, alternatively, I need to implement a hack only for OS X - somehow find if the current display is "retina". But I could not find a way to request this information. There is this answer , but on my machine Toolkit.getDefaultToolkit().getDesktopProperty("apple.awt.contentScaleFactor") just returns null.
How can i do this?
java dpi retina-display macos
Sarge borsch
source share