variable frame rate animation in Cocoa

Member
Posts: 42
Joined: 2002.09
Post: #1
In the past (in METAL) I have always measured elapsed time between loops, multiplying the velocities by elapsed time to move sprites.

I have switched to Cocoa, and done some animation with fixed frame rates using NSTimer and NSThread. How can I run the loop as fast as the machine can support it?

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #2
Set the timer to a very, very small interval (like .001 - a thousand times a second).
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #3
Quote:Originally posted by Mark Levin
Set the timer to a very, very small interval (like .001 - a thousand times a second).


set it to zero or negative Rasp
Zero or negative values get translated to the smallest available interval.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
macboy
Unregistered
 
Post: #4
Quote:Originally posted by kelvin
set it to zero or negative Rasp
Zero or negative values get translated to the smallest available interval.
Really? Cool. Wow
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Use an integer value as part of a variable name PHANTOMIAS 5 4,001 Dec 8, 2009 09:24 AM
Last Post: PHANTOMIAS
  Separating update rate from render rate Jar445 5 4,142 Jan 17, 2009 01:43 PM
Last Post: AnotherJake
  Anybody have an idea what this variable is used for? WhatMeWorry 8 4,478 Mar 1, 2007 10:31 AM
Last Post: unknown
  Frame Based Animation Nick 6 3,874 Jan 27, 2007 06:25 AM
Last Post: 007gamer
  Previous frame inner to this frame (corrupt stack?) wyrmmage 9 7,427 Nov 29, 2006 05:14 PM
Last Post: wyrmmage