summaryrefslogtreecommitdiff
path: root/public/gl
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-01-19 09:54:17 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-01-19 09:54:17 -0500
commit19a144a609ea26bd6e714efcd498d7ff38f28258 (patch)
tree2a83ab69f3ea046e98c1de0b92511c0644b05fdf /public/gl
parentsmall changes (diff)
parentmovement (diff)
downloadwebgl-19a144a609ea26bd6e714efcd498d7ff38f28258.tar.gz
webgl-19a144a609ea26bd6e714efcd498d7ff38f28258.tar.bz2
webgl-19a144a609ea26bd6e714efcd498d7ff38f28258.zip
merge
Diffstat (limited to 'public/gl')
-rw-r--r--public/gl/gl.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/gl/gl.js b/public/gl/gl.js
index 20b6225..ca0dbe6 100644
--- a/public/gl/gl.js
+++ b/public/gl/gl.js
@@ -10,9 +10,15 @@ export { Mat4 } from './math/Mat4.js'
export { Vec2 } from './math/Vec2.js'
export { Vec3 } from './math/Vec3.js'
export { Loop }
+export { DT }
+var DT = 0;
+var last = Date.now()
const Loop = (fn) => {
const callback = () => {
+ var now = Date.now()
+ DT = ( now - last) / 1000
+ last = now
fn()
window.requestAnimationFrame(callback)
}