mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-06 21:37:49 +00:00
pkg/imgui: support context current
This commit is contained in:
@@ -14,6 +14,10 @@ pub const Context = opaque {
|
||||
c.igDestroyContext(self.cval());
|
||||
}
|
||||
|
||||
pub fn setCurrent(self: *Context) void {
|
||||
c.igSetCurrentContext(self.cval());
|
||||
}
|
||||
|
||||
pub inline fn cval(self: *Context) *c.ImGuiContext {
|
||||
return @ptrCast(
|
||||
*c.ImGuiContext,
|
||||
@@ -25,4 +29,6 @@ pub const Context = opaque {
|
||||
test {
|
||||
var ctx = try Context.create();
|
||||
defer ctx.destroy();
|
||||
|
||||
ctx.setCurrent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user