Commit 84377c61 authored by Camilla Berglund's avatar Camilla Berglund
Browse files

Added _GLFW_USE_RETINA.

parent b4c03b99
......@@ -26,6 +26,7 @@ if (APPLE)
option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF)
option(GLFW_USE_CHDIR "Make glfwInit chdir to Contents/Resources" ON)
option(GLFW_USE_MENUBAR "Populate the menu bar on first window creation" ON)
option(GLFW_USE_RETINA "Use the full resolution of Retina displays" ON)
else()
option(GLFW_USE_EGL "Use EGL for context creation" OFF)
endif()
......@@ -340,6 +341,10 @@ if (_GLFW_COCOA AND _GLFW_NSGL)
set(_GLFW_USE_CHDIR 1)
endif()
if (GLFW_USE_RETINA)
set(_GLFW_USE_RETINA 1)
endif()
if (GLFW_BUILD_UNIVERSAL)
message(STATUS "Building GLFW as Universal Binaries")
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
......
......@@ -47,6 +47,8 @@ The following dependencies are needed by the examples and test programs:
- Added native monitor handle access to native API
- Added `glfwSetDropCallback` and `GLFWdropfun` for receiving dropped files
- [Cocoa] Added `_GLFW_USE_RETINA` to control whether windows will use the full
resolution on Retina displays
- [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen
recorders to fail
- [Win32] Bugfix: Failure to load winmm or its functions was not reported to
......
......@@ -165,6 +165,9 @@ directory of bundled applications to the `Contents/Resources` directory.
`GLFW_USE_MENUBAR` determines whether the first call to
`glfwCreateWindow` sets up a minimal menu bar.
`GLFW_USE_RETINA` determines whether windows will use the full resolution of
Retina displays.
`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries.
......@@ -257,5 +260,7 @@ available:
application bundle during @ref glfwInit (recommended)
- `_GLFW_USE_MENUBAR` to create and populate the menu bar when the first window
is created (recommended)
- `_GLFW_USE_RETINA` to have windows use the full resolution of Retina displays
(recommended)
*/
......@@ -132,6 +132,9 @@ const char* _glfwPlatformGetVersionString(void)
#if defined(_GLFW_USE_MENUBAR)
" menubar"
#endif
#if defined(_GLFW_USE_RETINA)
" retina"
#endif
#if defined(_GLFW_BUILD_DLL)
" dynamic"
#endif
......
......@@ -940,7 +940,9 @@ static GLboolean createWindow(_GLFWwindow* window,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
{
#if defined(_GLFW_USE_RETINA)
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
#endif
if (wndconfig->resizable)
[window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
......
......@@ -73,6 +73,8 @@
#cmakedefine _GLFW_USE_CHDIR
// Define this to 1 if glfwCreateWindow should populate the menu bar
#cmakedefine _GLFW_USE_MENUBAR
// Define this to 1 if windows should use full resolution on Retina displays
#cmakedefine _GLFW_USE_MENUBAR
// Define this to 1 if using OpenGL as the client library
#cmakedefine _GLFW_USE_OPENGL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment