Bläddra i källkod

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
Ryan C. Gordon 10 år sedan
förälder
incheckning
15bc7aea64
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      src/video/cocoa/SDL_cocoaopengl.m

+ 2 - 0
src/video/cocoa/SDL_cocoaopengl.m

@@ -173,6 +173,8 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
         return NULL;
         return NULL;
     }
     }
 
 
+    attr[i++] = NSOpenGLPFAAllowOfflineRenderers;
+
     /* specify a profile if we're on Lion (10.7) or later. */
     /* specify a profile if we're on Lion (10.7) or later. */
     if (lion_or_later) {
     if (lion_or_later) {
         NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;
         NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;