RAEL() and games

w_reade
Unregistered
 
Post: #1
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!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
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).
Quote this message in a reply
w_reade
Unregistered
 
Post: #3
wonderful, thanks.

ps why are you sad? are you lonely 'cos there's only one of you?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #4
LOL
BTW, I think your subtitle should read...
'Salty Confection'
My opinion,
Steven
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #5
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...
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
Quote:BTW, I think your subtitle should read...
'Salty Confection'

Whoops. Changed Smile
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
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
Quote this message in a reply
Post Reply