Basic d3d12 present hook
parent
8d3e8b5205
commit
9391822da5
@ -0,0 +1,19 @@
|
||||
#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);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#include <dxgi.h>
|
||||
#include <dxgi1_5.h>
|
||||
#include <dxgi1_4.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <d3d12.h>
|
||||
#else
|
||||
#include "/usr/include/wine/windows/d3d12.h"
|
||||
#endif
|
||||
#ifndef __D3D12_IMPL_H__
|
||||
#define __D3D12_IMPL_H__
|
||||
|
||||
namespace impl
|
||||
{
|
||||
namespace d3d12
|
||||
{
|
||||
void init();
|
||||
void uninit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // __D3D12_IMPL_H__
|
Loading…
Reference in New Issue