diff --git a/src/main.zig b/src/main.zig index 061fb22..c798de7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -99,17 +99,10 @@ const Buffer = struct { }; fn handleActive(win: mfb.Window(State), isActive: bool) callconv(.C) void { - // win.getUserData().?.*.active = isActive; + win.getUserData().?.*.active = isActive; var data = win.getUserData(); - std.log.info("got data", .{}); if (data) |value| { - // value.*.active = isActive; - _ = value; - } - if (isActive) { - std.log.info("activated!!!!!!!!!!!!", .{}); - } else { - std.log.info("deactivated", .{}); + value.*.active = isActive; } } @@ -121,7 +114,7 @@ pub fn main() !void { defer state.deinit(); var win = mfb.Window(State).open("Hello minifb-zig", Width, Height, .{ .resizable = true, .alwaysOnTop = true }) catch unreachable; - mfb.setTargetFPS(7); + mfb.setTargetFPS(30); win.setUserData(&state); win.setActiveCallback(handleActive); @@ -129,11 +122,6 @@ pub fn main() !void { var buf = try Buffer.init(alloc, Width, Height); defer buf.deinit(); - var aliasedState = win.getUserData(); - if (aliasedState) |value| { - std.log.info("Period: {d}", .{value.*.period}); - } - state.render(buf); while (win.waitSync()) { state.render(buf);