Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.9 KiB

  1. // SteamVR System|SDK_SteamVR|002
  2. namespace VRTK
  3. {
  4. #if VRTK_DEFINE_SDK_STEAMVR
  5. using Valve.VR;
  6. #endif
  7. /// <summary>
  8. /// The SteamVR System SDK script provides a bridge to the SteamVR SDK.
  9. /// </summary>
  10. [SDK_Description("SteamVR (Standalone:OpenVR)", SDK_SteamVRDefines.ScriptingDefineSymbol, "OpenVR", "Standalone")]
  11. public class SDK_SteamVRSystem
  12. #if VRTK_DEFINE_SDK_STEAMVR
  13. : SDK_BaseSystem
  14. #else
  15. : SDK_FallbackSystem
  16. #endif
  17. {
  18. #if VRTK_DEFINE_SDK_STEAMVR
  19. /// <summary>
  20. /// The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  21. /// </summary>
  22. /// <returns>Returns true if the display is extending the desktop</returns>
  23. public override bool IsDisplayOnDesktop()
  24. {
  25. return (OpenVR.System == null || OpenVR.System.IsDisplayOnDesktop());
  26. }
  27. /// <summary>
  28. /// The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  29. /// </summary>
  30. /// <returns>Returns true if the Unity app should render with low resources.</returns>
  31. public override bool ShouldAppRenderWithLowResources()
  32. {
  33. return (OpenVR.Compositor != null && OpenVR.Compositor.ShouldAppRenderWithLowResources());
  34. }
  35. /// <summary>
  36. /// The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  37. /// </summary>
  38. /// <param name="force">If true then Interleaved Reprojection will be forced on, if false it will not be forced on.</param>
  39. public override void ForceInterleavedReprojectionOn(bool force)
  40. {
  41. if (OpenVR.Compositor != null)
  42. {
  43. OpenVR.Compositor.ForceInterleavedReprojectionOn(force);
  44. }
  45. }
  46. #endif
  47. }
  48. }