obj: Fix doc comment and update example to build

This commit is contained in:
foxnne 2024-11-27 08:26:24 -06:00 committed by Emi Gutekanst
parent 0476999dc4
commit f58cb270b1
2 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,7 @@ pub fn init(
// Color target describes e.g. the pixel format of the window we are rendering to.
const color_target = gpu.ColorTargetState{
.format = core.windows.get(core.main_window).?.framebuffer_format,
.format = core.windows.get(core.main_window, .framebuffer_format).?,
.blend = &blend,
};

View file

@ -346,9 +346,9 @@ pub fn Objects(comptime T: type, options: ObjectsOptions) type {
return false;
}
/// Returns true if the field has an `updated` bit set in internal.
/// Sets an internal bit for the field indicating it has been updated.
///
/// Internal functions may set this bit back to false.
/// Internal functions may use this as a signal.
pub fn setUpdated(objs: *@This(), id: ObjectID, field_name: anytype, value: bool) void {
if (options.track_fields) {
const unpacked = objs.validateAndUnpack(id, "setUpdated");