mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
parent
e108c0de0d
commit
980fc9b52f
@ -110,6 +110,7 @@ typedef struct _GLFWwindowNS
|
|||||||
id layer;
|
id layer;
|
||||||
|
|
||||||
GLFWbool maximized;
|
GLFWbool maximized;
|
||||||
|
GLFWbool retina;
|
||||||
|
|
||||||
// Cached window properties to filter out duplicate events
|
// Cached window properties to filter out duplicate events
|
||||||
int width, height;
|
int width, height;
|
||||||
|
@ -534,7 +534,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
window->ns.yscale = yscale;
|
window->ns.yscale = yscale;
|
||||||
_glfwInputWindowContentScale(window, xscale, yscale);
|
_glfwInputWindowContentScale(window, xscale, yscale);
|
||||||
|
|
||||||
if (window->ns.layer)
|
if (window->ns.retina && window->ns.layer)
|
||||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -842,9 +842,7 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
|||||||
[window->ns.object setFrameAutosaveName:@(wndconfig->ns.frameName)];
|
[window->ns.object setFrameAutosaveName:@(wndconfig->ns.frameName)];
|
||||||
|
|
||||||
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
||||||
|
window->ns.retina = wndconfig->ns.retina;
|
||||||
if (wndconfig->ns.retina)
|
|
||||||
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
|
||||||
|
|
||||||
if (fbconfig->transparent)
|
if (fbconfig->transparent)
|
||||||
{
|
{
|
||||||
@ -1728,7 +1726,9 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
|
|||||||
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
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 setLayer:window->ns.layer];
|
||||||
[window->ns.view setWantsLayer:YES];
|
[window->ns.view setWantsLayer:YES];
|
||||||
|
|
||||||
|
@ -360,6 +360,9 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
|
|||||||
forParameter:NSOpenGLContextParameterSurfaceOpacity];
|
forParameter:NSOpenGLContextParameterSurfaceOpacity];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window->ns.retina)
|
||||||
|
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
|
|
||||||
[window->context.nsgl.object setView:window->ns.view];
|
[window->context.nsgl.object setView:window->ns.view];
|
||||||
|
|
||||||
window->context.nsgl.swapIntervalCond = [NSCondition new];
|
window->context.nsgl.swapIntervalCond = [NSCondition new];
|
||||||
|
Loading…
Reference in New Issue
Block a user