mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 14:45:46 +00: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:
+3
-3
@@ -513,7 +513,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
|
||||
if (xscale != window->ns.xscale || yscale != window->ns.yscale)
|
||||
{
|
||||
if (window->ns.retina && window->ns.layer)
|
||||
if (window->ns.scaleFramebuffer && window->ns.layer)
|
||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||
|
||||
window->ns.xscale = xscale;
|
||||
@@ -872,7 +872,7 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
||||
[window->ns.object setFrameAutosaveName:@(wndconfig->ns.frameName)];
|
||||
|
||||
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
||||
window->ns.retina = wndconfig->ns.retina;
|
||||
window->ns.scaleFramebuffer = wndconfig->scaleFramebuffer;
|
||||
|
||||
if (fbconfig->transparent)
|
||||
{
|
||||
@@ -1969,7 +1969,7 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
|
||||
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
||||
}
|
||||
|
||||
if (window->ns.retina)
|
||||
if (window->ns.scaleFramebuffer)
|
||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||
|
||||
[window->ns.view setLayer:window->ns.layer];
|
||||
|
||||
Reference in New Issue
Block a user