This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Game loop order of events


Game loop order of events

Postby codepunk » Sep 28, 2002 @ 2:43am

User avatar
codepunk
pm Member
 
Posts: 15
Joined: Sep 8, 2002 @ 6:14am


Postby refractor » Sep 28, 2002 @ 8:27am

Your basic loop is fine.

If I were using C++, I'd probably hold a list of objects that responded to input and define a virtual function in an ancestor so that I could provide the objects with their input (sounds like PocketFrog's way of doing things, from your desription - I've not looked it PFrog). Actually, if you didn't have many objects that you throw input at, it might be cleaner to use multiple inheritance for those objects to get their input function.

I wouldn't check the input per object. Just have a loop after the input that throws it at all of the relevant objects...

I probably wouldn't make an "input controller" because the coupling would be too high.
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Malmer » Sep 28, 2002 @ 1:17pm

All your base are belong to us
User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Postby refractor » Sep 28, 2002 @ 1:26pm

1) is probably not a good idea. I'd go for the method where you're looking after time-keeping, not the OS. Imagine if the even occurs before you've finished processing - you'll get a back-log of WM_TIMER events to deal with (I think - don't quote me on that)

To help performance:
If you use double/triple-buffering, you can start working on the next frame while you're waiting to display the last - that way "expensive" frames don't cause as much stutter as they would if you were waiting until the next (artificial) vsync. The added latency of one frame normally isn't noticable.

When the draw queue is full, you are going to have to "wait"... but if you find you're waiting lots per frame, then do more cool stuff! :)

Cheers,

Ref.
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Malmer » Sep 28, 2002 @ 2:17pm

All your base are belong to us
User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Postby Malmer » Sep 28, 2002 @ 2:22pm

All your base are belong to us
User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron