Better handle screen resizes

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2026-02-08 22:18:00 +01:00
parent 941b7e0dae
commit 1db780c7a7
2 changed files with 39 additions and 43 deletions

View File

@@ -133,6 +133,14 @@ pub fn init(options: InitOptions, log_file: *LogFile, random: Random) !TerminalB
};
}
pub fn getWidthStatic() usize {
return @intCast(termbox.tb_width());
}
pub fn getHeightStatic() usize {
return @intCast(termbox.tb_height());
}
pub fn setCursorStatic(x: usize, y: usize) void {
_ = termbox.tb_set_cursor(@intCast(x), @intCast(y));
}
@@ -146,12 +154,8 @@ pub fn shutdownStatic() void {
_ = termbox.tb_shutdown();
}
pub fn presentBufferStatic() struct { width: usize, height: usize } {
pub fn presentBufferStatic() void {
_ = termbox.tb_present();
return .{
.width = @intCast(termbox.tb_width()),
.height = @intCast(termbox.tb_height()),
};
}
pub fn reclaim(self: TerminalBuffer) !void {