Add display capture support via winrt_capture_init_monitor. Almost all
of the existing window capture code is reused.
Rename winrt_capture_init to winrt_capture_init_window for symmetry.
Functionality is coming in a future Windows update to disable the yellow
border when using WGC. Add code now to opt in. Will require SDK upgrade
later for OBS build.
winrt::apartment_type::multi_threaded is necessary to dodge assert for
calling get() on RequestAccessAsync result. Don't think I will ever
fully understand COM apartments.
We were performing a custom cursor draw for WGC, which we attempted
because we thought we could bring back hardware cursor responsiveness,
but MS says that it won't. Since the custom draw was bugged to cause
black screens anyway, just use the native cursor draw for now.
Illegal CopySubresourceRegion parameters were sometimes computed when
minimizing and restoring WGC window captures, leading to device loss.
Add robust safeties to ensure that doesn't happen.
Starting with Windows 10 2004, we can disable WGC cursor capture, and
provide a user toggle. We swap out WGC support for our own though
because ours does not break hardware cursor support.