Hello Guest

[CLOSED] getTime/getDelta

  • 18 Replies
  • 23244 Views
Re: [RFE] getTime/getDelta
« Reply #15 on: May 26, 2012, 04:00:44 »
No question that it could be used correctly. However, matheus23 already wrote code snippet which demonstrates how it might get mis-used:

All code can be used wrongly - what's important is how easily it can be used correctly.

You don't constrain an API on the sole reason people could attempt retarded things with it.

*

Offline princec

  • *****
  • 1933
    • Puppygames
Re: [RFE] getTime/getDelta
« Reply #16 on: May 26, 2012, 09:43:06 »
The more API we add to LWJGL beyond that which is minimally necessary to achieve what it does, the more API nobody knows about, the more potential bugs and the more maintenance. This is why we have historically avoided adding cruft like this to the core classes and plonked them into the util jar.

Cas :)

Re: [RFE] getTime/getDelta
« Reply #17 on: May 26, 2012, 15:46:54 »
No question that it could be used correctly. However, matheus23 already wrote code snippet which demonstrates how it might get mis-used:

All code can be used wrongly - what's important is how easily it can be used correctly.

You don't constrain an API on the sole reason people could attempt retarded things with it.

You could add a static variable easily in some class like "DeltaUtil", and call
Code: [Select]
DeltaUtil.update() every game-cycle, which is doing the exact same thing:
Code: [Select]
[variable-name] = getDeltaTimePrivate(); // Maybe another name and let getDelta() do this:
Code: [Select]
public double getDelta() {
    return [variable-name];
}

That's it ;)
My github account and currently active project: https://github.com/matheus23/UniverseEngine

Re: [RFE] getTime/getDelta
« Reply #18 on: May 27, 2012, 05:50:14 »
Quote
The more API we add to LWJGL beyond that which is minimally necessary to achieve what it does, the more API nobody knows about, the more potential bugs and the more maintenance. This is why we have historically avoided adding cruft like this to the core classes and plonked them into the util jar.

Cas :)

Makes sense.

@Simon
That seems like a less intuitive API to me.