Upstream fixes for vulkan surface creation and the retina hint
https://github.com/glfw/glfw/commit/e108c0de0d531123b560931c07c5a226e7d7a3da https://github.com/glfw/glfw/commit/980fc9b52f397ec54ce65f69abe9ff694622b4ab
This commit is contained in:
Vendored
+1
@@ -117,6 +117,7 @@ typedef struct _GLFWwindowNS
|
||||
id layer;
|
||||
|
||||
GLFWbool maximized;
|
||||
GLFWbool retina;
|
||||
|
||||
// Cached window properties to filter out duplicate events
|
||||
int width, height;
|
||||
|
||||
+5
-12
@@ -592,14 +592,6 @@ static GLFWapplicationshouldhandlereopenfun handle_reopen_callback = NULL;
|
||||
_glfwInputWindowDamage(window);
|
||||
}
|
||||
|
||||
- (id)makeBackingLayer
|
||||
{
|
||||
if (window->ns.layer)
|
||||
return window->ns.layer;
|
||||
|
||||
return [super makeBackingLayer];
|
||||
}
|
||||
|
||||
- (void)cursorUpdate:(NSEvent *)event
|
||||
{
|
||||
updateCursorImage(window);
|
||||
@@ -728,7 +720,7 @@ static GLFWapplicationshouldhandlereopenfun handle_reopen_callback = NULL;
|
||||
window->ns.yscale = yscale;
|
||||
_glfwInputWindowContentScale(window, xscale, yscale);
|
||||
|
||||
if (window->ns.layer)
|
||||
if (window->ns.retina && window->ns.layer)
|
||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||
}
|
||||
}
|
||||
@@ -1285,8 +1277,7 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
||||
|
||||
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
||||
|
||||
if (wndconfig->ns.retina)
|
||||
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
||||
window->ns.retina = wndconfig->ns.retina;
|
||||
|
||||
if (fbconfig->transparent)
|
||||
{
|
||||
@@ -2031,7 +2022,9 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
|
||||
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
||||
}
|
||||
|
||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||
if (window->ns.retina)
|
||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||
[window->ns.view setLayer:window->ns.layer];
|
||||
[window->ns.view setWantsLayer:YES];
|
||||
|
||||
memset(&sci, 0, sizeof(sci));
|
||||
|
||||
@@ -299,6 +299,9 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
|
||||
[window->context.nsgl.object setValues:&opaque forParameter:NSOpenGLContextParameterSurfaceOpacity];
|
||||
}
|
||||
|
||||
if (window->ns.retina)
|
||||
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
||||
|
||||
[window->context.nsgl.object setView:window->ns.view];
|
||||
|
||||
window->context.makeCurrent = makeContextCurrentNSGL;
|
||||
|
||||
Reference in New Issue
Block a user