mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
27 lines
581 B
Zig
27 lines
581 B
Zig
const std = @import("std");
|
|
const c = @import("c.zig");
|
|
const imgui = @import("main.zig");
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
pub const IO = opaque {
|
|
pub fn get() Allocator.Error!*IO {
|
|
return @ptrCast(
|
|
?*IO,
|
|
c.igGetIO(),
|
|
) orelse Allocator.Error.OutOfMemory;
|
|
}
|
|
|
|
pub inline fn cval(self: *IO) *c.ImGuiIO {
|
|
return @ptrCast(
|
|
*c.ImGuiIO,
|
|
@alignCast(@alignOf(c.ImGuiIO), self),
|
|
);
|
|
}
|
|
};
|
|
|
|
test {
|
|
const ctx = try imgui.Context.create();
|
|
defer ctx.destroy();
|
|
_ = try IO.get();
|
|
}
|