- if (!qaglSetFullScreen (context, width, height, refreshrate, 0))
- Sys_Error("aglSetFullScreen failed");
- vid_isfullscreen = true;
+ // Output is FullScreen
+ // Get the mainDisplay and set resolution to current
+ CGDisplayCapture (mainDisplay);
+ CFDictionaryRef refDisplayMode = CGDisplayBestModeForParameters (mainDisplay, bpp, width, height, NULL);
+ CGDisplaySwitchToMode (mainDisplay, refDisplayMode);
+ DMGetGDeviceByDisplayID ((DisplayIDType)mainDisplay, &gdhDisplay, false);
+
+ // Set pixel format with built attribs
+ // Note: specifying a device is *required* for AGL_FullScreen
+ pixelFormat = qaglChoosePixelFormat(&gdhDisplay, 1, attributes);
+ error = aglGetError();
+ if (error != AGL_NO_ERROR)
+ {
+ Con_Printf("qaglChoosePixelFormat FAILED: %s\n",
+ (char *)aglErrorString(error));
+ ReleaseWindow(window);
+ return false;
+ }