0

For creating mainloop in my opengl app for Mac I'm using NSTimer:

  [NSTimer scheduledTimerWithTimeInterval:.001
                                 target:view
                               selector:@selector(render:)
                               userInfo:nil
                                repeats:YES];

But if I try enable v-sync:

GLint vsync=0;
[[view openGLContext]  setValues:&vsync forParameter:NSOpenGLCPSwapInterval];

my timer automatically switches to 60fps speed. It's good for drawing (swapbuffer,glFinish and etc) but some processes in my program require a higher speed. Can I somehow ignore vsync for timer? I need two timers - one for drawing with 60 fps, and second for loop with maximum fps. Is it possible?

p.s. DisplayLink - not working for me.

Thank you.

  • Did you read [this](https://developer.apple.com/library/mac/qa/qa1385/_index.html)? – trojanfoe Oct 22 '15 at 08:10
  • Yes, but CVDisplayLink show critical error for my display, and NSTimer resets to 60fps if i use vsync or call SetNeedDisplay:YES in my loop – user3226859 Oct 22 '15 at 09:59

0 Answers0