hyblocker / OpenVR-SpaceCalibrator

Use tracked VR devices from one company with any other.
Other
175 stars 9 forks source link

Limit the frame rate when minimized #1

Closed hyblocker closed 11 months ago

hyblocker commented 11 months ago

Fixes: https://github.com/bdunderscore/OpenVR-SpaceCalibrator/issues/8

When the application is minimized rendering is skipped and doesn't limit the RunLoop frequency. This causes unnecessarily high CPU usage.

This PR fixes the issue by sleeping the thread as needed to limit it to 60 FPS similar to when it isn't minimized. This should be fast enough to not impact continuous calibration as CalibrationTick only actually runs every 50ms.