mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 660c41bc06 |
@ -1,6 +1,8 @@
|
||||
package timing
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
dt float32 = 0.01
|
||||
@ -17,7 +19,11 @@ func FrameStarted() {
|
||||
}
|
||||
|
||||
func FrameEnded() {
|
||||
|
||||
dt = float32(time.Since(frameStart).Seconds())
|
||||
if dt == 0 {
|
||||
dt = float32(time.Microsecond)
|
||||
}
|
||||
}
|
||||
|
||||
//DT is frame deltatime in seconds
|
||||
|
||||
Reference in New Issue
Block a user