0

I've been building an OpenGL based app using GLKView, with a render method being triggered by CADisplaylink.

So far so good, at least on the simulator.. But when I run it on a physical device, my update routine is only fired once - at startup.

I understand there are many differences between the simulator and a physical device, but I'm hoping someone can shed some light on any that are specific to the CADisplaylink and what might cause it to not fire?

My setup is along these lines:

view.enableSetNeedsDisplay = NO;
CADisplayLink* displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(render:)];

displayLink.frameInterval=1;
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
genpfault
  • 51,148
  • 11
  • 85
  • 139
Tim Kane
  • 2,599
  • 3
  • 20
  • 19

1 Answers1

0

So, turns out my displayLink was still running, but it never had an opportunity to fire more than once on the device - there was another timer based event that was firing on the same runloop, consuming all the available CPU time.

This didn't show up in the simulator, because it clearly runs a lot faster in the simulator and never suffers from contention.

Throttling down that timer event has allowed the displayLink to fire once more, so my challenge now is in decoupling the timer event to another thread/runloop - and nothing to do with the displayLink at all.

Tim Kane
  • 2,599
  • 3
  • 20
  • 19