Cocoa OpenGL unlocked framerate

2019-02-20 05:05发布

I want to be able to run my game without a locked framerate (currently 60 fps). The only way that I have found to run the animation is with a NSTimer. Is there a way to have an unrestricted framerate in Cocoa. If so, a link or a code snippet would help greatly.

2条回答
做个烂人
2楼-- · 2019-02-20 05:42

This enabled me to get around ~700 frames per second on my MacBook Pro

It is not permanent either, perfect for testing/benchmarking.

Source

查看更多
叛逆
3楼-- · 2019-02-20 05:59

If you really want to do this, you might need to use the CGL interface. In a valid GL context, CGLGetCurrentContext returns an (opaque) context object. CGLSetParameter can be used to set a value for the kCGLCPSwapInterval parameter. A value of (0) disables waiting for vsync.

查看更多
登录 后发表回答