Skip to content

Commit ea1380e

Browse files
committed
Upgrade to Zig 0.15.1
1 parent 92e8cb8 commit ea1380e

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ defer zgui.deinit();
115115
In your shared library:
116116
```zig
117117
const zgui = @import("zgui");
118-
zgui.initNoContext(allocator);
118+
zgui.initNoContext();
119119
defer zgui.deinitNoContxt();
120120
```
121121

build.zig.zon

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.name = .zgui,
33
.fingerprint = 0xe78160e64acbef8,
44
.version = "0.6.0-dev",
5-
.minimum_zig_version = "0.14.0",
5+
.minimum_zig_version = "0.15.1",
66
.paths = .{
77
"build.zig",
88
"build.zig.zon",
@@ -18,24 +18,28 @@
1818
.lazy = true,
1919
},
2020
.zglfw = .{
21-
.url = "https://github.com/zig-gamedev/zglfw/archive/c337cb3d3f984468ea7a386335937a5d555fc024.tar.gz",
22-
.hash = "zglfw-0.10.0-dev-zgVDNMacIQA-k7kNSfwUc9Lfzx-bb_wklVm25K-p8Tr7",
21+
.url = "https://github.com/zig-gamedev/zglfw/archive/feeeff9386dd44ba2c18488113023865c41b80a4.tar.gz",
22+
.hash = "zglfw-0.10.0-dev-zgVDNLyhIQCZR_rbIf7hnCKuifzcmPOLOQhd_hrqq8cl",
2323
.lazy = true,
2424
},
2525
.zgpu = .{
26-
.url = "https://github.com/zig-gamedev/zgpu/archive/d860e2b4a333cacffb168fab49a233c5d2f1bca2.tar.gz",
27-
.hash = "zgpu-0.12.0-dev-nqFT5EKgCADkhwAf97_pfSOmPWEguKmljSECs9ihpFS7",
26+
.url = "https://github.com/zig-gamedev/zgpu/archive/96f3ce2229e4836daec714a3f0b8c3c3218a6b2c.tar.gz",
27+
.hash = "zgpu-0.12.0-dev-nqFT5LqgCACR_1wEhi7rveY3ocKJczfRaXQoisCmpohn",
2828
.lazy = true,
2929
},
3030
.zsdl = .{
31-
.url = "https://github.com/zig-gamedev/zsdl/archive/89c1fe2d7ef5020c68e71ac574195f09fc949cce.tar.gz",
32-
.hash = "zsdl-0.4.0-dev-rFpjE5FXWQAHcbsSHDjFtbTkruSgvRVYOae6x8RXCnoM",
31+
.url = "https://github.com/zig-gamedev/zsdl/archive/a764b0ee51a157a6133007e4f423a869df9e31d7.tar.gz",
32+
.hash = "zsdl-0.4.0-dev-rFpjE2BgWQADibKkkIjv0Ig8k96MOu3Yeo6e0n9OD85L",
3333
.lazy = true,
3434
},
3535
.freetype = .{
3636
.url = "https://github.com/hexops/freetype/archive/972cd37bccecae2cc9f54cf0b562263a13209d02.tar.gz",
3737
.hash = "freetype-0.0.0-AAAAAA5JcwBMujojfNLEq5g_WijZtU56mRLYx8bjjiMU",
3838
.lazy = true,
3939
},
40+
.zopengl = .{
41+
.url = "https://github.com/zig-gamedev/zopengl/archive/33ae578d91692c814e7d6b4b42573142475f68d0.tar.gz",
42+
.hash = "zopengl-0.6.0-dev-5-tnz7Y8CQCW_JRgxPCM4ETsKGOGHddqw5y1XaXhrsb4",
43+
},
4044
},
4145
}

src/gui.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ pub fn init(allocator: std.mem.Allocator) void {
5151

5252
_ = zguiCreateContext(null);
5353

54-
temp_buffer = std.ArrayList(u8).init(allocator);
55-
temp_buffer.?.resize(3 * 1024 + 1) catch unreachable;
54+
temp_buffer = std.ArrayList(u8){};
55+
temp_buffer.?.resize(allocator, 3 * 1024 + 1) catch unreachable;
5656

5757
if (te_enabled) {
5858
te.init();
@@ -70,7 +70,7 @@ pub fn initWithExistingContext(allocator: std.mem.Allocator, ctx: Context) void
7070

7171
zguiSetCurrentContext(ctx);
7272

73-
temp_buffer = std.ArrayList(u8).init(allocator);
73+
temp_buffer = std.ArrayList(u8){};
7474
temp_buffer.?.resize(3 * 1024 + 1) catch unreachable;
7575

7676
if (te_enabled) {
@@ -82,7 +82,7 @@ pub fn getCurrentContext() ?Context {
8282
}
8383
pub fn deinit() void {
8484
if (zguiGetCurrentContext() != null) {
85-
temp_buffer.?.deinit();
85+
temp_buffer.?.deinit(mem_allocator.?);
8686
zguiDestroyContext(null);
8787

8888
// Must be after destroy imgui context.
@@ -111,9 +111,9 @@ pub fn deinit() void {
111111
mem_allocator = null;
112112
}
113113
}
114-
pub fn initNoContext(allocator: std.mem.Allocator) void {
114+
pub fn initNoContext() void {
115115
if (temp_buffer == null) {
116-
temp_buffer = std.ArrayList(u8).init(allocator);
116+
temp_buffer = std.ArrayList(u8){};
117117
temp_buffer.?.resize(3 * 1024 + 1) catch unreachable;
118118
}
119119
}

0 commit comments

Comments
 (0)