[gameprogrammer] Re: Fixed Rate Logic

On Wed, 6 Dec 2006 16:23:16 -0800, "Alan Wolfe" <alan.wolfe@xxxxxxxxx>
said:
> hmm ok
> 
> what i had figured for processing the event queue was something like...
> 
> 
> while( !GameOver)
> {
>   while(eventqueue && eventqueue->fire < Now())
>   {
>     //process one event
>   }
>   //render everything
> }
> 
> if you had an event in there that had a firing rate of 1ms and put
> itself back into the queue every time it ran, im assuming the
> processing of that event would take > 1 ms and so then you'd be caught
> in a loop forever.

You'd probably want to put a render event on the queue as well, rather
than treating it as special.  Enqueued with variable delay depending on
what you need to maintain a decent framerate.

Dave.
-- 
  Dave Slutzkin
  Melbourne, Australia
  daveslutzkin@xxxxxxxxxxx


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: