def syncSwapBuffers(n):
 try:
  v = ctypes.c_int(n)
  cocoa.CGLSetParameter(cocoa.CGLGetCurrentContext(), kCGLCPSwapInterval, ctypes.pointer(v))
 except Exception:
  logging.warning('Unable to set vsync mode. Using driver defaults')

def syncSwapBuffers ( n ) : try : v = ctypes . c_int ( n ) cocoa . CGLSetParameter ( cocoa . CGLGetCurrentContext ( ) , kCGLCPSwapInterval , ctypes . pointer ( v ) ) except Exception : logging . warning ( 'Unable to set vsync mode. Using driver defaults' )
syncswapbuffers(n) if n==1 then buffers will sync .