Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/gui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ pub fn deinit() void {
mem_allocator = null;
}
}
pub fn initNoContext() void {
pub fn initNoContext(allocator: std.mem.Allocator) void {
mem_allocator = allocator;
if (temp_buffer == null) {
temp_buffer = std.ArrayList(u8){};
temp_buffer.?.resize(3 * 1024 + 1) catch unreachable;
temp_buffer.?.resize(mem_allocator.?, 3 * 1024 + 1) catch unreachable;
}
}
pub fn deinitNoContext() void {
if (temp_buffer) |buf| {
buf.deinit();
if (temp_buffer) |*buf| {
buf.deinit(mem_allocator.?);
}
}
extern fn zguiCreateContext(shared_font_atlas: ?*const anyopaque) Context;
Expand Down