Reworked how renderers are hooked.

Some games doesn't initialise Steam before initalizing their Renderer (even if the doc says to) . So instead of waiting for the game to initialize it, hook to the rendering functions and deduce which implementation should be used.
This commit is contained in:
Nemirtingas 2019-08-16 10:36:44 +02:00
parent 4d3c355fcc
commit 40615d07a7
12 changed files with 497 additions and 190 deletions

View file

@ -37,11 +37,11 @@ private:
static HRESULT STDMETHODCALLTYPE MyPresentEx(IDirect3DDevice9Ex* _this, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags);
// Hook functions so we know we use DX9
static decltype(Direct3DCreate9) MyDirect3DCreate9;
static decltype(Direct3DCreate9Ex) MyDirect3DCreate9Ex;
//static decltype(Direct3DCreate9) MyDirect3DCreate9;
//static decltype(Direct3DCreate9Ex) MyDirect3DCreate9Ex;
decltype(Direct3DCreate9)* Direct3DCreate9;
decltype(Direct3DCreate9Ex)* Direct3DCreate9Ex;
//decltype(Direct3DCreate9)* Direct3DCreate9;
//decltype(Direct3DCreate9Ex)* Direct3DCreate9Ex;
public:
static void Create(); // Initialize DX9 Hook.