mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
pkg/cimgui: add metal backend
This commit is contained in:
@ -47,6 +47,14 @@ pub fn build(b: *std.Build) !void {
|
||||
.flags = flags.items,
|
||||
});
|
||||
|
||||
if (target.isDarwin()) {
|
||||
if (!target.isNative()) try @import("apple_sdk").addPaths(b, lib);
|
||||
lib.addCSourceFile(.{
|
||||
.file = imgui.path("backends/imgui_impl_metal.mm"),
|
||||
.flags = flags.items,
|
||||
});
|
||||
}
|
||||
|
||||
lib.installHeadersDirectoryOptions(.{
|
||||
.source_dir = .{ .path = "vendor" },
|
||||
.install_dir = .header,
|
||||
|
@ -9,5 +9,7 @@
|
||||
.url = "https://github.com/ocornut/imgui/archive/1d8e48c161370c37628c4f37f3f87cb19fbcb723.tar.gz",
|
||||
.hash = "12205e93e208aada4c835acdc3e2c1fac95b3ad92b47abe6412ab043f9f13817ad9b",
|
||||
},
|
||||
|
||||
.apple_sdk = .{ .path = "../apple-sdk" },
|
||||
},
|
||||
}
|
||||
|
@ -11,3 +11,9 @@ pub extern fn ImGui_ImplOpenGL3_Init(?[*:0]const u8) callconv(.C) void;
|
||||
pub extern fn ImGui_ImplOpenGL3_Shutdown() callconv(.C) void;
|
||||
pub extern fn ImGui_ImplOpenGL3_NewFrame() callconv(.C) void;
|
||||
pub extern fn ImGui_ImplOpenGL3_RenderDrawData(*c.ImDrawData) callconv(.C) void;
|
||||
|
||||
// Metal
|
||||
pub extern fn ImGui_ImplMetal_Init(*anyopaque) callconv(.C) bool;
|
||||
pub extern fn ImGui_ImplMetal_Shutdown() callconv(.C) void;
|
||||
pub extern fn ImGui_ImplMetal_NewFrame(*anyopaque) callconv(.C) void;
|
||||
pub extern fn ImGui_ImplMetal_RenderDrawData(*c.ImDrawData, *anyopaque, *anyopaque) callconv(.C) void;
|
||||
|
Reference in New Issue
Block a user