Re: Synching CGContextFlush with a Monitor's Refresh Rate
Re: Synching CGContextFlush with a Monitor's Refresh Rate
- Subject: Re: Synching CGContextFlush with a Monitor's Refresh Rate
- From: Chris Hanson <email@hidden>
- Date: Sun, 24 Sep 2006 18:29:44 -0700
On Sep 24, 2006, at 3:29 PM, Jordan Evans wrote:
// Moves Ticker Tape message over 30 pixels. This is a nice,
but jerky
pace with a NSTimer invoking this method every 0.03 sec.
Your NSTimer isn't guaranteed to be fired exactly every 0.03 seconds:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSTimer_Class/Reference/Reference.html>
Moreover, timers may not fire exactly when scheduled.
What you need to do is keep track of the last time you drew and the
current time as of the timer's firing, and calculate the offset to
use for drawing from that information. This should result in
smoother animation.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden