From 48538c0e25899dfb6590f231d3230365e4e9f9c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Mar 2018 15:07:25 +0530 Subject: [PATCH] Update bundled glfw --- glfw/cocoa_window.m | 4 ++++ glfw/glfw3.h | 2 +- glfw/internal.h | 2 +- glfw/nsgl_context.m | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 247593564..cbeffd12a 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -582,6 +582,9 @@ - (void)viewDidChangeBackingProperties 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)); diff --git a/glfw/glfw3.h b/glfw/glfw3.h index 8bbf4c774..224c3e606 100644 --- a/glfw/glfw3.h +++ b/glfw/glfw3.h @@ -4901,7 +4901,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid); * * Not all devices have all the buttons or axes provided by @ref * GLFWgamepadstate. Unavailable buttons and axes will always report - * `GLFW_RELEASE` and 1.0 respectively. + * `GLFW_RELEASE` and 0.0 respectively. * * @param[in] jid The [joystick](@ref joysticks) to query. * @param[out] state The gamepad input state of the joystick. diff --git a/glfw/internal.h b/glfw/internal.h index 3e83ad9cc..529a77f92 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -128,7 +128,7 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000053000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } VkStructureType; diff --git a/glfw/nsgl_context.m b/glfw/nsgl_context.m index a7cbf00f3..82af90636 100644 --- a/glfw/nsgl_context.m +++ b/glfw/nsgl_context.m @@ -175,7 +175,7 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window, // Info.plist for unbundled applications // HACK: This assumes that NSOpenGLPixelFormat will remain // a straightforward wrapper of its CGL counterpart -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 100800 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 addAttrib(kCGLPFASupportsAutomaticGraphicsSwitching); #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ }