July 2017
Beginner to intermediate
390 pages
10h 53m
English
The last line in the method sets the event handler for the ObservedSurfacesChanged event. We could have done this otherwise: instead of being called every time the surfaces change, and that happens quite a lot, we could just call a GetObservedSurfaces method as a regular interval. If you do not need high-fidelity tracking but need high performance, you could call that method every 10 frames or so. That will save you a lot of performance. Again, this is all dependent on your use case. I want it to be called every time the system changes the surfaces it sees.
Let us have a look at that method:
async void SpatialSurfaceObserverOnObservedSurfacesChanged(SpatialSurfaceObserver sender, object args) { var observedSurfaces ...Read now
Unlock full access