check frame id.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -71,8 +71,11 @@ void Monitor::Finalize()
|
|||||||
void Monitor::Render()
|
void Monitor::Render()
|
||||||
{
|
{
|
||||||
const auto& frame = duplicator_->GetLastFrame();
|
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;
|
if (!texture) return;
|
||||||
|
|
||||||
// Get texture
|
// Get texture
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ private:
|
|||||||
MONITORINFOEX monitorInfo_;
|
MONITORINFOEX monitorInfo_;
|
||||||
|
|
||||||
std::shared_ptr<class Duplicator> duplicator_;
|
std::shared_ptr<class Duplicator> duplicator_;
|
||||||
|
UINT lastFrameId_ = -1;
|
||||||
|
|
||||||
ID3D11Texture2D* unityTexture_ = nullptr;
|
ID3D11Texture2D* unityTexture_ = nullptr;
|
||||||
Microsoft::WRL::ComPtr<ID3D11Texture2D> textureForGetPixels_;
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> textureForGetPixels_;
|
||||||
|
|||||||
Reference in New Issue
Block a user