ghostty/pkg/imgui/impl_glfw.zig
Mitchell Hashimoto c1b70cb788 metal: devmode
2022-10-31 09:44:37 -07:00

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;
};