Added control of automatic graphics switching on OS X

Automatic graphics switching is enabled by default
Set vid_autoswitch CVAR to false to disable it
This commit is contained in:
alexey.lysiuk 2015-04-04 17:36:55 +03:00
parent 87229f4787
commit 193b491b63
2 changed files with 12 additions and 0 deletions

View file

@ -72,6 +72,11 @@ CUSTOM_CVAR(Bool, fullscreen, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
setmodeneeded = true;
}
CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
Printf("You must restart " GAMENAME " to apply graphics switching mode\n");
}
RenderBufferOptions rbOpts;
@ -399,6 +404,11 @@ CocoaVideo::CocoaVideo(const int multisample)
attributes[i++] = NSOpenGLPFAStencilSize;
attributes[i++] = NSOpenGLPixelFormatAttribute(8);
if (!vid_autoswitch)
{
attributes[i++] = NSOpenGLPFAAllowOfflineRenderers;
}
if (multisample)
{
attributes[i++] = NSOpenGLPFAMultisample;

View file

@ -43,5 +43,7 @@
</array>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<string>YES</string>
</dict>
</plist>