From 15bc7aea648958c173654046fa66f3cda94144a5 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 4 Jan 2016 22:00:04 -0500 Subject: [PATCH] Mac: allows apps to use OpenGL on a slower, integrated GPU. This is often useful for SDL apps that aren't meant to be games: the integrated GPU starts up faster, uses less power, and is often more than fast enough. Note that even with this change, the app will still default to the more powerful, discrete GPU if one is available; an app that prefers the integrated GPU will still need the NSSupportsAutomaticGraphicsSwitching key properly set in its Info.plist and Mac OS X 10.7 or later. https://developer.apple.com/library/mac/qa/qa1734/_index.html --- src/video/cocoa/SDL_cocoaopengl.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index aa36099844a19..645e5ba45dc96 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -173,6 +173,8 @@ - (void)setWindow:(SDL_Window *)newWindow return NULL; } + attr[i++] = NSOpenGLPFAAllowOfflineRenderers; + /* specify a profile if we're on Lion (10.7) or later. */ if (lion_or_later) { NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;