From 821f3e674a1aefa69e80aadf2bbe1df422913bba Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 16 Mar 2015 22:39:14 +0100 Subject: [PATCH] Enabled High DPI support with custom Info.plist. Fixes #422. --- CMake/AppleInfo.plist | 38 ++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ examples/CMakeLists.txt | 4 +++- include/GLFW/glfw3.h | 7 +++++++ tests/CMakeLists.txt | 3 ++- 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 CMake/AppleInfo.plist diff --git a/CMake/AppleInfo.plist b/CMake/AppleInfo.plist new file mode 100644 index 00000000..b29cde10 --- /dev/null +++ b/CMake/AppleInfo.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${APPLE_GUI_EXECUTABLE} + CFBundleGetInfoString + ${APPLE_GUI_INFO_STRING} + CFBundleIconFile + ${APPLE_GUI_ICON} + CFBundleIdentifier + ${APPLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${APPLE_GUI_LONG_VERSION_STRING} + CFBundleName + ${APPLE_GUI_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${APPLE_GUI_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${APPLE_GUI_BUNDLE_VERSION} + CSResourcesFileMapped + + LSRequiresCarbon + + NSHumanReadableCopyright + ${APPLE_GUI_COPYRIGHT} + NSHighResolutionCapable + + + diff --git a/README.md b/README.md index 2fcf6ade..a1b4698d 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ GLFW bundles a number of dependencies in the `deps/` directory. - Removed support for LCC and Borland C++ - Bugfix: `glfwSetTime` silently accepted invalid values - [WGL] Bugfix: The context flags debug bit was not set for OpenGL ES + - [Cocoa] Bugfix: `NSHighResolutionCapable` was not enabled for test and + example programs - [Cocoa] Bugfix: `glfwSetWindowSize` did not change the video mode for full screen windows - [X11] Added support for Cygwin-X diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 229c4a72..1232279d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -41,7 +41,9 @@ if (APPLE) set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") set_target_properties(Boing Gears Heightmap Particles Simple SplitView Wave PROPERTIES - FOLDER "GLFW3/Examples") + FOLDER "GLFW3/Examples" + MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") + else() # Set boring names for executables add_executable(boing WIN32 boing.c) diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 2859c7af..009fa755 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -1617,6 +1617,13 @@ GLFWAPI void glfwWindowHint(int target, int hint); * The menu bar can be disabled with a * [compile-time option](@ref compile_options_osx). * + * @remarks __OS X:__ On OS X 10.10 and later the window frame will not be + * rendered at full resolution on Retina displays unless the + * `NSHighResolutionCapable` key is enabled in the application bundle's + * `Info.plist`. For more information, see + * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) + * in the Mac Developer Library. + * * @remarks __X11:__ There is no mechanism for setting the window icon yet. * * @remarks __X11:__ Some window managers will not respect the placement of diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5ec68f38..5386f588 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -76,6 +76,7 @@ endif() if (APPLE) set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) + MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL} + MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") endif()