2020-12-02 16:19:16 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
typedef HRESULT(CALLBACK *f_Present9)(IDirect3DDevice9*, RECT*, RECT*, HWND, RGNDATA*);
|
|
|
|
typedef HRESULT(CALLBACK *f_Present11)(IDXGISwapChain*, UINT, UINT);
|
2021-01-11 13:07:10 -05:00
|
|
|
typedef HRESULT(CALLBACK *f_Reset)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
class Hook
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static WNDPROC oWndProc;
|
|
|
|
static f_Present11 oPresent11;
|
|
|
|
static f_Present9 oPresent9;
|
2021-01-11 13:07:10 -05:00
|
|
|
static f_Reset oReset9;
|
2020-12-09 12:39:01 -05:00
|
|
|
static bool mouse_visibility;
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-01-13 13:25:28 -05:00
|
|
|
static void CALLBACK Present(void *ptr);
|
|
|
|
static HRESULT CALLBACK PresentDx9Handler(IDirect3DDevice9 *pDevice, RECT* pSourceRect, RECT* pDestRect, HWND hDestWindowOverride, RGNDATA* pDirtyRegion);
|
|
|
|
static HRESULT CALLBACK PresentDx11Handler(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
2021-01-11 13:07:10 -05:00
|
|
|
static HRESULT CALLBACK Reset(IDirect3DDevice9 * pDevice, D3DPRESENT_PARAMETERS * pPresentationParameters);
|
2020-12-02 16:19:16 -05:00
|
|
|
static LRESULT CALLBACK InputProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2021-01-11 13:07:10 -05:00
|
|
|
static void ShowMouse(bool state);
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
protected:
|
2020-12-09 12:39:01 -05:00
|
|
|
static bool show_mouse;
|
2020-12-02 16:19:16 -05:00
|
|
|
static std::function<void()> window_func;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Hook();
|
|
|
|
~Hook();
|
|
|
|
};
|
|
|
|
|
|
|
|
|