File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public static void main(String[] args) {
1616 Mod .Window .PollEvents ();
1717 Mod .Window .Clear ();
1818
19- Mod .Update (Time .deltaTime );
19+ Mod .Update (( float ) Time .deltaTime );
2020 Mod .Render ();
2121
2222 Mod .Window .SwapBuffers ();
Original file line number Diff line number Diff line change 11package me .toast .engine .util ;
22
3+ import static org .lwjgl .glfw .GLFW .glfwGetTime ;
4+
35public class Time {
46
5- public static float timeStarted = System .nanoTime ();
6- public static float getTime () { return (float )((System .nanoTime () - timeStarted ) * 1E-9 ); }
7- public static float deltaTime = 0f ;
8- private static float endTime , beginTime ;
7+ public static double timeStarted = Time .getTime ();
8+ public static double deltaTime = 0f ;
9+ private static double endTime , beginTime ;
910
1011 public static void Init () {
1112 deltaTime = 0f ;
@@ -18,4 +19,8 @@ public static void UpdateDeltaTime() {
1819 deltaTime = endTime - beginTime ;
1920 beginTime = Time .getTime ();
2021 }
22+
23+ public static double getTime () {
24+ return glfwGetTime ();
25+ }
2126}
You can’t perform that action at this time.
0 commit comments