Add GLFW_COCOA_GRAPHICS_SWICTHING

This provides control over whether the context should participate in
macOS Automatic Graphics Switching.

Closes #377.
Closes #935.
This commit is contained in:
Camilla Löwy
2017-01-27 12:02:09 +01:00
parent 4250725a60
commit 77a8f103d8
7 changed files with 47 additions and 0 deletions
+12
View File
@@ -160,6 +160,18 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
ADD_ATTR(NSOpenGLPFAAccelerated);
ADD_ATTR(NSOpenGLPFAClosestPolicy);
if (ctxconfig->nsgl.offline)
{
ADD_ATTR(NSOpenGLPFAAllowOfflineRenderers);
// NOTE: This replaces the NSSupportsAutomaticGraphicsSwitching key in
// 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
ADD_ATTR(kCGLPFASupportsAutomaticGraphicsSwitching);
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
if (ctxconfig->major >= 4)
{