mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-30 19:11:39 +00:00
Imgui (#20)
* vendor/cimgui * Add a "dev mode" window which for now is just imgui demo
This commit is contained in:
committed by
GitHub
parent
ddfb1dec4b
commit
f29393bca6
20
pkg/imgui/draw_data.zig
Normal file
20
pkg/imgui/draw_data.zig
Normal file
@@ -0,0 +1,20 @@
|
||||
const std = @import("std");
|
||||
const c = @import("c.zig");
|
||||
const imgui = @import("main.zig");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
pub const DrawData = opaque {
|
||||
pub fn get() Allocator.Error!*DrawData {
|
||||
return @ptrCast(
|
||||
?*DrawData,
|
||||
c.igGetDrawData(),
|
||||
) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub inline fn cval(self: *DrawData) *c.ImGuiDrawData {
|
||||
return @ptrCast(
|
||||
*c.ImGuiDrawData,
|
||||
@alignCast(@alignOf(c.ImGuiDrawData), self),
|
||||
);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user