Where to put my game loop?
Hi,
I've been looking through the posts here at questions on rending and getting sprites on the screen with opengl.
It occurred to me that in the sample opengl framework and how I was looking at it was basically having one place to do my game related stuff as well as drawing stuff. I saw people mentioning things about rending vs the game loop and keeping them separate...
I'm curious where people are putting those main loops for the game logic. I'm still relatively new to iphone development, so if there's an obvious place, I may be missing it.

thanks,
david
I've been looking through the posts here at questions on rending and getting sprites on the screen with opengl.
It occurred to me that in the sample opengl framework and how I was looking at it was basically having one place to do my game related stuff as well as drawing stuff. I saw people mentioning things about rending vs the game loop and keeping them separate...
I'm curious where people are putting those main loops for the game logic. I'm still relatively new to iphone development, so if there's an obvious place, I may be missing it.

thanks,
david
Here's a good article on the subject: http://www.sacredsoftware.net/tutorials/...tion.xhtml
The basic idea is that you do your draw routine as normal, but inside draw, before you start drawing, you call update however many times necessary to keep it timed right. Frame rate will vary, but the tick rate at which you update your game remains constant.
The basic idea is that you do your draw routine as normal, but inside draw, before you start drawing, you call update however many times necessary to keep it timed right. Frame rate will vary, but the tick rate at which you update your game remains constant.
ahhh... ok, that makes sense.
thanks AJ. and that looks like a good site, too.
thanks AJ. and that looks like a good site, too.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Game loop and performance | wonza | 12 | 5,164 |
Dec 9, 2009 11:02 PM Last Post: AnotherJake |
|
| How do you manage events and game loop? | riruilo | 2 | 2,827 |
Nov 23, 2009 04:16 PM Last Post: riruilo |
|

