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

@ -10,7 +10,7 @@ public:
static constexpr const char *DLL_NAME = "opengl32.dll";
using wglSwapBuffers_t = BOOL(WINAPI*)(HDC);
using wglMakeCurrent_t = BOOL(WINAPI*)(HDC, HGLRC);
//using wglMakeCurrent_t = BOOL(WINAPI*)(HDC, HGLRC);
private:
// Variables
@ -30,9 +30,9 @@ private:
wglSwapBuffers_t wglSwapBuffers;
// Hook functions so we know we use OGL
static BOOL WINAPI MywglMakeCurrent(HDC hDC, HGLRC hGLRC);
//static BOOL WINAPI MywglMakeCurrent(HDC hDC, HGLRC hGLRC);
wglMakeCurrent_t wglMakeCurrent;
//wglMakeCurrent_t wglMakeCurrent;
public:
static void Create(); // Initialize OGL Hook.