Moved hooks calls and added hook retry

With that change, I no longer re-hook rendering functions as Hook_Manager::FoundRenderer removes all hooks and then we hook the true functions in the renderer specialization.
Added a retry count.
This commit is contained in:
Nemirtingas 2019-08-18 17:12:57 +02:00
parent 5b0306dccc
commit ca0ef4380a
8 changed files with 83 additions and 106 deletions

View file

@ -31,6 +31,7 @@ protected:
// If you do that, you should consider moving the renderer hooks to its own class and keep this one generic ?
std::vector<Base_Hook*> _hooks;
unsigned int _hook_retries;
bool _renderer_found; // Is the renderer hooked ?
bool _ogl_hooked; // wglMakeCurrent is hooked ? (opengl)
Base_Hook* rendererdetect_hook;
@ -39,10 +40,10 @@ protected:
Hook_Manager();
virtual ~Hook_Manager();
void UnHookAllRendererDetector();
// Setup opengl device
void hook_opengl();
bool stop_retry();
void HookLoadLibrary();
#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64)