Skip to content

Commit 9ddb431

Browse files
committed
monolith: fixups for zglfw changes & zig upgrade
1 parent 43e5772 commit 9ddb431

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

samples/monolith/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile {
2929
const zgui = b.dependency("zgui", .{
3030
.target = options.target,
3131
.backend = .glfw_wgpu,
32+
.with_gizmo = true,
3233
});
3334
exe.root_module.addImport("zgui", zgui.module("root"));
3435
exe.linkLibrary(zgui.artifact("imgui"));

samples/monolith/src/monolith.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,15 @@ const DebugRenderer = struct {
496496
_: *DebugRenderer,
497497
_: *const [3]zphy.Real,
498498
_: *const [3]zphy.Real,
499-
_: *const zphy.DebugRenderer.Color,
499+
_: zphy.DebugRenderer.Color,
500500
) callconv(.C) void {}
501501

502502
fn drawTriangle(
503503
_: *DebugRenderer,
504504
_: *const [3]zphy.Real,
505505
_: *const [3]zphy.Real,
506506
_: *const [3]zphy.Real,
507-
_: *const zphy.DebugRenderer.Color,
507+
_: zphy.DebugRenderer.Color,
508508
) callconv(.C) void {}
509509

510510
fn createTriangleBatch(_: *DebugRenderer, _: [*]zphy.DebugRenderer.Triangle, _: u32) callconv(.C) *anyopaque {
@@ -1068,15 +1068,15 @@ fn update(demo: *DemoState) void {
10681068

10691069
if (window.getMouseButton(.left) == .press) {
10701070
if (demo.mouse.captured) {
1071-
window.setInputMode(.cursor, zglfw.Cursor.Mode.normal);
1072-
window.setInputMode(.raw_mouse_motion, false);
1071+
window.setInputMode(.cursor, zglfw.Cursor.Mode.normal) catch unreachable;
1072+
window.setInputMode(.raw_mouse_motion, false) catch unreachable;
10731073
}
10741074
demo.mouse.captured = false;
10751075
}
10761076
if (window.getMouseButton(.right) == .press) {
10771077
if (!demo.mouse.captured) {
1078-
window.setInputMode(.cursor, zglfw.Cursor.Mode.disabled);
1079-
window.setInputMode(.raw_mouse_motion, true);
1078+
window.setInputMode(.cursor, zglfw.Cursor.Mode.disabled) catch unreachable;
1079+
window.setInputMode(.raw_mouse_motion, true) catch unreachable;
10801080
}
10811081
demo.mouse.captured = true;
10821082
}

0 commit comments

Comments
 (0)