Search code examples
iosanimationcore-animation

On iOS, is there a way to refresh more than 60 frames per second?


If animating an image, such as a metal ball, and it is about 20 pixel wide, and the speed is about 200 pixels per second, then if the refresh rate is 60 frames per second, the ball will move about 3 pixels per second, which is 1/6 of the ball's width (16%). (If it is Angry Birds, the blue bird is about the same size of 20 pixels, and it is moving a lot more smooth, not like 3 pixels each time).

It seems that this way, the ball is moving with some jagged movement. How can that be made into moving smoothly? Will that require making a refresh rate of more than 60 frames per second and if so, how can it be done? (CADisplayLink is used as the timer, so it is now 60 frames per second. NSTimer can make it refresh faster, except NSTimer might be delayed and won't tell the time elapsed from last refreshed.)


Solution

  • I'm trying to do something like you and stil get the same unpleasant "flickering". Here is my code http://paste.ideaslabs.com/show/1FZoo6AQtu

    I'm reading some OpenGL docs and the property preferredFramesPerSecond of GLKViewController looks promising. May be someone with more experience with OGL/GLK can lend us a hand.