Add GLFW_SCALE_FRAMEBUFFER window hint

This adds the GLFW_SCALE_FRAMEBUFFER window hint, enabling control of
framebuffer scaling across Wayland and macOS.  On macOS, this window
hint is a new name for GLFW_COCOA_RETINA_FRAMEBUFFER, and both hint
names will modify the same hint.

This is now a more symmetric counterpart to GLFW_SCALE_TO_MONITOR and,
weirdly, they each apply neatly to half of the supported platforms.

This commit is mostly documentation updates to better integrate and
contrast these two scaling mechanisms.
This commit is contained in:
Camilla Löwy
2024-02-07 20:04:14 +01:00
parent 63397fb0d5
commit a9cc7c7260
12 changed files with 92 additions and 44 deletions

View File

@@ -150,16 +150,8 @@ float xscale, yscale;
glfwGetMonitorContentScale(monitor, &xscale, &yscale);
```
The content scale is the ratio between the current DPI and the platform's
default DPI. This is especially important for text and any UI elements. If the
pixel dimensions of your UI scaled by this look appropriate on your machine then
it should appear at a reasonable size on other machines regardless of their DPI
and scaling settings. This relies on the system DPI and scaling settings being
somewhat correct.
The content scale may depend on both the monitor resolution and pixel density
and on user settings. It may be very different from the raw DPI calculated from
the physical size and current resolution.
For more information on what the content scale is and how to use it, see
[window content scale](@ref window_scale).
### Virtual position {#monitor_pos}