hudhook

Crates.iohudhook
lib.rshudhook
version0.8.0
sourcesrc
created_at2020-09-12 09:33:17.598973
updated_at2024-11-06 07:44:48.231845
descriptionA graphics API hook with dear imgui render loop. Supports DirectX 9, 11, 12, and OpenGL 3.
homepagehttps://github.com/veeenu/hudhook
repositoryhttps://github.com/veeenu/hudhook
max_upload_size
id287680
size562,746
Andrea Venuta (veeenu)

documentation

https://veeenu.github.io/hudhook

README

hudhook

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

A Rust renderer hook library for building Dear ImGui overlays.

Currently supports DirectX 9, DirectX 11, DirectX 12 and OpenGL 3. Runs on Windows and Wine/Proton.

hello

Resources

Supporting the project

If you like hudhook and would like to support the project, you can do so via my Patreon.

I'm glad the project works for you and I'm grateful for your support. Thank you!

Example

// 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();
}
Commit count: 183

cargo fmt