mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03: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