GLboolean (*qaglSetInteger) (AGLContext ctx, GLenum pname, const GLint *params);
void (*qaglSwapBuffers) (AGLContext ctx);
+static qboolean multithreadedgl;
static qboolean mouse_avail = true;
static qboolean vid_usingmouse = false;
static float mouse_x, mouse_y;
static int scr_width, scr_height;
+static cvar_t apple_multithreadedgl = {CVAR_SAVE, "apple_multithreadedgl", "0", "makes use of a second thread for the OpenGL driver (if possible) rather than using the engine thread (note: this is done automatically on most other operating systems)"};
+
static AGLContext context;
static WindowRef window;
qaglSwapBuffers(context);
}
VID_UpdateGamma(false, GAMMA_TABLE_SIZE);
+
+#ifdef kCGLCEMPEngine
+ if (apple_multithreadedgl.integer)
+ {
+ if (!multithreadedgl)
+ {
+ CGLError err = 0;
+ CGLContextObj ctx = CGLGetCurrentContext();
+ err = CGLEnable(ctx, kCGLEMPEngine);
+ if (err == kCGLNoError)
+ multithreadedgl = true;
+ else
+ Cvar_SetQuickValue(&apple_multithreadedgl, 0);
+ }
+ }
+ else
+ {
+ if (multithreadedgl)
+ {
+ multithreadedgl = false;
+ CGLDisable(ctx, kCGLEMPEngine);
+ }
+ }
+#else
+ if (apple_multithreadedgl.integer)
+ Cvar_SetQuickValue(&apple_multithreadedgl, 0);
+#endif
}
int VID_SetGamma(unsigned short *ramps, int rampsize)
void VID_Init(void)
{
InitSig(); // trap evil signals
+ Cvar_RegisterVariable(&apple_multithreadedgl);
// COMMANDLINEOPTION: Input: -nomouse disables mouse support (see also vid_mouse cvar)
if (COM_CheckParm ("-nomouse") || COM_CheckParm("-safe"))
mouse_avail = false;
gl_platform = "AGL";
gl_videosyncavailable = true;
+ multithreadedgl = false;
vid_isfullscreen = fullscreen;
vid_usingmouse = false;
vid_hidden = false;