Back to timer/update issue
I have been having a hell of a time getting my program to update at a 60Hz cycle and be able to normalize it so that an object will move 1 unit in 1 second. Does anyone have any advice or sample code I could take a look at? I'm using Obj-C in a SDL main loop. I tried using the callback-thing OSC gave me some time ago, but it isn't working out anymore. Thanks a lot!
EDIT: Wow, kicking myself for this one. I didn't multiply movement by time delta yet. This may not completely solve my problem, but for future reference, I'm getting closer...
EDIT: Wow, kicking myself for this one. I didn't multiply movement by time delta yet. This may not completely solve my problem, but for future reference, I'm getting closer...
This is the standard link on the subject.
http://www.sacredsoftware.net/tutorials/...tion.xhtml
With SDL, use SDL_GetTicks() (and remember that it returns milliseconds elapsed).
http://www.sacredsoftware.net/tutorials/...tion.xhtml
With SDL, use SDL_GetTicks() (and remember that it returns milliseconds elapsed).
OneSadCookie Wrote:This is the standard link on the subject.
http://www.sacredsoftware.net/tutorials/...tion.xhtml
With SDL, use SDL_GetTicks() (and remember that it returns milliseconds elapsed).
Wow, that link is freaking cool! Thanks for the advice. I looked into SDL_GetTicks() before reading this a figured it out from there, but the article you provided should give some really cool insight into proper frame syncing. Thanks again, OSC!
Well, with that in mind, I now have a functional physics engine built in Obj-C. It took me about 2 days of heavy programming and quite a bit of scratch notebook paper, but it's now ready for a complete overhaul. Thank you guys for always having the right answers, and for being willing to help out.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Game Timer | larswik | 10 | 2,374 |
Dec 4, 2012 03:35 PM Last Post: AnotherJake |
|
| I need a timer | Caveman | 2 | 2,287 |
Aug 17, 2008 07:38 AM Last Post: Caveman |
|

