all: rename setShouldClose to close

Closes #550
This commit is contained in:
Ali Chraghi 2022-09-18 19:22:03 +04:30 committed by Stephen Gutekanst
parent 308d413f09
commit 15dfb2867a
15 changed files with 21 additions and 21 deletions

View file

@ -95,8 +95,8 @@ pub const Platform = struct {
js.machCanvasSetFullscreen(platform.id, options.fullscreen);
}
pub fn setShouldClose(_: *Platform, value: bool) void {
if (value) js.machEmitCloseEvent();
pub fn close(_: *Platform) void {
js.machEmitCloseEvent();
}
pub fn setWaitEvent(_: *Platform, timeout: f64) void {
@ -297,7 +297,7 @@ export fn wasmUpdate() void {
core.delta_time_ns = core.timer.lapPrecise();
core.delta_time = @intToFloat(f32, core.delta_time_ns) / @intToFloat(f32, std.time.ns_per_s);
app.update(&core) catch core.setShouldClose(true);
app.update(&core) catch core.close();
}
export fn wasmDeinit() void {