Win32 basic d3d11 present hook
parent
86703ee364
commit
ac821df7fa
@ -0,0 +1,28 @@
|
|||||||
|
#include "kiero.h"
|
||||||
|
|
||||||
|
#if KIERO_INCLUDE_D3D11
|
||||||
|
|
||||||
|
#include "d3d11_hook.h"
|
||||||
|
#include <d3d11.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "d3d_shared.h"
|
||||||
|
|
||||||
|
typedef long(__stdcall* Present)(IDXGISwapChain*, UINT, UINT);
|
||||||
|
static Present oPresent = NULL;
|
||||||
|
|
||||||
|
long __stdcall hkPresent11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
|
||||||
|
{
|
||||||
|
d3d_run();
|
||||||
|
return oPresent(pSwapChain, SyncInterval, Flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void impl::d3d11::init()
|
||||||
|
{
|
||||||
|
printf("init d3d11\n");
|
||||||
|
auto ret = kiero::bind(8, (void**)&oPresent, reinterpret_cast<void *>(hkPresent11));
|
||||||
|
assert(ret == kiero::Status::Success);
|
||||||
|
init_d3d_shared();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // KIERO_INCLUDE_D3D11
|
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __D3D11_IMPL_H__
|
||||||
|
#define __D3D11_IMPL_H__
|
||||||
|
|
||||||
|
namespace impl
|
||||||
|
{
|
||||||
|
namespace d3d11
|
||||||
|
{
|
||||||
|
void init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __D3D11_IMPL_H__
|
Loading…
Reference in New Issue