Page 1 of 1
Is there any difference in using dt and timer.getDelta?
Posted: Wed Apr 30, 2014 4:50 pm
by Zarty55
I'm doing a project, where I will have to use timer.getDelta instead of dT. But only in some special cases, is there anything I should be worried about? I mean, the dT argument passed in the update function only has 4 digits, will there be any performance issues if I use timer.getDelta?
Just out of curiosity really, not a problem right now.
Re: Is there any difference in using dt and timer.getDelta?
Posted: Wed Apr 30, 2014 6:38 pm
by YGOFreak1997
For your question - try it out by printing them, but I don't think there is.
I'm a bit interested: Why won't you use dt?
Re: Is there any difference in using dt and timer.getDelta?
Posted: Wed Apr 30, 2014 7:26 pm
by bartbes
As you can see in [wiki]love.run[/wiki], dt is obtained by calling love.timer.getDelta, so no, there is no difference.
Re: Is there any difference in using dt and timer.getDelta?
Posted: Wed Apr 30, 2014 10:55 pm
by Inny
Going one layer deeper, we can see in the Love Timer.cpp source code* that getDelta returns an internal dt value, which is computed above in Timer::step, so the performance hit is quite literally the difference between a local value being passed around, and a single function call.
*
https://bitbucket.org/rude/love/src/524 ... ult#cl-120
Re: Is there any difference in using dt and timer.getDelta?
Posted: Fri May 02, 2014 3:40 am
by Zarty55
bartbes wrote:As you can see in [wiki]love.run[/wiki], dt is obtained by calling love.timer.getDelta, so no, there is no difference.
Ohhh, I see. love.timer.getDelta is now microsecond-accurate, yeah. Thank you guys for answering this stupid question. Sorry to bother.
Ygo, right now, I'm asking myself the same question, I think sometimes I just get dumb out of nowhere (Or I'm dumb, really) haha; Still, problem solved xD