Magpie/Runtime/DwmSharedSurfaceFrameSource.h
2022-04-19 21:50:33 +08:00

42 lines
762 B
C++

#pragma once
#include "pch.h"
#include "FrameSourceBase.h"
class DwmSharedSurfaceFrameSource : public FrameSourceBase {
public:
DwmSharedSurfaceFrameSource() {}
virtual ~DwmSharedSurfaceFrameSource() {}
bool Initialize() override;
UpdateState Update() override;
bool IsScreenCapture() override {
return false;
}
const char* GetName() const noexcept override {
return "DwmSharedSurface";
}
protected:
bool _HasRoundCornerInWin11() override {
return false;
}
private:
using _DwmGetDxSharedSurfaceFunc = bool(
HWND hWnd,
HANDLE* phSurface,
LUID* pAdapterLuid,
ULONG* pFmtWindow,
ULONG* pPresentFlags,
ULONGLONG* pWin32KUpdateId
);
_DwmGetDxSharedSurfaceFunc *_dwmGetDxSharedSurface = nullptr;
D3D11_BOX _frameInWnd{};
};