From a9df1e4ef232ce6a4411f1a501390511e206f4f3 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 16 Jun 2014 00:00:00 +0100 Subject: [PATCH] Don't try and hook OpenGL functions if the dll isn't even loaded on win32 --- renderdoc/hooks/gl_win32_hooks.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/hooks/gl_win32_hooks.cpp b/renderdoc/hooks/gl_win32_hooks.cpp index c0a6c5554..1b50d611f 100644 --- a/renderdoc/hooks/gl_win32_hooks.cpp +++ b/renderdoc/hooks/gl_win32_hooks.cpp @@ -189,6 +189,12 @@ class OpenGLHook : LibraryHook if(!m_EnabledHooks) return false; + + if(GetModuleHandleA(DLL_NAME) == NULL) + { + RDCWARN("Failed to load %s - not inserting OpenGL hooks.", DLL_NAME); + return false; + } bool success = SetupHooks(GL);