FROM : alex
DATE : Tue Feb 05 21:30:03 2008
Hi there,
Hopefully this is the right list for this question. I haven't found
what I was looking for after searching the archives for the "right"
way to animate some graphics using cocoa.
I'm trying to draw two different things. One of them is an audio
level meter and the other is an effect similar to what the iPhone
"slide" graphic does on the lock screen on the iPhone.
(I have a mask that I slide a white blob around behind.)
I'm able to do both with an NSTimer that fires and then I issue a
[setNeedsDisplay] from the timer to update the animation. This
works fine and produces the expected results but seems to use way too
much CPU compared to what I've been able to do "back in the day"
using straight CG or worse Quickdraw. (I am not porting this code
from QD- I threw that code away, this is all new code.)
I've been looking at using CALayers to implement the drawing so that
I can call [display] rather than [setNeedsDisplay] with the hopes
that this would make the animations use less CPU.
What is the right way to approach this problem? (and please don't
suggest using Shark to optimize my code as that is a given and will
be done after I determine what the best course of code will be).
thanks,
alex
DATE : Tue Feb 05 21:30:03 2008
Hi there,
Hopefully this is the right list for this question. I haven't found
what I was looking for after searching the archives for the "right"
way to animate some graphics using cocoa.
I'm trying to draw two different things. One of them is an audio
level meter and the other is an effect similar to what the iPhone
"slide" graphic does on the lock screen on the iPhone.
(I have a mask that I slide a white blob around behind.)
I'm able to do both with an NSTimer that fires and then I issue a
[setNeedsDisplay] from the timer to update the animation. This
works fine and produces the expected results but seems to use way too
much CPU compared to what I've been able to do "back in the day"
using straight CG or worse Quickdraw. (I am not porting this code
from QD- I threw that code away, this is all new code.)
I've been looking at using CALayers to implement the drawing so that
I can call [display] rather than [setNeedsDisplay] with the hopes
that this would make the animations use less CPU.
What is the right way to approach this problem? (and please don't
suggest using Shark to optimize my code as that is a given and will
be done after I determine what the best course of code will be).
thanks,
alex
| Related mails | Author | Date |
|---|---|---|
| alex | Feb 5, 21:30 | |
| Bill Dudney | Feb 5, 21:53 | |
| alex | Feb 6, 18:27 | |
| Troy Stephens | Feb 7, 01:46 | |
| alex | Feb 7, 04:26 | |
| Troy Stephens | Feb 7, 20:25 | |
| alex | Feb 8, 04:18 |






Cocoa mail archive

