1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-22 18:28:52 -05:00

Cocoa: Set CAMetalLayer contents scale from window

Fixes #1229.
This commit is contained in:
Camilla Löwy 2018-03-20 18:33:35 +01:00
parent 5f8108e8a9
commit 2884915000

View File

@ -582,6 +582,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
window->ns.xscale = xscale;
window->ns.yscale = yscale;
_glfwInputWindowContentScale(window, xscale, yscale);
if (window->ns.layer)
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
}
}
@ -1871,6 +1874,7 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
[window->ns.view setWantsLayer:YES];
memset(&sci, 0, sizeof(sci));