mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
34 lines
1.0 KiB
Zig
34 lines
1.0 KiB
Zig
const std = @import("std");
|
|
const c = @import("c.zig");
|
|
const imgui = @import("main.zig");
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
pub const ImplGlfw = struct {
|
|
pub const GLFWWindow = opaque {};
|
|
|
|
pub fn initForOpenGL(win: *GLFWWindow, install_callbacks: bool) bool {
|
|
// https://github.com/ocornut/imgui/issues/5785
|
|
defer _ = glfwGetError(null);
|
|
|
|
return ImGui_ImplGlfw_InitForOpenGL(win, install_callbacks);
|
|
}
|
|
|
|
pub fn initForOther(win: *GLFWWindow, install_callbacks: bool) bool {
|
|
return ImGui_ImplGlfw_InitForOther(win, install_callbacks);
|
|
}
|
|
|
|
pub fn shutdown() void {
|
|
return ImGui_ImplGlfw_Shutdown();
|
|
}
|
|
|
|
pub fn newFrame() void {
|
|
return ImGui_ImplGlfw_NewFrame();
|
|
}
|
|
|
|
extern "c" fn glfwGetError(?*const anyopaque) c_int;
|
|
extern "c" fn ImGui_ImplGlfw_InitForOpenGL(*GLFWWindow, bool) bool;
|
|
extern "c" fn ImGui_ImplGlfw_InitForOther(*GLFWWindow, bool) bool;
|
|
extern "c" fn ImGui_ImplGlfw_Shutdown() void;
|
|
extern "c" fn ImGui_ImplGlfw_NewFrame() void;
|
|
};
|