Questions tagged [cadisplaylink]

A CADisplayLink object is a timer object that allows your application to synchronize its drawing to the refresh rate of the display.

137 questions
6
votes
3 answers

CADisplayLink running lower frame rate on iOS5.1

I'm using CADisplayLink in my iPhone app. Here is the relevant code: SMPTELink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onTick)]; SMPTELink.frameInterval = 2;//30fps 60/n = fps [SMPTELink addToRunLoop:[NSRunLoop mainRunLoop] …
objectiveccoder001
  • 2,981
  • 10
  • 48
  • 72
5
votes
2 answers

CADisplayLink forward declaration error

Okay, so I've been completely stumped by this compiler error for hours, and the problem is that all the googling I've done says it should work the way I have it! I'm following a book tutorial for iPhone game development, and I got stuck on the…
Chad
  • 275
  • 3
  • 13
5
votes
3 answers

Getting stuck at 40 fps even with using CADisplayLink?

At first I used NSTimer and ran into the problem of the frame rate being stuck at 40 frames per second. I've read about using CADisplayLink to fix the problem. It seemed to work for a while, but recently, the app starts at 60, then after a little…
avide
  • 61
  • 1
  • 2
5
votes
1 answer

What's the difference between CADisplayLink's displayLinkWithTarget:selector: and UIScreen's displayLinkWithTarget:selector:?

CADisplayLink having this method makes sense, but I'm curious why UIScreen would also have it.
meisel
  • 2,151
  • 2
  • 21
  • 38
5
votes
1 answer

Can CADisplayLink be run while in application is in background?

I am using a CADisplayLink as a timer in my application. I am using a CADisplayLink because my app relies HEAVILY on the accuracy/precision of the CADisplayLink. NSTimer is not a suitable replacement in my case. The issue is that occasionally, I…
MikeG
  • 3,745
  • 1
  • 29
  • 51
4
votes
2 answers

iPhone OpenGL ES glFlush() inconsistently slow

Seemingly at random (but typically consistent during any given program run), my presentRenderBuffer call is very slow. I tracked it down to a call to glFlush() which presentRenderBuffer makes, so now I call glFlush() right before…
pinerd314159
  • 534
  • 4
  • 10
4
votes
1 answer

CADisplayLink swallows exceptions

I've noticed that when using CADisplayLink, exceptions just get swallowed: CADisplayLink *aDisplayLink = [[UIScreen mainScreen] displayLinkWithTarget:self selector:@selector(doIt)]; [aDisplayLink setFrameInterval:100]; [aDisplayLink…
Karl
  • 14,434
  • 9
  • 44
  • 61
4
votes
1 answer

UIScrollView broken and halts scrolling with OpenGL rendering (related CADisplayLink, NSRunLoop)

Solution note, Not a question. UIScrollView suspends OpenGL rendering by preventing firing CADisplayLink tick when CADisplayLink registered with NSDefaultRunLoopMode. But, if you use NSRunLoopCommonModes to solve this, UIScrollView will halt…
eonil
  • 83,476
  • 81
  • 317
  • 516
4
votes
1 answer

how to 'animate' changing shape of a view in IOS? (i.e. change it's path from one to another)

How can one 'animate' changing a custom UIView based around a shape, from one shape to another shape? Say for example one is creating a UIView that appears like a shape, created using a UIBezierPath. But then you want this view object to change…
Greg
  • 34,042
  • 79
  • 253
  • 454
4
votes
1 answer

Can I get 60fps with a 10ms drawRect?

I've asked a more general question about how CADisplayLink and drawRect behave here, but as that question doesn't have any answers yet, I thought I'd ask a more specific one: has anyone managed to get an app to run at 60fps with a drawRect method…
deltacrux
  • 1,186
  • 11
  • 18
4
votes
3 answers

Game sometimes crashes when removing CADisplayLink from run loop

This doesn't happen every time you play the game, maybe once for every 5 or 10 plays. When the game ends, I remove my CADisplayLink (which I use to animate the playing area, a bit like the pipes in Flappy Bird) from the run loop. However, on the few…
user2397282
  • 3,798
  • 15
  • 48
  • 94
4
votes
1 answer

Use CADisplayLink as dynamic frequency timer

I've been using NSTimer to fade-in/fade-out some images in my app based on user-set frequency. For example, if user set frequency to 5 seconds, then every 5 seconds the following code will execute: [UIView animateWithDuration:someInterval …
Uzumaki Naruto
  • 547
  • 5
  • 18
3
votes
1 answer

CADisplayLink stutters when built from archive

I have project that is rendering video playback and applying CIFilters to it. I know that I can use video composition to get video with filters, but problems is that filters needs to be swipeable (with preview of next filter so we're using mask for…
Baki
  • 490
  • 4
  • 19
3
votes
1 answer

CADisplayLink frame rate on 10.5" iPad Pro

We have an OpenGL-based iOS app. We use a CADisplayLink to control our drawing updates. I just got the new 10.5" iPad Pro and we are getting a maximum frame rate of 60 rather than the 120 we can theoretically get on the new hardware. We set up the…
btschumy
  • 1,435
  • 1
  • 18
  • 35
3
votes
1 answer

Animate MKMapView camera heading transition

What I want to achieve is like the animation (how the map rotates) in mapView when userTrackingMode is followWithHeading. The thing is I can't use this tracking mode here because we draw our own blue dot based on the different location information…
Robert
  • 67
  • 2
  • 6
1
2
3
9 10