mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 23:33:16 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user