iDevGames Forums
RAEL() and games - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: RAEL() and games (/thread-7578.html)



RAEL() and games - w_reade - Sep 9, 2002 06:12 PM

that's RunApplicationEventLoop(), btw.

So, is it a good idea?

that is: as far as I can tell, you call RAEL() and it calls other functions depending on (1) events and (2) timers.

If I simply had a timer which called a function DoFrame() thirty times (say) every second, what sort of a speed penalty would there be, compared to a function like the following?

Code:
void MainLoop(void)
{
   while (!done)
   {
      GetTime();

      DoFrame();
      WaitNextEvent();
      HandleEvent();

      TwiddleThumbsUntilTimeForNextFrame();
   }
}

Or is RAEL() absolutely fine for games? I can see plenty of convenience advantages to it, but I have no idea about speed. If anyone knows, do let me know. Cheers!


RAEL() and games - OneSadCookie - Sep 9, 2002 06:21 PM

Counterintuitive as it may seem, using RAEL will actually speed up your game (except possibly over WNE(60)).

The reason is that if you don't give time to the OS, it starts taking time from you (bad runaway program! No CPU for you! One year!).

If you behave nicely (and RAEL is the nicest), you'll get plenty of time.

Note that it's perfectly fine to set up a 1ms timer and draw your frame when you get called back from that (essentially as often as possible).


RAEL() and games - w_reade - Sep 9, 2002 06:35 PM

wonderful, thanks.

ps why are you sad? are you lonely 'cos there's only one of you?


RAEL() and games - Steven - Sep 9, 2002 07:44 PM

LOL
BTW, I think your subtitle should read...
'Salty Confection'
My opinion,
Steven


RAEL() and games - Josh - Sep 9, 2002 07:46 PM

Quote:Originally posted by w_reade
ps why are you sad? are you lonely 'cos there's only one of you?
I think this has come up before and we are yet to get an answer...


RAEL() and games - OneSadCookie - Sep 9, 2002 08:18 PM

Quote:BTW, I think your subtitle should read...
'Salty Confection'

Whoops. Changed Smile


RAEL() and games - OneSadCookie - Sep 9, 2002 08:27 PM

Quote:ps why are you sad? are you lonely 'cos there's only one of you?

You people are so persistent!

http://www.noodles.co.nz Grin