From a10cbc34197e8ebcca2ccb1d67e44a2cee186909 Mon Sep 17 00:00:00 2001 From: foxnne Date: Sun, 8 Dec 2024 12:26:51 -0600 Subject: [PATCH] build: update `mach-objc` build.zig.zon, and small corrections to `core-transparent-window` example --- build.zig.zon | 4 ++-- examples/core-transparent-window/App.zig | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 51bc783384..e36c945237 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -22,8 +22,8 @@ .lazy = true, }, .mach_objc = .{ - .url = "https://pkg.machengine.org/mach-objc/0edc9de456ec90e06006211c8bf0fd72fc8ac0ad.tar.gz", - .hash = "122033028b2bac8c51706c7dcd8133e93215daac758fd7b22d6a020f898358da7cbe", + .url = "https://pkg.machengine.org/mach-objc/eb1e1eee9c02039d582f5fd9814d32e48b736ba6.tar.gz", + .hash = "12209742f139402c34a8901bfb012a748c7101bef971f0a541338d659baa345b237d", .lazy = true, }, .xcode_frameworks = .{ diff --git a/examples/core-transparent-window/App.zig b/examples/core-transparent-window/App.zig index e4fd754939..fcb20b0787 100644 --- a/examples/core-transparent-window/App.zig +++ b/examples/core-transparent-window/App.zig @@ -19,7 +19,7 @@ title_timer: mach.time.Timer, color_timer: mach.time.Timer, color_time: f32 = 0.0, flip: bool = false, -pipeline: *gpu.RenderPipeline, +pipeline: *gpu.RenderPipeline = undefined, pub fn init( core: *mach.Core, @@ -31,7 +31,7 @@ pub fn init( const window = try core.windows.new(.{ .title = "core-transparent-window", - .vsync_mode = .triple, + .vsync_mode = .double, }); // Store our render pipeline in our module's state, so we can access it later on. @@ -39,7 +39,6 @@ pub fn init( .window = window, .title_timer = try mach.time.Timer.start(), .color_timer = try mach.time.Timer.start(), - .pipeline = undefined, }; } @@ -89,7 +88,7 @@ pub fn tick(app: *App, core: *mach.Core) void { .window_open => |ev| { try setupPipeline(core, app, ev.window_id); }, - .key_press => |ev| { + .key_repeat, .key_press => |ev| { switch (ev.key) { .right => { core.windows.set(app.window, .width, core.windows.get(app.window, .width) + 10); @@ -154,7 +153,7 @@ pub fn tick(app: *App, core: *mach.Core) void { app.title_timer.reset(); // TODO(object): window-title - core.windows.set(app.window, .title, std.fmt.allocPrintZ(core.allocator, "core-custom-entrypoint [ {d}fps ] [ Input {d}hz ]", .{ core.frame.rate, core.input.rate }) catch unreachable); + core.windows.set(app.window, .title, std.fmt.allocPrintZ(core.allocator, "core-transparent-window [ {d}fps ] [ Input {d}hz ]", .{ core.frame.rate, core.input.rate }) catch unreachable); } if (app.color_time >= 4.0 or app.color_time <= 0.0) {