Chase Walden
Chase Walden

Reputation: 1302

Cocoa OpenGL unlocked framerate

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.

Upvotes: 2

Views: 6227

Answers (3)

william george
william george

Reputation: 21

The Quartz debugger in Xcode 11 (version 4.2) moved this to:

Tools->Quartz Debug Settings->Enable Vertical Sync

Upvotes: 0

cevaris
cevaris

Reputation: 5794

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

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

Source

Upvotes: 5

Brett Hale
Brett Hale

Reputation: 22318

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.

Upvotes: 8

Related Questions