#hook #direct-x #opengl #render #applications #imgui

hudhook

一个带有 dear imgui 渲染循环的图形 API 钩子。支持 DirectX 9、11、12 和 OpenGL 3。

17 个不稳定版本 (6 个重大更改)

0.7.1 2024 年 7 月 11 日
0.7.0 2024 年 5 月 24 日
0.6.5 2024 年 3 月 12 日
0.5.0 2023 年 9 月 28 日
0.1.5 2020 年 9 月 25 日

#80 in 图形 API

Download history 10/week @ 2024-05-04 94/week @ 2024-05-18 51/week @ 2024-05-25 27/week @ 2024-06-01 17/week @ 2024-06-08 11/week @ 2024-06-15 22/week @ 2024-06-22 14/week @ 2024-06-29 130/week @ 2024-07-06 25/week @ 2024-07-13 17/week @ 2024-07-20 184/week @ 2024-07-27 30/week @ 2024-08-03 18/week @ 2024-08-10 67/week @ 2024-08-17

每月 301 次下载

自定义许可证

275KB
6.5K SLoC

Rust 4.5K SLoC // 0.0% comments C 1.5K SLoC // 0.1% comments

hudhook

GitHub Actions Workflow Status GitHub Release Crates.io Version GitHub License Discord book rustdoc Patreon

一个用于构建 Dear ImGui 窗口的 Rust 渲染钩子库。

目前支持 DirectX 9、DirectX 11、DirectX 12 和 OpenGL 3。在 Windows 和 Wine/Proton 上运行。

hello

资源

支持项目

如果您喜欢 hudhook 并想支持该项目,您可以通过我的 Patreon 来支持。

我很高兴这个项目对您有帮助,并对您的支持表示感谢!谢谢!

示例

// src/lib.rs
use hudhook::*;

pub struct MyRenderLoop;

impl ImguiRenderLoop for MyRenderLoop {
    fn render(&mut self, ui: &mut imgui::Ui) {
        ui.window("My first render loop")
            .position([0., 0.], imgui::Condition::FirstUseEver)
            .size([320., 200.], imgui::Condition::FirstUseEver)
            .build(|| {
                ui.text("Hello, hello!");
            });
    }
}

{
    // Use this if hooking into a DirectX 9 application.
    use hudhook::hooks::dx9::ImguiDx9Hooks;
    hudhook!(ImguiDx9Hooks, MyRenderLoop);
}

{
    // Use this if hooking into a DirectX 11 application.
    use hudhook::hooks::dx11::ImguiDx11Hooks;
    hudhook!(ImguiDx11Hooks, MyRenderLoop);
}

{
    // Use this if hooking into a DirectX 12 application.
    use hudhook::hooks::dx12::ImguiDx12Hooks;
    hudhook!(ImguiDx12Hooks, MyRenderLoop);
}

{
    // Use this if hooking into an OpenGL 3 application.
    use hudhook::hooks::opengl3::ImguiOpenGl3Hooks;
    hudhook!(ImguiOpenGl3Hooks, MyRenderLoop);
}
// src/main.rs
use hudhook::inject::Process;

fn main() {
    let mut cur_exe = std::env::current_exe().unwrap();
    cur_exe.push("..");
    cur_exe.push("libmyhook.dll");

    let cur_dll = cur_exe.canonicalize().unwrap();

    Process::by_name("MyTargetApplication.exe").unwrap().inject(cur_dll).unwrap();
}

依赖项

~146MB
~2.5M SLoC