// Copyright HTC Corporation All Rights Reserved. using System; using System.Runtime.InteropServices; namespace VIVE.OpenXR { /// /// When developers would like to retrieve the supported user paths from the interactionProfile, userPath should be XR_NULL_PATH. If the interaction profile for any of the suggested bindings does not exist in the allowlist defined in Interaction Profile Paths, the runtime must return XR_ERROR_PATH_UNSUPPORTED. /// /// If developers would like to retrieve the input/output paths related to the interactionProfile, userPath should be a valid user path.If userPath is not one of the device input subpaths described in section /user paths, the runtime must return XR_ERROR_PATH_UNSUPPORTED. /// [StructLayout(LayoutKind.Sequential)] public struct XrPathsForInteractionProfileEnumerateInfoHTC { /// /// The XrStructureType of this structure. /// public XrStructureType type; /// /// NULL or a pointer to the next structure in a structure chain. /// public IntPtr next; /// /// The XrPath of an interaction profile. /// public XrPath interactionProfile; /// /// The top level user path the application would like to retrieve the interaction profile for. Set XR_NULL_PATH is used to enumerate all user paths from the input interactionProfile. Set as a valid user path is used to enumerate all input/output source paths. /// public XrPath userPath; } public static class VivePathEnumerationHelper { /// /// Provided by XR_HTC_path_enumerate. /// Developers should call this API with the value of pathCapacityInput equals to 0 to retrieve the size of paths from pathCountOutput. Then developers allocate the array of XrPath data and assign the pathCapacityInput and call the API in the second time. /// /// If the input pathCapacityInput is not sufficient to contain all output indices, the runtime must return XR_ERROR_SIZE_INSUFFICIENT on calls to xrEnumeratePathsForInteractionProfileHTC and not change the content in paths. /// /// An XrInstance previously created. /// A XrPathsForInteractionProfileEnumerateInfoHTC providing the query information. /// The capacity of the paths array, or 0 to indicate a request to retrieve the required capacity. /// A pointer to the count of paths written, or a pointer to the required capacity in the case that pathCapacityInput is insufficient. /// A pointer to an array of XrPath, but can be NULL if pathCapacityInput is 0. /// XR_SUCCESS for success. public delegate XrResult xrEnumeratePathsForInteractionProfileHTCDelegate( XrInstance instance, ref XrPathsForInteractionProfileEnumerateInfoHTC enumerateInfo, UInt32 pathCapacityInput, ref UInt32 pathCountOutput, [In, Out] XrPath[] paths); } }