replace code to copy texture with old one #11

This commit is contained in:
hecomi
2017-01-06 17:32:10 +09:00
parent 0634993bb0
commit 9ee2d35175
5 changed files with 3 additions and 15 deletions
@@ -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());
}
}