What is difference between screen size and pixel size?

48 Views Asked by At

I'm reading the Vulkan documentation on how to set the swap chain size. And I don't understand what the difference is between screen sizes and pixel sizes. How does PPI affect the screen coordinates? For example, we have a 1920 x 1080 monitor with small PPI. If I create a 960 x 540 window, it will be half the size. If we have a 3840 x 2160 monitor and it has a much higher DPI, that window will be 4 times smaller. This is exactly what is logically expected. Maybe I'm wrong and this glfw window is scaled during creation and will also occupy half of second monitor, but I don't know how to check it. I have only one monitor and I have not found clear examples on the Internet. I mean window resolution is not relative, so why PPI influences on it? Help me please I am totally puzzled.

1

There are 1 best solutions below

0
Karl Schultz On

The term resolution is a badly overloaded word. I've always tried to avoid using it when describing frame buffer or monitor pixel dimensions. And I don't complain when others use the term this way as it is common practice and is described really well here in this article. The article even says that using it to describe pixel dimensions is a misnomer and that the proper usage is for pixel density (DPI).

That being said, the Vulkan API has you specifying windows in terms of display resolution (pixel dimensions) and the actual physical size of the window depends on the monitor's pixel density. If you wanted to draw something that measures 1 inch on the monitor, you'd have to query the monitor's DPI and then figure out how many pixels to draw.

This sort of usage may not be common. A more frequent issue is drawing text on high-DPI displays where you have to take some steps to draw the text with more pixels in order to be able to read it and/or retain the expected point size.