Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iris

Iris is a small C++23 DirectX hooking layer for Windows. It detects DirectX 11 and DirectX 12 swap chains, manages the DirectX and ImGui backend lifecycle, and forwards rendering to client code.

Iris is independent of the hooking library used by the client. Hook installation and synchronization are provided through a small interface.

Features

  • DirectX 11 and DirectX 12 detection
  • Present hooks for client rendering
  • ResizeBuffers support for DirectX 11 and DirectX 12
  • ResizeBuffers1 and command-queue support for DirectX 12
  • ImGui Win32, DX11, and DX12 backend lifecycle
  • Bring-your-own-hook integration
  • Safe shutdown after hook callbacks have finished

Requirements

  • 64-bit Windows
  • A C++23 compiler
  • Dear ImGui with the Win32, DX11, and DX12 backends
  • DirectX 11, DirectX 12, and DXGI libraries

Iris currently ships as source files. Add the repository's .cpp files to your target and expose the repository root as an include directory.

Interfaces

Implement iris::provider::HookProvider with the hooking library used by your project. Installed hooks must initially be disabled, and install() must return the callable original address.

synchronize() must return true only when no other thread is executing a detour or trampoline that will be removed during shutdown.

Implement iris::directx::DirectXEvents in the client renderer:

class Renderer final : public iris::directx::DirectXEvents {
public:
    void render() const noexcept override;
};

Iris starts the appropriate ImGui frame before calling render().

Lifecycle

Initialize Iris with the hook provider and renderer:

if (!iris::directx::initialize(hook_provider, renderer)) {
    return false;
}

Before unloading the containing module, retry shutdown until hook synchronization succeeds:

while (!iris::directx::shutdown()) {
    Sleep(50);
}

The hook provider and renderer must remain alive until shutdown returns true.

See example-iris for a SafetyHook implementation and a minimal injected DLL.

License

Iris is available under the MIT License.

About

A small C++23 DirectX hooking layer for Windows.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages