Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Vsync on mac os x 10.11 El Capitan

There is a solution here: How to disable vsync on macOS

However This only works for 10.10 and older, and Xcode 6 and older. It seems that the quartz debug that comes with Xcode 7 does not have options to turn of vysnc (beam sync).

Any help would be greatly appreciated. I'm running a Mac Book pro 13' if that matters.

like image 654
Howard Avatar asked Oct 29 '25 05:10

Howard


1 Answers

After YEARS looking for a workaround, this is what worked for me - I've added that piece of code at the start of my render loop and was finally have unsynchronize framerate:

#ifdef __APPLE__
GLint                       sync = 0;
CGLContextObj               ctx = CGLGetCurrentContext();

CGLSetParameter(ctx, kCGLCPSwapInterval, &sync);
#endif

Don't forget to include <OpenGL/gl.h>

It's not the nicest solution but it's actually the only one I found that work like a charm.

like image 108
Nox Avatar answered Nov 01 '25 12:11

Nox



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!