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

@@ -369,6 +369,9 @@ void _glfwUpdateBufferScaleFromOutputsWayland(_GLFWwindow* window)
return;
}
if (!window->wl.scaleFramebuffer)
return;
// Get the scale factor from the highest scale monitor.
int32_t maxScale = 1;
@@ -980,6 +983,7 @@ static GLFWbool createNativeSurface(_GLFWwindow* window,
window->wl.bufferScale = 1;
window->wl.title = _glfw_strdup(wndconfig->title);
window->wl.appId = _glfw_strdup(wndconfig->wl.appId);
window->wl.scaleFramebuffer = wndconfig->scaleFramebuffer;
window->wl.maximized = wndconfig->maximized;