obj: Refine comments, make updated set bits back to false, swap Objects parameters

This commit is contained in:
foxnne 2024-11-27 11:37:14 -06:00 committed by Emi Gutekanst
parent f58cb270b1
commit 0546c3d5ca
3 changed files with 38 additions and 67 deletions

View file

@ -32,7 +32,10 @@ pub const mach_module = .mach_core;
pub const mach_systems = .{ .main, .init, .tick, .presentFrame, .deinit };
// Set track_fields to true so that when these field values change, we know about it
// and can update the platform windows.
windows: mach.Objects(
.{ .track_fields = true },
struct {
/// Window title string
// TODO: document how to set this using a format string
@ -57,9 +60,6 @@ windows: mach.Objects(
/// Whether the window is fullscreen (read-only)
fullscreen: bool,
},
.{
.track_fields = true,
},
),
/// Callback system invoked per tick (e.g. per-frame)
@ -298,9 +298,6 @@ fn platform_update_callback(core: *Core, core_mod: mach.Mod(Core)) !bool {
.height = main_window.height,
});
}
core.windows.setUpdated(core.main_window, .width, false);
core.windows.setUpdated(core.main_window, .height, false);
}
return core.state != .exited;