getting the physical screen size in inches or mm

getting the physical screen size in inches or mm
0.0 0


I want to create a virtual dpad that’s always the same physical size.
This means I have to know the physical screen size (in inches or millimeters or whatever) and the resolution.

I can get the DPI from the device, but this doesn’t tell me anything about the physical screen size - a 1920x1080 screen can be anything from a sony Xperia Z mobile phone to a huge tablet.

Is there a way to get the physical screen size ?
In windows there’s GetDeviceCaps( hScreenDC, HORZRES ) like used in the GetDPI method, but I don’t see any Cocos2D-X cross platform way of getting that ?


Can’t you divide the resolution in pixels by DPI?

Cocos2dx Device::getDpi() confusion on android

Is Dots-per-inch in Cocos2D-X being used as Pixels-per-inch ?
If so then yes, that would be the solution but then the method has the wrong name…