tweak code.

This commit is contained in:
hecomi
2018-05-20 02:08:18 +09:00
parent b5fd483d6a
commit 682553a5a2
2 changed files with 29 additions and 26 deletions
@@ -84,7 +84,7 @@ private:
Microsoft::WRL::ComPtr<IDXGIOutputDuplication> dupl_;
Frame lastFrame_;
UINT lastFrameId_ = 0;
bool isFrameAquired_ = false;
bool isFrameAcquired_ = false;
volatile bool shouldRun_ = false;
std::thread thread_;
@@ -81,8 +81,12 @@ void Monitor::Render()
if (frame.id == lastFrameId_) return;
lastFrameId_ = frame.id;
if (unityTexture_)
if (unityTexture_ == nullptr)
{
Debug::Error("Monitor::Render() => Target texture has not been set yet..");
return;
}
D3D11_TEXTURE2D_DESC srcDesc, dstDesc;
frame.texture->GetDesc(&srcDesc);
unityTexture_->GetDesc(&dstDesc);
@@ -106,7 +110,6 @@ void Monitor::Render()
manager->GetCursor()->Draw(unityTexture_);
}
}
}
if (UseGetPixels())
{