You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MangoHud/src/win/d3d12_hook.cpp

19 lines
580 B
C++

#include "kiero.h"
#include "d3d12_hook.h"
#include <cstdio>
#include <cassert>
#include <functional>
typedef long(__fastcall* PresentD3D12) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
PresentD3D12 oPresentD3D12;
long __fastcall hkPresent12(IDXGISwapChain3* pSwapChain, UINT SyncInterval, UINT Flags){
printf("d3d12 present\n");
return oPresentD3D12(pSwapChain, SyncInterval, Flags);
}
void impl::d3d12::init()
{
auto ret = kiero::bind(140, (void**)&oPresentD3D12, reinterpret_cast<void*>(hkPresent12));
assert(ret == kiero::Status::Success);
}