Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 0243c8b7bca94179c78b9bd6ac76c033 > files > 543

cg-examples-3.0.0018-0.1.x86_64.rpm


/* request_vsync.h - request buffer swap synchroization with vertical sync */
/*                   false means do NOT synchronize.                       */

static void requestSynchronizedSwapBuffers(int enableSync)
{
#if defined(__APPLE__)
#ifdef CGL_VERSION_1_2
  const GLint sync = enableSync;
#else
  const long sync = enableSync;
#endif
  CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &sync);
#elif defined(_WIN32)

  if (wglSwapIntervalEXT) {
    wglSwapIntervalEXT(enableSync);
  }
#else
  if (glXSwapIntervalSGI) {
    glXSwapIntervalSGI(enableSync);
  }
#endif
}