mach: wasm: enable lapping of engine timer every frame
This commit is contained in:
parent
8d9ca11b45
commit
d8afc9c88c
1 changed files with 3 additions and 0 deletions
|
|
@ -115,6 +115,9 @@ export fn wasmInit() void {
|
|||
}
|
||||
|
||||
export fn wasmUpdate() bool {
|
||||
engine.delta_time_ns = engine.timer.lapPrecise();
|
||||
engine.delta_time = @intToFloat(f32, engine.delta_time_ns) / @intToFloat(f32, std.time.ns_per_s);
|
||||
|
||||
return app.update(&engine) catch false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue