Skip to content

Commit 5ffd33f

Browse files
committed
if the capture framerate is under 0, capture the window every frame.
1 parent 4e3d9e8 commit 5ffd33f

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Assets/uWindowCapture/Scripts/UwcWindowTexture.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,18 @@ void UpdateTitle()
304304

305305
void UpdateCaptureTimer()
306306
{
307-
captureTimer_ += Time.deltaTime;
307+
if (captureFrameRate < 0) {
308+
captureTimer_ = 0f;
309+
isCaptureRequested_ = true;
310+
} else {
311+
captureTimer_ += Time.deltaTime;
308312

309-
float T = 1f / captureFrameRate;
310-
if (captureTimer_ < T) return;
313+
float T = 1f / captureFrameRate;
314+
if (captureTimer_ < T) return;
311315

312-
while (captureTimer_ > T) {
313-
captureTimer_ -= T;
316+
while (captureTimer_ > T) {
317+
captureTimer_ -= T;
318+
}
314319
}
315320

316321
isCaptureRequested_ = true;

0 commit comments

Comments
 (0)