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.
Is there any difference in using dt and timer.getDelta?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- YGOFreak1997
- Party member
- Posts: 103
- Joined: Sun Jan 22, 2012 4:29 pm
- Location: Germany, Baden-Württemberg
- Contact:
Re: Is there any difference in using dt and timer.getDelta?
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?
I'm a bit interested: Why won't you use dt?
Also look at my LÖVE-Tutorial-Youtube-Channel (German )
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?
ÖBEY!
GitHub Repo: Click Me!
Website: No, Me!
IndieDB: Or Maybe Me?
ÖBEY!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Is there any difference in using dt and timer.getDelta?
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?
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
* https://bitbucket.org/rude/love/src/524 ... ult#cl-120
Re: Is there any difference in using dt and timer.getDelta?
Ohhh, I see. love.timer.getDelta is now microsecond-accurate, yeah. Thank you guys for answering this stupid question. Sorry to bother.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.
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
Who is online
Users browsing this forum: Ahrefs [Bot], Azzla, Google [Bot] and 1 guest