void VID_Finish (void) { qboolean vid_usevsync; // handle changes of the vsync option vid_usevsync = (vid_vsync.integer && !cls.timedemo); if (vid_usingvsync != vid_usevsync) { GLint sync = (vid_usevsync ? 1 : 0); if (qaglSetInteger(context, AGL_SWAP_INTERVAL, &sync) == GL_TRUE) { vid_usingvsync = vid_usevsync; Con_DPrintf("Vsync %s\n", vid_usevsync ? "activated" : "deactivated"); } else Con_Printf("ERROR: can't %s vsync\n", vid_usevsync ? "activate" : "deactivate"); } if (!vid_hidden) { CHECKGLERROR if (r_speeds.integer == 2 || gl_finish.integer) { qglFinish();CHECKGLERROR }
void VID_Finish (void) { qboolean vid_usevsync; // handle changes of the vsync option vid_usevsync = (vid_vsync.integer && !cls.timedemo); if (vid_usingvsync != vid_usevsync) { GLint sync = (vid_usevsync ? 1 : 0); if (qaglSetInteger(context, AGL_SWAP_INTERVAL, &sync) == GL_TRUE) { vid_usingvsync = vid_usevsync; Con_DPrintf("Vsync %s\n", vid_usevsync ? "activated" : "deactivated"); } else Con_Printf("ERROR: can't %s vsync\n", vid_usevsync ? "activate" : "deactivate"); } if (!vid_hidden) { if (r_speeds.integer == 2 || gl_finish.integer) GL_Finish(); qaglSwapBuffers(context); } VID_UpdateGamma(false, GAMMA_TABLE_SIZE); if (apple_multithreadedgl.integer) { if (!multithreadedgl) { if(qCGLGetCurrentContext && qCGLEnable && qCGLDisable) { CGLContextObj ctx = qCGLGetCurrentContext(); CGLError e = qCGLEnable(ctx, kCGLCEMPEngine); if(e == kCGLNoError) multithreadedgl = true; else { Con_Printf("WARNING: can't enable multithreaded GL, error %d\n", (int) e); Cvar_SetValueQuick(&apple_multithreadedgl, 0); } } else { Con_Printf("WARNING: can't enable multithreaded GL, CGL functions not present\n"); Cvar_SetValueQuick(&apple_multithreadedgl, 0); } } } else { if (multithreadedgl) { if(qCGLGetCurrentContext && qCGLEnable && qCGLDisable) { CGLContextObj ctx = qCGLGetCurrentContext(); qCGLDisable(ctx, kCGLCEMPEngine); multithreadedgl = false; } } } }