Universal graphical hook for Windows apps that will display an ImGui Demo Window as an example.
The purpose of this library is to show how to hook different backends to display ImGui, the code should be easy to understand as I tried to make everything seem almost the same, see backends folder.
How it works
We create a ‘dummy device’ and a ‘dummy swapchain’ (for DirectX10 and higher) with a handle to the console window. See the
CreateDeviceD3DX function in every DirectX backend. See DX12 example ‘CreateDeviceD3D12’. The point is to get a pointer to the vTable to get the required functions addresses. We release it right after getting the pointers because we won’t use our ‘dummy device’ and ‘dummy swapchain’ for drawing. Code used in DX12 backend hook.
We hook wglSwapBuffers which is an exported function in opengl32.dll. See code used in OpenGL backend
OpenGL 32bit + 64bit
Feel free to open an issue if something isn’t working, personally I couldn’t get it to work on ‘Far Cry 6’. Resizing works because ResizeBuffers is hooked. Input handling is up to you to decide how to make/use it. The WndProc hook is here. It should support both 64bit and 32bit architectures.
Try pressing HOME to rehook and see if things got better. Minecraft (tested on 1.19) – menu textures glitched