Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Update WindowsApiChecker and usage #92

Merged
merged 6 commits into from
Sep 22, 2020
Merged

Conversation

FejZa
Copy link
Contributor

@FejZa FejZa commented Jun 21, 2020

XRTK - Mixed Reality Toolkit Pull Request

Overview

Updated the WindowsApiChecker and removed obsolete APIs.
Introduced WindowsApiChecker.IsMethodAvailable, WindowsApiChecker.IsPropertyAvailable and WindowsApiChecker.IsTypeAvailable.

As hands stopped working for HoloLens 2 I identified the WindowsApiChecker as the root of the problem and updated accordingly.

Changes

Introduced WindowsApiChecker.IsMethodAvailable, WindowsApiChecker.IsPropertyAvailable and WindowsApiChecker.IsTypeAvailable.

Removed obsolete contract checker prorperties and updated api checker to latest MRTK status and usage.

Breaking Changes

  • Removed WindowsApiChecker.UniversalApiContractVX_IsAvailable

@FejZa FejZa self-assigned this Jun 21, 2020
@StephenHodgson
Copy link
Contributor

Why did it stop working tho?

@FejZa
Copy link
Contributor Author

FejZa commented Jun 22, 2020

Not sure. I can only guess that Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent(..) changed. I checked the MRTK implementation and noticed they are not using those APIs anymore and marked them obsolete. So I updated and things started working again.

@StephenHodgson
Copy link
Contributor

I mean it's part of the windows API. That's not going anywhere.

Did you recently update your os?
Did you update your installed windows API?
Did you change the unity build api target?

@@ -440,10 +440,24 @@ private WindowsMixedRealityMotionController GetController(InteractionSource inte
private static async void TryRenderControllerModel(InteractionSource interactionSource, WindowsMixedRealityMotionController controller)
{
#if WINDOWS_UWP
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { return; }
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already check if the hmd is opaque using the camera rig. Let's remove the unity dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does that check in the camera rig affect rendering controller models? Also this is not a change of this PR. I only moved the { return } to the next line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I suggest changing this test to use the Camera.isOpaque rather than the Unity dependency.
If the option isn't visible, then fix that.

@FejZa FejZa merged commit 03b2c44 into development Sep 22, 2020
@FejZa FejZa deleted the dev/windows-api-checker branch September 22, 2020 16:16
@StephenHodgson
Copy link
Contributor

I'd like to possibly do another pass at this and remove all the strings and use nameof() or typeof() calls to make this a bit simpler.

XRTK-Build-Bot pushed a commit that referenced this pull request Dec 25, 2020
* Remove obsolete APIs from WindowsApiChecker

Introduced `IsTypeAvailable`, `IsMethodAvailable` and `IsPropertyAvailable`

* Update InteractionSourceExtensions.cs

* Update WindowsMixedRealityControllerDataProvider.cs

* Remove DOTNETWINRT_PRESENT usage

Co-authored-by: Stephen Hodgson <hodgson.designs@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants