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.
- DirectX 11 and DirectX 12 detection
- Present hooks for client rendering
ResizeBufferssupport for DirectX 11 and DirectX 12ResizeBuffers1and 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
- 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.
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().
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.
Iris is available under the MIT License.