Skip to content

Commit 63267ce

Browse files
committed
BREAKING: Upgrade to zig 0.16.0
1 parent 4f9e031 commit 63267ce

18 files changed

Lines changed: 254 additions & 272 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ZIG
22
*zig-cache
33
*zig-out
4+
*zig-pkg
45

56
# VSCode
67

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Zig binding is licensed by [WTFPL](LICENSE)
3434

3535
## Zig version
3636

37-
Minimal is `0.15.1`. But you know try your version and believe.
37+
Minimal is `0.16.0`. But you know try your version and believe.
3838

3939
## Bgfx version
4040

build.zig

Lines changed: 95 additions & 99 deletions
Large diffs are not rendered by default.

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.{
22
.name = .zbgfx,
33
.fingerprint = 0xc48ed871c4086e4a,
4-
.version = "0.10.1",
5-
.minimum_zig_version = "0.15.2",
4+
.version = "0.11.0",
5+
.minimum_zig_version = "0.16.0",
66
.paths = .{
77
"includes",
88
"libs",

examples/build.zig.zon

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.name = .examples,
33
.fingerprint = 0x7bd0ad45636a9f2b,
44
.version = "0.1.0",
5-
.minimum_zig_version = "0.15.1",
5+
.minimum_zig_version = "0.16.0",
66
.paths = .{
77
"build.zig",
88
"build.zig.zon",
@@ -12,18 +12,18 @@
1212
.zbgfx = .{ .path = "../" },
1313

1414
.zglfw = .{
15-
.url = "https://github.com/zig-gamedev/zglfw/archive/0dd29d8073487c9fe1e45e6b729b3aac271d5a71.tar.gz",
16-
.hash = "zglfw-0.10.0-dev-zgVDNIG4IQBWN_sfMD-xfC9bJS2hbBN2W7jNlDLovcdC",
15+
.url = "https://github.com/cyberegoorg/zglfw/archive/refs/heads/upgrade_to_zig_16.tar.gz",
16+
.hash = "zglfw-0.10.0-dev-zgVDNHi4IQAEEARFQfqY4N3fPYOEtWC2Kcut3iNHETbs",
1717
},
1818

1919
.zgui = .{
20-
.url = "https://github.com/zig-gamedev/zgui/archive/ce016156a8520c438e886cd6c0b605e10ee7af3d.tar.gz",
21-
.hash = "zgui-0.6.0-dev--L6sZKkSbgCUBXLVfwJDPpMkETz7ll-mmQYQae-nMxjt",
20+
.url = "https://github.com/cyberegoorg/zgui/archive/refs/heads/upgrade_to_zig_16.tar.gz",
21+
.hash = "zgui-0.6.0-dev--L6sZMuAcQDjqZqVM-2t89cR17mtI2Y9Z5zI_CxSiUzj",
2222
},
2323

2424
.zmath = .{
25-
.url = "https://github.com/zig-gamedev/zmath/archive/3a5955b2b72cd081563fbb084eff05bffd1e3fbb.tar.gz",
26-
.hash = "zmath-0.11.0-dev-wjwivdMsAwD-xaLj76YHUq3t9JDH-X16xuMTmnDzqbu2",
25+
.url = "https://github.com/cyberegoorg/zmath/archive/refs/heads/upgrade_to_zig_16.tar.gz",
26+
.hash = "zmath-0.11.0-dev-wjwivdIpAwA-VEYhjjdf2WjyjWolLDaHGgahznV361dV",
2727
},
2828
},
2929
}

examples/debugdraw/build_sample.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ pub fn build(
4646
}),
4747
});
4848
b.installArtifact(exe);
49-
exe.linkLibrary(zbgfx_dep.artifact("bgfx"));
49+
exe.root_module.linkLibrary(zbgfx_dep.artifact("bgfx"));
5050

5151
exe.root_module.addImport("zbgfx", zbgfx_dep.module("zbgfx"));
5252

5353
exe.root_module.addImport("zmath", zmath.module("root"));
5454
exe.root_module.addImport("zglfw", zglfw.module("root"));
55-
exe.linkLibrary(zglfw.artifact("glfw"));
55+
exe.root_module.linkLibrary(zglfw.artifact("glfw"));
5656
}

examples/debugdraw/src/main.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ pub fn main() anyerror!u8 {
130130
//
131131
// Main loop
132132
//
133-
const start_time: i64 = std.time.milliTimestamp();
134-
_ = start_time; // autofix
135133
while (!window.shouldClose() and window.getKey(.escape) != .press) {
136134
//
137135
// Poll events

examples/minimal-glfw/build_sample.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ pub fn build(
4646
}),
4747
});
4848
b.installArtifact(exe);
49-
exe.linkLibrary(zbgfx_dep.artifact("bgfx"));
49+
exe.root_module.linkLibrary(zbgfx_dep.artifact("bgfx"));
5050

5151
exe.root_module.addImport("zbgfx", zbgfx_dep.module("zbgfx"));
5252
exe.root_module.addImport("zmath", zmath.module("root"));
5353
exe.root_module.addImport("zglfw", zglfw.module("root"));
54-
exe.linkLibrary(zglfw.artifact("glfw"));
54+
exe.root_module.linkLibrary(zglfw.artifact("glfw"));
5555
}
5656

5757
inline fn thisDir() []const u8 {

examples/shader-embed/build_sample.zig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ pub fn build(
7272
}),
7373
});
7474
b.installArtifact(exe);
75-
exe.linkLibrary(zbgfx_dep.artifact("bgfx"));
76-
75+
exe.root_module.linkLibrary(zbgfx_dep.artifact("bgfx"));
7776
exe.root_module.addImport("zbgfx", zbgfx_dep.module("zbgfx"));
7877
exe.root_module.addImport("zmath", zmath.module("root"));
7978
exe.root_module.addImport("zglfw", zglfw.module("root"));
80-
8179
exe.root_module.addImport("shaders", shaders_module);
82-
83-
exe.linkLibrary(zglfw.artifact("glfw"));
80+
exe.root_module.linkLibrary(zglfw.artifact("glfw"));
8481
}

examples/shader-embed/src/main.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var last_d = zglfw.Action.release;
8585
var old_flags = bgfx.ResetFlags_None;
8686
var old_size = [2]i32{ WIDTH, HEIGHT };
8787

88-
pub fn main() anyerror!u8 {
88+
pub fn main(init: std.process.Init) anyerror!u8 {
8989
//
9090
// Init zglfw
9191
//
@@ -214,7 +214,7 @@ pub fn main() anyerror!u8 {
214214
//
215215
// Main loop
216216
//
217-
const start_time: i64 = std.time.milliTimestamp();
217+
const start = std.Io.Clock.awake.now(init.io);
218218
while (!window.shouldClose() and window.getKey(.escape) != .press) {
219219
//
220220
// Poll events
@@ -285,7 +285,7 @@ pub fn main() anyerror!u8 {
285285
// Render cubes
286286
//
287287
var yy: f32 = 0;
288-
const time: f32 = @as(f32, @floatFromInt(std.time.milliTimestamp() - start_time)) / std.time.ms_per_s;
288+
const time: f32 = @as(f32, @floatFromInt(start.untilNow(init.io, .awake).toMilliseconds())) / std.time.ms_per_s;
289289
while (yy < 11) : (yy += 1.0) {
290290
var xx: f32 = 0;
291291
while (xx < 11) : (xx += 1.0) {

0 commit comments

Comments
 (0)