void GraphicsCaptureSource::BeginScene() { if(bCapturing) return; strWindowClass = data->GetString(TEXT("windowClass")); if(strWindowClass.IsEmpty()) return; bStretch = data->GetInt(TEXT("stretchImage")) != 0; bIgnoreAspect = data->GetInt(TEXT("ignoreAspect")) != 0; bCaptureMouse = data->GetInt(TEXT("captureMouse"), 1) != 0; bUseHotkey = data->GetInt(TEXT("useHotkey"), 0) != 0; hotkey = data->GetInt(TEXT("hotkey"), VK_F12); if (bUseHotkey) hotkeyID = OBSCreateHotkey(hotkey, (OBSHOTKEYPROC)GraphicsCaptureSource::CaptureHotkey, (UPARAM)this); gamma = data->GetInt(TEXT("gamma"), 100); if(bCaptureMouse && data->GetInt(TEXT("invertMouse"))) invertShader = CreatePixelShaderFromFile(TEXT("shaders\\InvertTexture.pShader")); drawShader = CreatePixelShaderFromFile(TEXT("shaders\\DrawTexture_ColorAdjust.pShader")); AttemptCapture(); }
void SceneSwitcherSettings::ApplyConfig(HWND hWnd) { thePlugin->ApplyConfig(hWnd); // Redefine the hotkey if (hotkeyID) OBSDeleteHotkey(hotkeyID); if (thePlugin->GetToggleHotkey() != 0) hotkeyID = OBSCreateHotkey((DWORD)thePlugin->GetToggleHotkey(), ToggleHotkeyProc, 0); }
bool LoadPlugin() { InitHotkeyExControl(hinstMain); thePlugin = new SceneSwitcher(hinstMain, HotkeyToggle); if (thePlugin == 0) return false; if (thePlugin->GetToggleHotkey() != 0) thePlugin->GetSettings()->hotkeyID = OBSCreateHotkey(thePlugin->GetToggleHotkey(), HotkeyToggle, 0); return true; }
void GraphicsCaptureSource::BeginScene() { if(bCapturing) return; strWindowClass = data->GetString(TEXT("windowClass")); strExecutable = data->GetString(TEXT("executable")); if (strWindowClass.IsEmpty() && strExecutable.IsEmpty()) { Log(TEXT("GraphicsCaptureSource::BeginScene: No class or executable specified, what's happening?!")); return; } bUseDWMCapture = (scmpi(strWindowClass, TEXT("Dwm")) == 0); bStretch = data->GetInt(TEXT("stretchImage")) != 0; bAlphaBlend = data->GetInt(TEXT("alphaBlend")) != 0; bIgnoreAspect = data->GetInt(TEXT("ignoreAspect")) != 0; bCaptureMouse = data->GetInt(TEXT("captureMouse"), 1) != 0; bool safeHookVal = data->GetInt(TEXT("safeHook")) != 0; if (safeHookVal != useSafeHook && safeHookVal) Log(L"Using anti-cheat hooking for game capture"); useSafeHook = safeHookVal; bUseHotkey = data->GetInt(TEXT("useHotkey"), 0) != 0; hotkey = data->GetInt(TEXT("hotkey"), VK_F12); if(bUseHotkey) { hotkeyID = OBSCreateHotkey(hotkey, (OBSHOTKEYPROC)GraphicsCaptureSource::CaptureHotkey, (UPARAM)this); bUseDWMCapture = false; } gamma = data->GetInt(TEXT("gamma"), 100); if(bCaptureMouse && data->GetInt(TEXT("invertMouse"))) invertShader = CreatePixelShaderFromFile(TEXT("shaders\\InvertTexture.pShader")); drawShader = CreatePixelShaderFromFile(TEXT("shaders\\DrawTexture_ColorAdjust.pShader")); if (!bUseHotkey) AttemptCapture(); }