projects
/
voxel-shooter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6a6443
)
proper delta time
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Sat, 18 Dec 2021 00:17:43 +0000
(18:17 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Sat, 18 Dec 2021 00:17:43 +0000
(18:17 -0600)
src/main.onyx
patch
|
blob
|
history
diff --git
a/src/main.onyx
b/src/main.onyx
index 2e3b9323f18408d2751f5afc45cae281bd06a416..f6cca9f408d61a8b730b4067f29fc3a88e3a284d 100644
(file)
--- a/
src/main.onyx
+++ b/
src/main.onyx
@@
-303,9
+303,16
@@
draw :: () {
}
main_loop :: () {
+ last := glfwGetTime();
+ now := last;
+
while !glfwWindowShouldClose(window) {
glfwPollEvents();
- update(1.0f / 60);
+
+ now = glfwGetTime();
+ dt := now - last;
+ last = now;
+ update(~~dt);
draw();
}
}