check frame id.

This commit is contained in:
hecomi
2017-01-07 13:48:38 +09:00
parent c0e1967e2e
commit c41fe42aa3
4 changed files with 5 additions and 1 deletions
@@ -71,8 +71,11 @@ void Monitor::Finalize()
void Monitor::Render()
{
const auto& frame = duplicator_->GetLastFrame();
const auto& texture = frame.texture;
if (frame.id == lastFrameId_) return;
lastFrameId_ = frame.id;
const auto& texture = frame.texture;
if (!texture) return;
// Get texture
@@ -70,6 +70,7 @@ private:
MONITORINFOEX monitorInfo_;
std::shared_ptr<class Duplicator> duplicator_;
UINT lastFrameId_ = -1;
ID3D11Texture2D* unityTexture_ = nullptr;
Microsoft::WRL::ComPtr<ID3D11Texture2D> textureForGetPixels_;