feat: update to new render-request API

This commit is contained in:
LordMZTE 2022-11-29 16:00:57 +01:00
parent a65f559eac
commit 22c36f6a47
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
1 changed files with 4 additions and 2 deletions

View File

@ -28,11 +28,11 @@ pub fn init() void {
var event_heap: [1024 * 128]u8 = undefined;
var event_fba = std.heap.FixedBufferAllocator.init(&event_heap);
pub fn update() void {
pub fn update() bool {
defer event_fba.end_index = 0;
var ev = zz.getEvent(event_fba.allocator()) catch |e| {
std.log.err("Failed to deserialize event: {}", .{e});
return;
return false;
};
switch (ev.data) {
@ -40,9 +40,11 @@ pub fn update() void {
mode = info.mode;
pal = info.style.colors;
keymap.populate(info.keybinds);
return true;
},
else => {},
}
return false;
}
fn tryRender(cols: usize) !void {