How to draw unlimited FPS on Mac OS X with OpenGL?

I d'like to draw as many frames as possible with OpenGL on Mac OS X to measure the performance on different scenes. What I've tried so far:

1. Using a CVDisplayLink that has NSOpenGLCPSwapInterval set to 0, so it does not sync with the Display. But with that it's still stuck at max 60FPS

2. Using normal -drawRect: with a timer that fires 1/1000sec and calls -setNeedsDisplay: Still not more than 60FPS

3. Same as 2. but I call -display in the timer callback. With that I get the FPS above 60, but it still stops at 100-110 FPS. Although the frame rate should easily be at 10times more.

Andy idea how I can really draw as many frames as possible?

• Note that accurately measuring render performance is generally more involved than just counting frames-per-second (see this, which is D3D-focused, but still has merit). FPS is also a generally poor metric, because it isn't linear. – user1430 May 7 '12 at 15:19
• @V1ru8: I asked a very similar question a few months ago and still haven't gotten a very good answer. I'd love to know how to do this too. – Kyle May 7 '12 at 20:39
• If you really want to know how fast you are rendering you don't necessarily have to let it render at an unlimited rate. You could just time how long your draw calls take to complete, take the inverse of that and that should give you a rough estimate of "how many fps could I be doing right now?". @josh-petrie It might not be the best metric, but at least it can indicate to you when something has gone horribly wrong and you need to do some actual profiling. – user13213 May 8 '12 at 9:41

1 Answer

This stack overflow answer has some calls you can use to disable vsync..

https://stackoverflow.com/questions/10866561/cocoa-opengl-unlocked-framerate/10881400#10881400

..not sure if that changes anything though. One API should work just as well as another.