You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
I needed to detect if a specific region has changed. So I've built a loop waiting for any changes in a specific region, but it used too much CPU. I've found out my program was running very fast, around 180 fps.
If there was a method to wait for any potention change in the region, it would help to reduce CPU usage drastically. I think it's possible to do that cheaply using IDXGIOutputDuplication::GetFrameDirtyRects(). (Or simply waiting for AcquireNextFrame to return would also work, although it would not benefit from specifying a small region.)
API proposal Signature:D3DShot.wait_for_change(self, timeout=None) Returns:True if a potantial change was detected, False if timeout was reached Precondition: A high-speed screen capture was started. (i.e. capture() was called) Description: Blocks until a potential change in the region is detected. Blocks at most timeout seconds. (None means forever.) Note: The system may collapse several dirty rects into one giant rect, so spurious awakenings might happen. It means that if you need to be certain that the region has changed at all, you need to check it yourself.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I needed to detect if a specific region has changed. So I've built a loop waiting for any changes in a specific region, but it used too much CPU. I've found out my program was running very fast, around 180 fps.
If there was a method to wait for any potention change in the region, it would help to reduce CPU usage drastically. I think it's possible to do that cheaply using
IDXGIOutputDuplication::GetFrameDirtyRects()
. (Or simply waiting forAcquireNextFrame
to return would also work, although it would not benefit from specifying a small region.)API proposal
Signature:
D3DShot.wait_for_change(self, timeout=None)
Returns:
True
if a potantial change was detected,False
if timeout was reachedPrecondition: A high-speed screen capture was started. (i.e.
capture()
was called)Description: Blocks until a potential change in the region is detected. Blocks at most
timeout
seconds. (None
means forever.)Note: The system may collapse several dirty rects into one giant rect, so spurious awakenings might happen. It means that if you need to be certain that the region has changed at all, you need to check it yourself.
The text was updated successfully, but these errors were encountered: