Mac: allows apps to use OpenGL on a slower, integrated GPU.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 04 Jan 2016 22:00:04 -0500
changeset 10008fb4e35d0d523
parent 10007 61058b90b9ae
child 10009 8c6b05b0a27e
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
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Mon Jan 04 16:36:42 2016 -0500
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Mon Jan 04 22:00:04 2016 -0500
     1.3 @@ -173,6 +173,8 @@
     1.4          return NULL;
     1.5      }
     1.6  
     1.7 +    attr[i++] = NSOpenGLPFAAllowOfflineRenderers;
     1.8 +
     1.9      /* specify a profile if we're on Lion (10.7) or later. */
    1.10      if (lion_or_later) {
    1.11          NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;