A DirectX hook that works with DirectX11 and DirectX12 in 32-bit and 64-bit modes.
Basically this library lets you render your own things inside the game window, as an integrated part of the game rather than as an external overlay. A straightforward but primitive overlay framework is included so you can quickly and easily start creating overlays. Tutorial below.
-video to be added-
-video to be added-
First, check the wiki page on how to quickly set up the Visual Studio solution.
When the project is built, "dinput8.dll" will be generated in the project folder. This must be copied next to a game executable which uses DirectX 11 or 12. The game will then load the .dll automatically on startup and will render what you told it to.
Also note that the "hook_textures" folder containing "blank.jpg" must be present next to dxgi.dll in order for anything to render.
Create a .cpp and .h file in the Overlays folder (optionally put these inside a parent folder):
Create a class that inherits from the IRenderCallback interface and includes "OverlayFramework.h":
Define the Setup() and Render() functions in the .cpp file:
Note: Setup() is called once and Render() is called every frame. InitFramework() must be called on the very first line in Setup().
Make the hook render your stuff by adding these lines in DllMain.cpp:
But we have yet to define anything to render...
All rendering with the overlay framework is done using Boxes:
Boxes are a simple struct with data that the framework manages.
The rest are self-explanatory. Do not modify visible or z.
Create some boxes and render them:
Result:
Boxes can be rendered with either textures or colors:
Note: textures should be loaded in Setup().
Result:
Text can be rendered inside Boxes:
Note: a font must be set before rendering text.
Result:
Feel free to create issues or contribute code to the repo.
Feel free to use this code for anything and however you like, but if you create something with it then it would be cool if you could show me what you made :)