inline bool AttemptToHookSomething() { bool bFoundSomethingToHook = false; if(!bD3D9Hooked && InitD3D9Capture()) { logOutput << "D3D9 Present" << endl; bFoundSomethingToHook = true; bD3D9Hooked = true; } if(!bDXGIHooked && InitDXGICapture()) { logOutput << "DXGI Present" << endl; bFoundSomethingToHook = true; bDXGIHooked = true; } if(!bGLHooked && InitGLCapture()) { logOutput << "GL Present" << endl; bFoundSomethingToHook = true; bGLHooked = true; } /* if(!bDirectDrawHooked && InitDDrawCapture()) { OutputDebugString(TEXT("DirectDraw Present\r\n")); bFoundSomethingToHook = true; bDirectDrawfHooked = true; }*/ return bFoundSomethingToHook; }
inline bool AttemptToHookSomething() { if (!hwndSender || !hwndD3DDummyWindow || !hwndOpenGLSetupWindow) return false; bool bFoundSomethingToHook = false; if(!bD3D9Hooked) { if (InitD3D9Capture()) { logOutput << CurrentTimeString() << "D3D9 Present" << endl; bFoundSomethingToHook = true; bD3D9Hooked = true; } } else { //occasionally, certain applications can reset the d3d9 hook, or clear it, or something. //so, we forcibly make sure that the d3d9 function is still hooked. CheckD3D9Capture(); } if(!bDXGIHooked && InitDXGICapture()) { logOutput << CurrentTimeString() << "DXGI Present" << endl; bFoundSomethingToHook = true; bDXGIHooked = true; } if(!bGLHooked && InitGLCapture()) { logOutput << CurrentTimeString() << "GL Present" << endl; bFoundSomethingToHook = true; bGLHooked = true; } else { CheckGLCapture(); } /* if(!bDirectDrawHooked && InitDDrawCapture()) { OutputDebugString(TEXT("DirectDraw Present\r\n")); bFoundSomethingToHook = true; bDirectDrawfHooked = true; }*/ return bFoundSomethingToHook; }