Skip to content

Commit d9d918a

Browse files
authored
Merge pull request #51 from kcbanner/imgui-1.92.1
Upgrade to 1.92.1 & Zig 0.15.1
2 parents 068c563 + 1fb04cb commit d9d918a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+11995
-7332
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Easy to use, hand-crafted API with default arguments, named parameters and Zig s
1616

1717
## Versions
1818

19-
* [ImGui](https://github.com/ocornut/imgui/tree/v1.91.8-docking) `1.91.8-docking`
20-
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.91.8) `1.91.8`
21-
* [ImPlot](https://github.com/epezent/implot) `O.17`
22-
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.89 WIP`
23-
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `O.9.3`
19+
* [ImGui](https://github.com/ocornut/imgui/tree/v1.92.1-docking) `1.92.1-docking`
20+
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.92.1) `1.92.1`
21+
* [ImPlot](https://github.com/epezent/implot) `3da8bd3`
22+
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.91.3 WIP`
23+
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `e78e447`
2424

2525
## Getting started
2626

build.zig

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,31 @@ pub fn build(b: *std.Build) void {
9393
"-Wno-availability",
9494
};
9595

96-
const imgui = if (options.shared) blk: {
97-
const lib = b.addSharedLibrary(.{
98-
.name = "imgui",
96+
const imgui = b.addLibrary(.{
97+
.name = "imgui",
98+
.linkage = if (options.shared) .dynamic else .static,
99+
.root_module = b.createModule(.{
99100
.target = target,
100101
.optimize = optimize,
101-
});
102+
}),
103+
});
102104

105+
imgui.root_module.addCMacro("IMGUI_DISABLE_OBSOLETE_FUNCTIONS", "");
106+
107+
if (options.shared) {
103108
if (target.result.os.tag == .windows) {
104-
lib.root_module.addCMacro("IMGUI_API", "__declspec(dllexport)");
105-
lib.root_module.addCMacro("IMPLOT_API", "__declspec(dllexport)");
106-
lib.root_module.addCMacro("ZGUI_API", "__declspec(dllexport)");
109+
imgui.root_module.addCMacro("IMGUI_API", "__declspec(dllexport)");
110+
imgui.root_module.addCMacro("IMGUI_IMPL_API", "extern \"C\" __declspec(dllexport)");
111+
imgui.root_module.addCMacro("IMPLOT_API", "__declspec(dllexport)");
112+
imgui.root_module.addCMacro("ZGUI_API", "__declspec(dllexport)");
113+
} else {
114+
imgui.root_module.addCMacro("IMGUI_IMPL_API", "extern \"C\"");
107115
}
108116

109117
if (target.result.os.tag == .macos) {
110-
lib.linker_allow_shlib_undefined = true;
118+
imgui.linker_allow_shlib_undefined = true;
111119
}
112-
113-
break :blk lib;
114-
} else b.addStaticLibrary(.{
115-
.name = "imgui",
116-
.target = target,
117-
.optimize = optimize,
118-
});
120+
}
119121

120122
b.installArtifact(imgui);
121123

@@ -423,9 +425,11 @@ pub fn build(b: *std.Build) void {
423425

424426
const tests = b.addTest(.{
425427
.name = "zgui-tests",
426-
.root_source_file = b.path("src/gui.zig"),
427-
.target = target,
428-
.optimize = optimize,
428+
.root_module = b.createModule(.{
429+
.root_source_file = b.path("src/gui.zig"),
430+
.target = target,
431+
.optimize = optimize,
432+
}),
429433
});
430434
b.installArtifact(tests);
431435

build.zig.zon

Lines changed: 7 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,18 +18,18 @@
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/kcbanner/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/kcbanner/zsdl/archive/a764b0ee51a157a6133007e4f423a869df9e31d7.tar.gz",
32+
.hash = "zsdl-0.4.0-dev-rFpjE2BgWQADibKkkIjv0Ig8k96MOu3Yeo6e0n9OD85L",
3333
.lazy = true,
3434
},
3535
.freetype = .{

0 commit comments

Comments
 (0)