[gameprogrammer] Re: What is better
- From: Vince <uberneen@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Mon, 24 Nov 2008 11:17:55 -0800 (PST)
Whether I'm using C or C++, there's always some kind of loop. I would think
that even with a timer class, your application class is taking that information
and implementing it internally in a loop.
So if you say myApp->addTimer(timer, callback) or myApp->setFrameTime(time) and
then myApp->run(), the run member is doing the same thing as a while loop but
the class is encapsulating it. Presumably the addTimer member adds timer
objects to a queue and each time run() processes a frame, that queue is
examined for qualifiying events. In the case of frame time, you can either
sleep through the surplus time to match a framerate or you can scale all of
your operations by the real frame time.
In any case, I would use a loop for this. Having it in a class might just make
it more managable.
I mostly dabble in proofs of concept though, so I'm interested in hearing what
our more experienced readers think on the matter.
Vince~
--- On Mon, 11/24/08, yasser gonzalez <yassergs@xxxxxxxxxxxxxxx> wrote:
From: yasser gonzalez <yassergs@xxxxxxxxxxxxxxx>
Subject: [gameprogrammer] Re: What is better
To: gameprogrammer@xxxxxxxxxxxxx
Date: Monday, November 24, 2008, 6:23 PM
Hey, when you develop a game, what is more
useful:
While loops or Timers?
--
Este mensaje ha sido analizado por
MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
MailScanner agradece a transtec Computers por su apoyo.
Other related posts: