LWJGL
June 18, 2013, 19:39:45 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: 1 [2]
  Print  
Author Topic: [RFE] getTime/getDelta  (Read 3284 times)
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #15 on: May 25, 2012, 21: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.
Logged
princec
Nerdus Imperius
*****
Posts: 1870



WWW
« Reply #16 on: May 26, 2012, 02: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 Smiley
Logged

matheus23
Regular nerd
**
Posts: 62


« Reply #17 on: May 26, 2012, 08: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:
DeltaUtil.update()
every game-cycle, which is doing the exact same thing:
Code:
[variable-name] = getDeltaTimePrivate(); // Maybe another name
and let getDelta() do this:
Code:
public double getDelta() {
    return [variable-name];
}

That's it Wink
Logged

My github account and currently active project: https://github.com/matheus23/UniverseEngine
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #18 on: May 26, 2012, 22: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 Smiley

Makes sense.

@Simon
That seems like a less intuitive API to me.
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!