예제 #1
0
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();
}
예제 #2
0
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);
}
예제 #3
0
파일: scenesw.cpp 프로젝트: 373137461/OBS
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;
}
예제 #4
0
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();
}