replace code to copy texture with old one #11
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -211,17 +211,6 @@ const Duplicator::Frame& Duplicator::GetLastFrame() const
|
||||
}
|
||||
|
||||
|
||||
void Duplicator::CopyLastTexture(
|
||||
const Microsoft::WRL::ComPtr<ID3D11Device>& device,
|
||||
const Microsoft::WRL::ComPtr<ID3D11Texture2D>& texture)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
ComPtr<ID3D11DeviceContext> context;
|
||||
device->GetImmediateContext(&context);
|
||||
context->CopyResource(texture.Get(), lastFrame_.texture.Get());
|
||||
}
|
||||
|
||||
|
||||
bool Duplicator::Duplicate()
|
||||
{
|
||||
if (!dupl_ || !device_) return false;
|
||||
|
||||
@@ -61,9 +61,6 @@ public:
|
||||
Microsoft::WRL::ComPtr<ID3D11Device> GetDevice();
|
||||
Microsoft::WRL::ComPtr<IDXGIOutputDuplication> GetDuplication();
|
||||
const Frame& GetLastFrame() const;
|
||||
void CopyLastTexture(
|
||||
const Microsoft::WRL::ComPtr<ID3D11Device>& device,
|
||||
const Microsoft::WRL::ComPtr<ID3D11Texture2D>& texture);
|
||||
|
||||
private:
|
||||
void InitializeDevice();
|
||||
|
||||
@@ -96,7 +96,9 @@ void Monitor::Render()
|
||||
}
|
||||
else
|
||||
{
|
||||
duplicator_->CopyLastTexture(GetDevice(), unityTexture_);
|
||||
ComPtr<ID3D11DeviceContext> context;
|
||||
GetDevice()->GetImmediateContext(&context);
|
||||
context->CopyResource(unityTexture_, texture.Get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user