diff --git a/bin/linux32/libopenvr_api.so b/bin/linux32/libopenvr_api.so index 837b5331..fd2a93b0 100755 Binary files a/bin/linux32/libopenvr_api.so and b/bin/linux32/libopenvr_api.so differ diff --git a/bin/linux32/libopenvr_api.so.dbg b/bin/linux32/libopenvr_api.so.dbg index 22db3eda..3073acf9 100755 Binary files a/bin/linux32/libopenvr_api.so.dbg and b/bin/linux32/libopenvr_api.so.dbg differ diff --git a/bin/linux64/libopenvr_api.so b/bin/linux64/libopenvr_api.so index 9deedeed..18159159 100755 Binary files a/bin/linux64/libopenvr_api.so and b/bin/linux64/libopenvr_api.so differ diff --git a/bin/linux64/libopenvr_api.so.dbg b/bin/linux64/libopenvr_api.so.dbg index cb011835..bad58b92 100755 Binary files a/bin/linux64/libopenvr_api.so.dbg and b/bin/linux64/libopenvr_api.so.dbg differ diff --git a/bin/linuxarm64/libopenvr_api.so b/bin/linuxarm64/libopenvr_api.so index 50752c7d..1712fddc 100644 Binary files a/bin/linuxarm64/libopenvr_api.so and b/bin/linuxarm64/libopenvr_api.so differ diff --git a/bin/linuxarm64/libopenvr_api.so.dbg b/bin/linuxarm64/libopenvr_api.so.dbg index 8b5dc1fa..7d6aa6df 100644 Binary files a/bin/linuxarm64/libopenvr_api.so.dbg and b/bin/linuxarm64/libopenvr_api.so.dbg differ diff --git a/bin/linuxarm64/libopenvr_api_unity.so b/bin/linuxarm64/libopenvr_api_unity.so index de61d669..e51d7bfb 100644 Binary files a/bin/linuxarm64/libopenvr_api_unity.so and b/bin/linuxarm64/libopenvr_api_unity.so differ diff --git a/bin/linuxarm64/libopenvr_api_unity.so.dbg b/bin/linuxarm64/libopenvr_api_unity.so.dbg index b6fa1b80..f971ade9 100644 Binary files a/bin/linuxarm64/libopenvr_api_unity.so.dbg and b/bin/linuxarm64/libopenvr_api_unity.so.dbg differ diff --git a/bin/win32/openvr_api.dll b/bin/win32/openvr_api.dll index 4c05f2cf..cfc8f4ca 100644 Binary files a/bin/win32/openvr_api.dll and b/bin/win32/openvr_api.dll differ diff --git a/bin/win32/openvr_api.dll.sig b/bin/win32/openvr_api.dll.sig index 9afcd7f2..1e466aa8 100644 Binary files a/bin/win32/openvr_api.dll.sig and b/bin/win32/openvr_api.dll.sig differ diff --git a/bin/win32/openvr_api.pdb b/bin/win32/openvr_api.pdb index 3bdce6c1..0b35b033 100644 Binary files a/bin/win32/openvr_api.pdb and b/bin/win32/openvr_api.pdb differ diff --git a/bin/win64/openvr_api.dll b/bin/win64/openvr_api.dll index 5289e8d7..2acefbf1 100644 Binary files a/bin/win64/openvr_api.dll and b/bin/win64/openvr_api.dll differ diff --git a/bin/win64/openvr_api.dll.sig b/bin/win64/openvr_api.dll.sig index e9f097ff..19883aca 100644 Binary files a/bin/win64/openvr_api.dll.sig and b/bin/win64/openvr_api.dll.sig differ diff --git a/bin/win64/openvr_api.pdb b/bin/win64/openvr_api.pdb index 86569357..aaada659 100644 Binary files a/bin/win64/openvr_api.pdb and b/bin/win64/openvr_api.pdb differ diff --git a/codegen/api_shared.py b/codegen/api_shared.py index 2098054f..ed567e6c 100755 --- a/codegen/api_shared.py +++ b/codegen/api_shared.py @@ -522,8 +522,12 @@ def outputinterfaces(namespace, data): paramlist.append('ref ' + paramtype + ' ' + param['paramname']) else: paramlist.append(paramtype + ' ' + param['paramname']) + if(paramtype == 'bool'): + paramlist[-1] = '[MarshalAs(UnmanagedType.I1)] ' + paramlist[-1]; print("\t\t[UnmanagedFunctionPointer(CallingConvention.StdCall)]") + if(returntype == 'bool'): + print("\t\t[return: MarshalAs(UnmanagedType.I1)]") print("\t\tinternal delegate "+returntype+" _"+methodname+"("+", ".join(paramlist)+");") print("\t\t[MarshalAs(UnmanagedType.FunctionPtr)]") print("\t\tinternal _"+methodname+" "+methodname+";\n") diff --git a/codegen/openvr_capi.h.py b/codegen/openvr_capi.h.py index 518c1ca6..eafd0987 100755 --- a/codegen/openvr_capi.h.py +++ b/codegen/openvr_capi.h.py @@ -241,6 +241,12 @@ def OutputStructFields(struct): VREvent_InputBindingLoad_t inputBinding; VREvent_InputActionManifestLoad_t actionManifest; VREvent_SpatialAnchor_t spatialAnchor; + VREvent_ProgressUpdate_t progressUpdate; + VREvent_ShowUI_t showUi; + VREvent_ShowDevTools_t showDevTools; + VREvent_HDCPError_t hdcpError; + VREvent_AudioVolumeControl_t audioVolumeControl; + VREvent_AudioMuteControl_t audioMuteControl; } VREvent_Data_t; #if defined(__linux__) || defined(__APPLE__) diff --git a/codegen/openvr_interop.cs.py b/codegen/openvr_interop.cs.py index e7903976..4783a874 100755 --- a/codegen/openvr_interop.cs.py +++ b/codegen/openvr_interop.cs.py @@ -101,6 +101,8 @@ [FieldOffset(0)] public VREvent_ShowUI_t showUi; [FieldOffset(0)] public VREvent_ShowDevTools_t showDevTools; [FieldOffset(0)] public VREvent_HDCPError_t hdcpError; + [FieldOffset(0)] public VREvent_AudioVolumeControl_t audioVolumeControl; + [FieldOffset(0)] public VREvent_AudioMuteControl_t audioMuteControl; [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug } """) diff --git a/docs/Driver_API_Documentation.md b/docs/Driver_API_Documentation.md index 0c5b7af0..68ed1565 100644 --- a/docs/Driver_API_Documentation.md +++ b/docs/Driver_API_Documentation.md @@ -78,6 +78,7 @@ - [Binding Duplication](#binding-duplication) - [Emulateable Devices](#emulateable-devices) - [Render Models](#render-models) + - [Chaperone](#chaperone) - [Building & Development Environment](#building--development-environment) - [Debugging SteamVR with Visual Studio](#debugging-steamvr-with-visual-studio) - [Further Examples](#further-examples) @@ -1171,6 +1172,26 @@ right and covers a single eye. * `float fU` - The current U coordinate. * `float fV` - The current V coordinate. +```c++ +virtual bool ComputeInverseDistortion( HmdVector2_t *pResult, EVREye eEye, uint32_t unChannel, float fU, float fV ) = 0; +``` +`ComputeInverseDistortion` is called by the runtime to get the result of the inverse distortion function for the specified eye, +channel and uv. + +Drivers **may** return false from this method to indicate that the runtime should infer an estimate from +the result returned by `IVRDisplayComponent::ComputeDistortion`. + +Returning true from method indicates to the runtime that it should not try to estimate the inverse, and instead use the +values provided by the driver. + +* `HmdVector2_t *pResult` - Driver should write into this with the result for the specified UV. +* `EVREye eEye` - The eye to get the distortion for. The possible options are: + * `Eye_Left` - The left eye. + * `Eye_Right` - The right eye. +* `uint32_t unChannel` - Which channel is requested. 0 for red, 1 for blue, 2 for green. +* `float fU` - The current U coordinate. +* `float fV` - The current V coordinate. + #### IVRDriverDirectModeComponent `IVRDriverDirectModeComponent` is used for drivers that implement direct mode entirely on their own without allowing the @@ -3486,6 +3507,82 @@ will be set in the override property container. * `legacy_buttons` - `[ 0, 1, 2, 32, 33 ]` * `legacy_axis` - `[ 1, 3, 0, 0, 0 ]` +## Chaperone + +The SteamVR Chaperone system provides visible boundaries for users when inside VR, which should be +shown at the edges of the play space to avoid collisions with other objects. + +The chaperone system is also responsible for keeping track of the relation between the driver's raw +tracking space (the tracking space in which the driver provides poses to the runtime through +`IVRServerDriverHost::TrackedDevicePoseUpdate`) and the seated and standing universe origins that applications +query poses relative to. + +A description of each of the universes is below, along with their corresponding json property: + + * `TrackingUniverseSeated (seated)` - Useful for applications that need to render content relative to the user's resting head position, such as presenting a cockpit view in simulators. + * `TrackingUniverseStanding (standing)` - This is some point on the floor of the tracking space, where y = 0 **must** always be the floor in this tracking space. Useful for applications that want to render content that should scale to the user's real world setup, such as placing the floor at the same location. + * "Setup standing (setup_standing2)" - An origin from the raw tracking space. This is some point on the floor which is the center of the play space. The universe is not visible to applications, but the driver **may** choose to use it to break the dependency between where the standing origin should be, and where SteamVR should place the collision bounds relative to. It is optional for the driver to provide this, and if ommitted, it will default to being the same as the standing universe. + +Any driver that provides its own tracking solution **should** provide its own chaperone setup. + +A driver provides its chaperone setup as a json file. A driver **may** either provide an absolute path +to the chaperone json file it wishes to present to SteamVR, or provide a json string by setting +the `Prop_DriverProvidedChaperoneJson_String` property of the HMD container. + +A driver **may** provide multiple "universes", where (in this context), a universe represents a different +location in the real world that requires a separate chaperone setup, such as switching to a different room. + +SteamVR only allows one chaperone universe to be active at a time. A driver **must** specify the +universe that it wishes to use by setting the `Prop_CurrentUniverseId_Uint64` property to the universe id +it wises to use (more details below). + +The provided json **must** be valid, with no trailing commas, but **may** contain comments prefixed by `//`. + + * `json_id` - **required**. Set to `chaperone_info`. + * `version` - **required**. Current chaperone json version is `5`. + * `time` - **required**. The ISO timestamp when the chaperone file was last modified. + * `universes` - A json array containing json objects that contain: + * `collision_bounds` - An array that contains sets of polygons (An array that **should** + contain arrays that contains arrays of 4 elements (the polygons), + where each element is an array that contains the x,y,z positions of each vertex). + Collision bounds are relative to the **setup standing** play space. + Drivers **should** provide 4 vertices per face they are drawing. Drivers **should** + provide vertices that are all on the same vertical plane as eachother. + * `play_area` - An array that contains two values: `[width, height]` of the play space. + The width and height are driver-defined, but **should** represent largest rectangle that + can represent the playable area. + * `` - A json object that represents the relation between the driver's raw + tracking space and the specified universe origin. Drivers **must** provide seated and standing relations, + but **may** omit the setup standing universe. In this case, the setup standing universe will be + set to what was set for the standing property (see next paragraph). Each **must** contain the following properties: + * `translation` - The position offset between the raw origin and the universe's origin + * `yaw` - The rotation on the x,z plane between the raw space and universe's space + * `universeID` - The id of the universe. This **must** be a uint32 number and **must** be + unique for each different universe. + +The driver **must** either: +1. Set both the setup standing and standing origins. + * In this case, the setup standing origin is treated as the center of the play area. The standing origin is free to be placed elsewhere +2. Set only the standing origin. + * In this case, the standing origin is treated as the center of the play area. + +### Recentering + +The recentering feature in SteamVR allows the user to update the standing and seated universe positions +while inside SteamVR. This can be useful to reposition your height in a cockpit, or to reposition +room-scale content relative to a different real-world position. + +Initially, the transforms for the standing and seated universes are set by the driver provided chaperone file. +When a user requests a recenter, SteamVR updates the standing and seated transforms it holds in memory, +and will attempt to update the seated universe (and only seated universe) in the chaperone file if +the driver provided one, and that file is writeable. SteamVR **will not** attempt to modify the standing transform. + +If a driver wants to configure the way recentering is handled, +it **may** configure the `Prop_Driver_RecenterSupport_Int32` property with one of the following values: +* `k_EVRDriverRecenterSupport_SteamVRHandlesRecenter` - Default. SteamVR shows a recenter but and will do the above when a user requests a recenter. +* `k_EVRDriverRecenterSupport_NoRecenter` - Recentering is not supported and no recenter button will be shown in the UI. +* `k_EVRDriverRecenterSupport_DriverHandlesRecenter` - A recenter button is shown and an event **will** be triggered for the driver to handle the recenter, but SteamVR will do no additional processing. + ## Render Models A render model is a 3D model that represents a device in VR. A render model **should** provide a graphical diff --git a/headers/openvr.h b/headers/openvr.h index b7aace52..a37db148 100644 --- a/headers/openvr.h +++ b/headers/openvr.h @@ -16,8 +16,8 @@ namespace vr { static const uint32_t k_nSteamVRVersionMajor = 2; - static const uint32_t k_nSteamVRVersionMinor = 0; - static const uint32_t k_nSteamVRVersionBuild = 10; + static const uint32_t k_nSteamVRVersionMinor = 2; + static const uint32_t k_nSteamVRVersionBuild = 3; } // namespace vr // public_vrtypes.h @@ -531,6 +531,7 @@ enum ETrackedDeviceProperty Prop_Hmd_SupportsHDR10_Bool = 2093, Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, Prop_DriverProvidedChaperoneJson_String = 2095, // higher priority than Prop_DriverProvidedChaperonePath_String + Prop_ForceSystemLayerUseAppPoses_Bool = 2096, Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, @@ -547,6 +548,10 @@ enum ETrackedDeviceProperty Prop_DSCSliceCount_Int32 = 2111, Prop_DSCBPPx16_Int32 = 2112, + Prop_Hmd_MaxDistortedTextureWidth_Int32 = 2113, + Prop_Hmd_MaxDistortedTextureHeight_Int32 = 2114, + Prop_Hmd_AllowSupersampleFiltering_Bool = 2115, + // Driver requested mura correction properties Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, @@ -558,10 +563,16 @@ enum ETrackedDeviceProperty Prop_DriverRequestedMuraFeather_OuterTop_Int32 = 2207, Prop_DriverRequestedMuraFeather_OuterBottom_Int32 = 2208, - Prop_Audio_DefaultPlaybackDeviceId_String = 2300, - Prop_Audio_DefaultRecordingDeviceId_String = 2301, - Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, - Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + Prop_Audio_DefaultPlaybackDeviceId_String = 2300, + Prop_Audio_DefaultRecordingDeviceId_String = 2301, + Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, + Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + Prop_Audio_DriverManagesPlaybackVolumeControl_Bool = 2304, + Prop_Audio_DriverPlaybackVolume_Float = 2305, + Prop_Audio_DriverPlaybackMute_Bool = 2306, + Prop_Audio_DriverManagesRecordingVolumeControl_Bool = 2307, + Prop_Audio_DriverRecordingVolume_Float = 2308, + Prop_Audio_DriverRecordingMute_Bool = 2309, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -610,7 +621,8 @@ enum ETrackedDeviceProperty Prop_HasCameraComponent_Bool = 6004, Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, - Prop_HasSpatialAnchorsSupport_Bool = 6007, + Prop_HasSpatialAnchorsSupport_Bool = 6007, + Prop_SupportsXrTextureSets_Bool = 6008, // Properties that are set internally based on other information provided by drivers Prop_ControllerType_String = 7000, @@ -870,6 +882,9 @@ enum EVREventType VREvent_DashboardThumbChanged = 535, // Sent when a dashboard thumbnail image changes + VREvent_DesktopMightBeVisible = 536, // Sent when any known desktop related overlay is visible + VREvent_DesktopMightBeHidden = 537, // Sent when all known desktop related overlays are hidden + VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, VREvent_Notification_BeginInteraction = 602, @@ -990,6 +1005,11 @@ enum EVREventType VREvent_Monitor_ShowHeadsetView = 2000, // data is process VREvent_Monitor_HideHeadsetView = 2001, // data is process + VREvent_Audio_SetSpeakersVolume = 2100, + VREvent_Audio_SetSpeakersMute = 2101, + VREvent_Audio_SetMicrophoneVolume = 2102, + VREvent_Audio_SetMicrophoneMute = 2103, + // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, @@ -1302,6 +1322,16 @@ struct VREvent_HDCPError_t EHDCPError eCode; }; +struct VREvent_AudioVolumeControl_t +{ + float fVolumeLevel; +}; + +struct VREvent_AudioMuteControl_t +{ + bool bMute; +}; + typedef union { VREvent_Reserved_t reserved; @@ -1333,7 +1363,9 @@ typedef union VREvent_ShowUI_t showUi; VREvent_ShowDevTools_t showDevTools; VREvent_HDCPError_t hdcpError; - /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ + VREvent_AudioVolumeControl_t audioVolumeControl; + VREvent_AudioMuteControl_t audioMuteControl; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py and openvr_api_flat.h.py */ } VREvent_Data_t; @@ -1865,6 +1897,7 @@ enum EVRInitError VRInitError_Compositor_CannotConnectToDisplayServer = 497, VRInitError_Compositor_GnomeNoDRMLeasing = 498, VRInitError_Compositor_FailedToInitializeEncoder = 499, + VRInitError_Compositor_CreateBlurTexture = 500, VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, VRInitError_VendorSpecific_WindowsNotInDevMode = 1001, @@ -2882,6 +2915,11 @@ namespace vr static const char * const k_pch_SteamVR_UsePrism_Bool = "usePrism"; static const char * const k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = "allowFallbackMirrorWindowLinux"; + //----------------------------------------------------------------------------- + // openxr keys + static const char * const k_pch_OpenXR_Section = "openxr"; + static const char * const k_pch_OpenXR_MetaUnityPluginCompatibility_Int32 = "metaUnityPluginCompatibility"; + //----------------------------------------------------------------------------- // direct mode keys static const char * const k_pch_DirectMode_Section = "direct_mode"; @@ -3145,12 +3183,16 @@ class IVRChaperone * Tracking space center (0,0,0) is the center of the Play Area. **/ virtual bool GetPlayAreaSize( float *pSizeX, float *pSizeZ ) = 0; - /** Returns the 4 corner positions of the Play Area (formerly named Soft Bounds). - * Corners are in counter-clockwise order. - * Standing center (0,0,0) is the center of the Play Area. - * It's a rectangle. - * 2 sides are parallel to the X axis and 2 sides are parallel to the Z axis. - * Height of every corner is 0Y (on the floor). **/ + /** Returns a quad describing the Play Area (formerly named Soft Bounds). + * The corners form a rectangle. + * Corners are in counter-clockwise order, starting at the front-right. + * The positions are given relative to the standing origin. + * The center of the rectangle is the center of the user's calibrated play space, not necessarily the standing + * origin. + * The Play Area's forward direction goes from its center through the mid-point of a line drawn between the + * first and second corner. + * The quad lies on the XZ plane (height = 0y), with 2 sides parallel to the X-axis and two sides parallel + * to the Z-axis of the user's calibrated Play Area. **/ virtual bool GetPlayAreaRect( HmdQuad_t *rect ) = 0; /** Reload Chaperone data from the .vrchap file on disk. */ @@ -3452,6 +3494,8 @@ class IVRCompositor * - AlreadySubmitted (app has submitted two left textures or two right textures in a single frame - i.e. before calling WaitGetPoses again) */ virtual EVRCompositorError Submit( EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t* pBounds = 0, EVRSubmitFlags nSubmitFlags = Submit_Default ) = 0; + virtual EVRCompositorError SubmitWithArrayIndex( EVREye eEye, const Texture_t *pTexture, uint32_t unTextureArrayIndex, + const VRTextureBounds_t *pBounds = 0, EVRSubmitFlags nSubmitFlags = Submit_Default ) = 0; /** Clears the frame that was sent with the last call to Submit. This will cause the * compositor to show the grid until Submit is called again. */ @@ -3631,7 +3675,7 @@ class IVRCompositor virtual EVRCompositorError GetPosesForFrame( uint32_t unPosePredictionID, VR_ARRAY_COUNT( unPoseArrayCount ) TrackedDevicePose_t* pPoseArray, uint32_t unPoseArrayCount ) = 0; }; -static const char * const IVRCompositor_Version = "IVRCompositor_027"; +static const char * const IVRCompositor_Version = "IVRCompositor_028"; } // namespace vr diff --git a/headers/openvr_api.cs b/headers/openvr_api.cs index a6d7cf41..d83bfc34 100644 --- a/headers/openvr_api.cs +++ b/headers/openvr_api.cs @@ -36,6 +36,7 @@ public struct IVRSystem internal _GetProjectionRaw GetProjectionRaw; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ComputeDistortion(EVREye eEye, float fU, float fV, ref DistortionCoordinates_t pDistortionCoordinates); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ComputeDistortion ComputeDistortion; @@ -46,6 +47,7 @@ public struct IVRSystem internal _GetEyeToHeadTransform GetEyeToHeadTransform; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync, ref ulong pulFrameCounter); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetTimeSinceLastVsync GetTimeSinceLastVsync; @@ -66,12 +68,14 @@ public struct IVRSystem internal _GetOutputDevice GetOutputDevice; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsDisplayOnDesktop(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsDisplayOnDesktop IsDisplayOnDesktop; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop); + [return: MarshalAs(UnmanagedType.I1)] + internal delegate bool _SetDisplayVisibility([MarshalAs(UnmanagedType.I1)] bool bIsVisibleOnDesktop); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SetDisplayVisibility SetDisplayVisibility; @@ -121,11 +125,13 @@ public struct IVRSystem internal _GetTrackedDeviceClass GetTrackedDeviceClass; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsTrackedDeviceConnected(uint unDeviceIndex); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsTrackedDeviceConnected IsTrackedDeviceConnected; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetBoolTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetBoolTrackedDeviceProperty GetBoolTrackedDeviceProperty; @@ -166,11 +172,13 @@ public struct IVRSystem internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent); [MarshalAs(UnmanagedType.FunctionPtr)] internal _PollNextEvent PollNextEvent; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose); [MarshalAs(UnmanagedType.FunctionPtr)] internal _PollNextEventWithPose PollNextEventWithPose; @@ -186,11 +194,13 @@ public struct IVRSystem internal _GetHiddenAreaMesh GetHiddenAreaMesh; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetControllerState(uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetControllerState GetControllerState; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin, uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize, ref TrackedDevicePose_t pTrackedDevicePose); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetControllerStateWithPose GetControllerStateWithPose; @@ -211,21 +221,25 @@ public struct IVRSystem internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsInputAvailable(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsInputAvailable IsInputAvailable; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsSteamVRDrawingControllers(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsSteamVRDrawingControllers IsSteamVRDrawingControllers; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ShouldApplicationPause(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ShouldApplicationPause ShouldApplicationPause; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ShouldApplicationReduceRenderingWork(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ShouldApplicationReduceRenderingWork ShouldApplicationReduceRenderingWork; @@ -281,7 +295,7 @@ public struct IVRTrackedCamera internal _GetCameraErrorNameFromEnum GetCameraErrorNameFromEnum; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, ref bool pHasCamera); + internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, [MarshalAs(UnmanagedType.I1)] ref bool pHasCamera); [MarshalAs(UnmanagedType.FunctionPtr)] internal _HasCamera HasCamera; @@ -351,7 +365,7 @@ public struct IVRTrackedCamera public struct IVRApplications { [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRApplicationError _AddApplicationManifest(IntPtr pchApplicationManifestFullPath, bool bTemporary); + internal delegate EVRApplicationError _AddApplicationManifest(IntPtr pchApplicationManifestFullPath, [MarshalAs(UnmanagedType.I1)] bool bTemporary); [MarshalAs(UnmanagedType.FunctionPtr)] internal _AddApplicationManifest AddApplicationManifest; @@ -361,6 +375,7 @@ public struct IVRApplications internal _RemoveApplicationManifest RemoveApplicationManifest; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsApplicationInstalled(IntPtr pchAppKey); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsApplicationInstalled IsApplicationInstalled; @@ -401,6 +416,7 @@ public struct IVRApplications internal _LaunchDashboardOverlay LaunchDashboardOverlay; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _CancelApplicationLaunch(IntPtr pchAppKey); [MarshalAs(UnmanagedType.FunctionPtr)] internal _CancelApplicationLaunch CancelApplicationLaunch; @@ -426,6 +442,7 @@ public struct IVRApplications internal _GetApplicationPropertyString GetApplicationPropertyString; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetApplicationPropertyBool(IntPtr pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationPropertyBool GetApplicationPropertyBool; @@ -436,11 +453,12 @@ public struct IVRApplications internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRApplicationError _SetApplicationAutoLaunch(IntPtr pchAppKey, bool bAutoLaunch); + internal delegate EVRApplicationError _SetApplicationAutoLaunch(IntPtr pchAppKey, [MarshalAs(UnmanagedType.I1)] bool bAutoLaunch); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SetApplicationAutoLaunch SetApplicationAutoLaunch; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetApplicationAutoLaunch(IntPtr pchAppKey); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationAutoLaunch GetApplicationAutoLaunch; @@ -451,11 +469,13 @@ public struct IVRApplications internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetDefaultApplicationForMimeType(IntPtr pchMimeType, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetApplicationSupportedMimeTypes(IntPtr pchAppKey, System.Text.StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes; @@ -511,11 +531,13 @@ public struct IVRChaperone internal _GetCalibrationState GetCalibrationState; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetPlayAreaSize GetPlayAreaSize; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetPlayAreaRect GetPlayAreaRect; @@ -536,12 +558,13 @@ public struct IVRChaperone internal _GetBoundsColor GetBoundsColor; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _AreBoundsVisible(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _AreBoundsVisible AreBoundsVisible; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _ForceBoundsVisible(bool bForce); + internal delegate void _ForceBoundsVisible([MarshalAs(UnmanagedType.I1)] bool bForce); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ForceBoundsVisible ForceBoundsVisible; @@ -556,6 +579,7 @@ public struct IVRChaperone public struct IVRChaperoneSetup { [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile); [MarshalAs(UnmanagedType.FunctionPtr)] internal _CommitWorkingCopy CommitWorkingCopy; @@ -566,31 +590,37 @@ public struct IVRChaperoneSetup internal _RevertWorkingCopy RevertWorkingCopy; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetLiveCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose; @@ -626,16 +656,19 @@ public struct IVRChaperoneSetup internal _ReloadFromDisk ReloadFromDisk; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ExportLiveToBuffer(System.Text.StringBuilder pBuffer, ref uint pnBufferLength); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ExportLiveToBuffer ExportLiveToBuffer; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ImportFromBufferToWorking(IntPtr pBuffer, uint nImportFlags); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ImportFromBufferToWorking ImportFromBufferToWorking; @@ -690,6 +723,11 @@ public struct IVRCompositor [MarshalAs(UnmanagedType.FunctionPtr)] internal _Submit Submit; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRCompositorError _SubmitWithArrayIndex(EVREye eEye, ref Texture_t pTexture, uint unTextureArrayIndex, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _SubmitWithArrayIndex SubmitWithArrayIndex; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate void _ClearLastSubmittedFrame(); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -701,6 +739,7 @@ public struct IVRCompositor internal _PostPresentHandoff PostPresentHandoff; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetFrameTiming GetFrameTiming; @@ -721,17 +760,17 @@ public struct IVRCompositor internal _GetCumulativeStats GetCumulativeStats; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground); + internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, [MarshalAs(UnmanagedType.I1)] bool bBackground); [MarshalAs(UnmanagedType.FunctionPtr)] internal _FadeToColor FadeToColor; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground); + internal delegate HmdColor_t _GetCurrentFadeColor([MarshalAs(UnmanagedType.I1)] bool bBackground); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetCurrentFadeColor GetCurrentFadeColor; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _FadeGrid(float fSeconds, bool bFadeGridIn); + internal delegate void _FadeGrid(float fSeconds, [MarshalAs(UnmanagedType.I1)] bool bFadeGridIn); [MarshalAs(UnmanagedType.FunctionPtr)] internal _FadeGrid FadeGrid; @@ -766,6 +805,7 @@ public struct IVRCompositor internal _CompositorQuit CompositorQuit; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsFullscreen(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsFullscreen IsFullscreen; @@ -781,6 +821,7 @@ public struct IVRCompositor internal _GetLastFrameRenderer GetLastFrameRenderer; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _CanRenderScene(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _CanRenderScene CanRenderScene; @@ -796,6 +837,7 @@ public struct IVRCompositor internal _HideMirrorWindow HideMirrorWindow; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsMirrorWindowVisible(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsMirrorWindowVisible IsMirrorWindowVisible; @@ -806,12 +848,13 @@ public struct IVRCompositor internal _CompositorDumpImages CompositorDumpImages; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ShouldAppRenderWithLowResources(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _ForceInterleavedReprojectionOn(bool bOverride); + internal delegate void _ForceInterleavedReprojectionOn([MarshalAs(UnmanagedType.I1)] bool bOverride); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn; @@ -821,7 +864,7 @@ public struct IVRCompositor internal _ForceReconnectProcess ForceReconnectProcess; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _SuspendRendering(bool bSuspend); + internal delegate void _SuspendRendering([MarshalAs(UnmanagedType.I1)] bool bSuspend); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SuspendRendering SuspendRendering; @@ -841,6 +884,7 @@ public struct IVRCompositor internal _GetMirrorTextureGL GetMirrorTextureGL; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ReleaseSharedGLTexture ReleaseSharedGLTexture; @@ -876,16 +920,19 @@ public struct IVRCompositor internal _SubmitExplicitTimingData SubmitExplicitTimingData; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsMotionSmoothingEnabled(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsMotionSmoothingEnabled IsMotionSmoothingEnabled; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsMotionSmoothingSupported(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsMotionSmoothingSupported IsMotionSmoothingSupported; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsCurrentSceneFocusAppLoading(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsCurrentSceneFocusAppLoading IsCurrentSceneFocusAppLoading; @@ -901,6 +948,7 @@ public struct IVRCompositor internal _ClearStageOverride ClearStageOverride; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetCompositorBenchmarkResults(ref Compositor_BenchmarkResults pBenchmarkResults, uint nSizeOfBenchmarkResults); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetCompositorBenchmarkResults GetCompositorBenchmarkResults; @@ -971,12 +1019,12 @@ public struct IVROverlay internal _GetOverlayRenderingPid GetOverlayRenderingPid; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled); + internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, [MarshalAs(UnmanagedType.I1)] bool bEnabled); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SetOverlayFlag SetOverlayFlag; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled); + internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, [MarshalAs(UnmanagedType.I1)] ref bool pbEnabled); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayFlag GetOverlayFlag; @@ -1136,6 +1184,7 @@ public struct IVROverlay internal _HideOverlay HideOverlay; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsOverlayVisible IsOverlayVisible; @@ -1151,6 +1200,7 @@ public struct IVROverlay internal _WaitFrameSync WaitFrameSync; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent); [MarshalAs(UnmanagedType.FunctionPtr)] internal _PollNextOverlayEvent PollNextOverlayEvent; @@ -1176,11 +1226,13 @@ public struct IVROverlay internal _SetOverlayMouseScale SetOverlayMouseScale; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults); [MarshalAs(UnmanagedType.FunctionPtr)] internal _ComputeOverlayIntersection ComputeOverlayIntersection; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsHoverTargetOverlay IsHoverTargetOverlay; @@ -1251,11 +1303,13 @@ public struct IVROverlay internal _CreateDashboardOverlay CreateDashboardOverlay; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsDashboardVisible(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsDashboardVisible IsDashboardVisible; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsActiveDashboardOverlay IsActiveDashboardOverlay; @@ -1341,6 +1395,7 @@ public struct IVROverlayView internal _PostOverlayEvent PostOverlayEvent; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsViewingPermitted(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsViewingPermitted IsViewingPermitted; @@ -1371,11 +1426,12 @@ public struct IVRHeadsetView internal _GetHeadsetViewMode GetHeadsetViewMode; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _SetHeadsetViewCropped(bool bCropped); + internal delegate void _SetHeadsetViewCropped([MarshalAs(UnmanagedType.I1)] bool bCropped); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SetHeadsetViewCropped SetHeadsetViewCropped; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetHeadsetViewCropped(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetHeadsetViewCropped GetHeadsetViewCropped; @@ -1466,16 +1522,19 @@ public struct IVRRenderModels internal _GetComponentRenderModelName GetComponentRenderModelName; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetComponentStateForDevicePath(IntPtr pchRenderModelName, IntPtr pchComponentName, ulong devicePath, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetComponentStateForDevicePath GetComponentStateForDevicePath; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetComponentState(IntPtr pchRenderModelName, IntPtr pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetComponentState GetComponentState; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _RenderModelHasComponent(IntPtr pchRenderModelName, IntPtr pchComponentName); [MarshalAs(UnmanagedType.FunctionPtr)] internal _RenderModelHasComponent RenderModelHasComponent; @@ -1521,7 +1580,7 @@ public struct IVRSettings internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _SetBool(IntPtr pchSection, IntPtr pchSettingsKey, bool bValue, ref EVRSettingsError peError); + internal delegate void _SetBool(IntPtr pchSection, IntPtr pchSettingsKey, [MarshalAs(UnmanagedType.I1)] bool bValue, ref EVRSettingsError peError); [MarshalAs(UnmanagedType.FunctionPtr)] internal _SetBool SetBool; @@ -1541,6 +1600,7 @@ public struct IVRSettings internal _SetString SetString; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _GetBool(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetBool GetBool; @@ -1646,6 +1706,7 @@ public struct IVRDriverManager internal _GetDriverHandle GetDriverHandle; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsEnabled(uint nDriver); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsEnabled IsEnabled; @@ -1801,12 +1862,13 @@ public struct IVRInput internal _GetComponentStateForBinding GetComponentStateForBinding; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _IsUsingLegacyInput(); [MarshalAs(UnmanagedType.FunctionPtr)] internal _IsUsingLegacyInput IsUsingLegacyInput; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRInputError _OpenBindingUI(IntPtr pchAppKey, ulong ulActionSetHandle, ulong ulDeviceHandle, bool bShowOnDesktop); + internal delegate EVRInputError _OpenBindingUI(IntPtr pchAppKey, ulong ulActionSetHandle, ulong ulDeviceHandle, [MarshalAs(UnmanagedType.I1)] bool bShowOnDesktop); [MarshalAs(UnmanagedType.FunctionPtr)] internal _OpenBindingUI OpenBindingUI; @@ -1846,6 +1908,7 @@ public struct IVRIOBuffer internal _PropertyContainer PropertyContainer; [UnmanagedFunctionPointer(CallingConvention.StdCall)] + [return: MarshalAs(UnmanagedType.I1)] internal delegate bool _HasReaders(ulong ulBuffer); [MarshalAs(UnmanagedType.FunctionPtr)] internal _HasReaders HasReaders; @@ -1996,7 +2059,7 @@ public struct IVRBlockQueue internal _ReleaseReadOnlyBlock ReleaseReadOnlyBlock; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EBlockQueueError _QueueHasReader(ulong ulQueueHandle, ref bool pbHasReaders); + internal delegate EBlockQueueError _QueueHasReader(ulong ulQueueHandle, [MarshalAs(UnmanagedType.I1)] ref bool pbHasReaders); [MarshalAs(UnmanagedType.FunctionPtr)] internal _QueueHasReader QueueHasReader; @@ -2873,6 +2936,11 @@ public EVRCompositorError Submit(EVREye eEye,ref Texture_t pTexture,ref VRTextur EVRCompositorError result = FnTable.Submit(eEye,ref pTexture,ref pBounds,nSubmitFlags); return result; } + public EVRCompositorError SubmitWithArrayIndex(EVREye eEye,ref Texture_t pTexture,uint unTextureArrayIndex,ref VRTextureBounds_t pBounds,EVRSubmitFlags nSubmitFlags) + { + EVRCompositorError result = FnTable.SubmitWithArrayIndex(eEye,ref pTexture,unTextureArrayIndex,ref pBounds,nSubmitFlags); + return result; + } public void ClearLastSubmittedFrame() { FnTable.ClearLastSubmittedFrame(); @@ -4735,6 +4803,7 @@ public enum ETrackedDeviceProperty Prop_Hmd_SupportsHDR10_Bool = 2093, Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, Prop_DriverProvidedChaperoneJson_String = 2095, + Prop_ForceSystemLayerUseAppPoses_Bool = 2096, Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, @@ -4748,6 +4817,9 @@ public enum ETrackedDeviceProperty Prop_DSCVersion_Int32 = 2110, Prop_DSCSliceCount_Int32 = 2111, Prop_DSCBPPx16_Int32 = 2112, + Prop_Hmd_MaxDistortedTextureWidth_Int32 = 2113, + Prop_Hmd_MaxDistortedTextureHeight_Int32 = 2114, + Prop_Hmd_AllowSupersampleFiltering_Bool = 2115, Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202, @@ -4761,6 +4833,12 @@ public enum ETrackedDeviceProperty Prop_Audio_DefaultRecordingDeviceId_String = 2301, Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + Prop_Audio_DriverManagesPlaybackVolumeControl_Bool = 2304, + Prop_Audio_DriverPlaybackVolume_Float = 2305, + Prop_Audio_DriverPlaybackMute_Bool = 2306, + Prop_Audio_DriverManagesRecordingVolumeControl_Bool = 2307, + Prop_Audio_DriverRecordingVolume_Float = 2308, + Prop_Audio_DriverRecordingMute_Bool = 2309, Prop_AttachedDeviceId_String = 3000, Prop_SupportedButtons_Uint64 = 3001, Prop_Axis0Type_Int32 = 3002, @@ -4800,6 +4878,7 @@ public enum ETrackedDeviceProperty Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, Prop_HasSpatialAnchorsSupport_Bool = 6007, + Prop_SupportsXrTextureSets_Bool = 6008, Prop_ControllerType_String = 7000, Prop_ControllerHandSelectionPriority_Int32 = 7002, Prop_VendorSpecific_Reserved_Start = 10000, @@ -4939,6 +5018,8 @@ public enum EVREventType VREvent_ElevatePrism = 533, VREvent_OverlayClosed = 534, VREvent_DashboardThumbChanged = 535, + VREvent_DesktopMightBeVisible = 536, + VREvent_DesktopMightBeHidden = 537, VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, VREvent_Notification_BeginInteraction = 602, @@ -5033,6 +5114,10 @@ public enum EVREventType VREvent_SystemReport_Started = 1900, VREvent_Monitor_ShowHeadsetView = 2000, VREvent_Monitor_HideHeadsetView = 2001, + VREvent_Audio_SetSpeakersVolume = 2100, + VREvent_Audio_SetSpeakersMute = 2101, + VREvent_Audio_SetMicrophoneVolume = 2102, + VREvent_Audio_SetMicrophoneMute = 2103, VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, } @@ -5444,6 +5529,7 @@ public enum EVRInitError Compositor_CannotConnectToDisplayServer = 497, Compositor_GnomeNoDRMLeasing = 498, Compositor_FailedToInitializeEncoder = 499, + Compositor_CreateBlurTexture = 500, VendorSpecific_UnableToConnectToOculusRuntime = 1000, VendorSpecific_WindowsNotInDevMode = 1001, VendorSpecific_OculusLinkNotEnabled = 1002, @@ -5913,6 +5999,8 @@ public enum EBlockQueueCreationFlag [FieldOffset(0)] public VREvent_ShowUI_t showUi; [FieldOffset(0)] public VREvent_ShowDevTools_t showDevTools; [FieldOffset(0)] public VREvent_HDCPError_t hdcpError; + [FieldOffset(0)] public VREvent_AudioVolumeControl_t audioVolumeControl; + [FieldOffset(0)] public VREvent_AudioMuteControl_t audioMuteControl; [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug } @@ -6334,6 +6422,15 @@ public string cNewInput { public EHDCPError eCode; } +[StructLayout(LayoutKind.Sequential)] public struct VREvent_AudioVolumeControl_t +{ + public float fVolumeLevel; +} +[StructLayout(LayoutKind.Sequential)] public struct VREvent_AudioMuteControl_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool bMute; +} [StructLayout(LayoutKind.Sequential)] public struct VREvent_t { public uint eventType; @@ -7655,7 +7752,7 @@ public static uint GetInitToken() public const string IVRApplications_Version = "IVRApplications_007"; public const string IVRChaperone_Version = "IVRChaperone_004"; public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_006"; - public const string IVRCompositor_Version = "IVRCompositor_027"; + public const string IVRCompositor_Version = "IVRCompositor_028"; public const uint k_unVROverlayMaxKeyLength = 128; public const uint k_unVROverlayMaxNameLength = 128; public const uint k_unMaxOverlayCount = 128; @@ -7758,6 +7855,8 @@ public static uint GetInitToken() public const string k_pch_SteamVR_DisplayPortTrainingMode_Int = "displayPortTrainingMode"; public const string k_pch_SteamVR_UsePrism_Bool = "usePrism"; public const string k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = "allowFallbackMirrorWindowLinux"; + public const string k_pch_OpenXR_Section = "openxr"; + public const string k_pch_OpenXR_MetaUnityPluginCompatibility_Int32 = "metaUnityPluginCompatibility"; public const string k_pch_DirectMode_Section = "direct_mode"; public const string k_pch_DirectMode_Enable_Bool = "enable"; public const string k_pch_DirectMode_Count_Int32 = "count"; diff --git a/headers/openvr_api.json b/headers/openvr_api.json index 4654fb7a..ca3cbfce 100644 --- a/headers/openvr_api.json +++ b/headers/openvr_api.json @@ -251,6 +251,7 @@ ,{"name": "Prop_Hmd_SupportsHDR10_Bool","value": "2093"} ,{"name": "Prop_Hmd_EnableParallelRenderCameras_Bool","value": "2094"} ,{"name": "Prop_DriverProvidedChaperoneJson_String","value": "2095"} + ,{"name": "Prop_ForceSystemLayerUseAppPoses_Bool","value": "2096"} ,{"name": "Prop_IpdUIRangeMinMeters_Float","value": "2100"} ,{"name": "Prop_IpdUIRangeMaxMeters_Float","value": "2101"} ,{"name": "Prop_Hmd_SupportsHDCP14LegacyCompat_Bool","value": "2102"} @@ -264,6 +265,9 @@ ,{"name": "Prop_DSCVersion_Int32","value": "2110"} ,{"name": "Prop_DSCSliceCount_Int32","value": "2111"} ,{"name": "Prop_DSCBPPx16_Int32","value": "2112"} + ,{"name": "Prop_Hmd_MaxDistortedTextureWidth_Int32","value": "2113"} + ,{"name": "Prop_Hmd_MaxDistortedTextureHeight_Int32","value": "2114"} + ,{"name": "Prop_Hmd_AllowSupersampleFiltering_Bool","value": "2115"} ,{"name": "Prop_DriverRequestedMuraCorrectionMode_Int32","value": "2200"} ,{"name": "Prop_DriverRequestedMuraFeather_InnerLeft_Int32","value": "2201"} ,{"name": "Prop_DriverRequestedMuraFeather_InnerRight_Int32","value": "2202"} @@ -277,6 +281,12 @@ ,{"name": "Prop_Audio_DefaultRecordingDeviceId_String","value": "2301"} ,{"name": "Prop_Audio_DefaultPlaybackDeviceVolume_Float","value": "2302"} ,{"name": "Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool","value": "2303"} + ,{"name": "Prop_Audio_DriverManagesPlaybackVolumeControl_Bool","value": "2304"} + ,{"name": "Prop_Audio_DriverPlaybackVolume_Float","value": "2305"} + ,{"name": "Prop_Audio_DriverPlaybackMute_Bool","value": "2306"} + ,{"name": "Prop_Audio_DriverManagesRecordingVolumeControl_Bool","value": "2307"} + ,{"name": "Prop_Audio_DriverRecordingVolume_Float","value": "2308"} + ,{"name": "Prop_Audio_DriverRecordingMute_Bool","value": "2309"} ,{"name": "Prop_AttachedDeviceId_String","value": "3000"} ,{"name": "Prop_SupportedButtons_Uint64","value": "3001"} ,{"name": "Prop_Axis0Type_Int32","value": "3002"} @@ -316,6 +326,7 @@ ,{"name": "Prop_HasDriverDirectModeComponent_Bool","value": "6005"} ,{"name": "Prop_HasVirtualDisplayComponent_Bool","value": "6006"} ,{"name": "Prop_HasSpatialAnchorsSupport_Bool","value": "6007"} + ,{"name": "Prop_SupportsXrTextureSets_Bool","value": "6008"} ,{"name": "Prop_ControllerType_String","value": "7000"} ,{"name": "Prop_ControllerHandSelectionPriority_Int32","value": "7002"} ,{"name": "Prop_VendorSpecific_Reserved_Start","value": "10000"} @@ -450,6 +461,8 @@ ,{"name": "VREvent_ElevatePrism","value": "533"} ,{"name": "VREvent_OverlayClosed","value": "534"} ,{"name": "VREvent_DashboardThumbChanged","value": "535"} + ,{"name": "VREvent_DesktopMightBeVisible","value": "536"} + ,{"name": "VREvent_DesktopMightBeHidden","value": "537"} ,{"name": "VREvent_Notification_Shown","value": "600"} ,{"name": "VREvent_Notification_Hidden","value": "601"} ,{"name": "VREvent_Notification_BeginInteraction","value": "602"} @@ -544,6 +557,10 @@ ,{"name": "VREvent_SystemReport_Started","value": "1900"} ,{"name": "VREvent_Monitor_ShowHeadsetView","value": "2000"} ,{"name": "VREvent_Monitor_HideHeadsetView","value": "2001"} + ,{"name": "VREvent_Audio_SetSpeakersVolume","value": "2100"} + ,{"name": "VREvent_Audio_SetSpeakersMute","value": "2101"} + ,{"name": "VREvent_Audio_SetMicrophoneVolume","value": "2102"} + ,{"name": "VREvent_Audio_SetMicrophoneMute","value": "2103"} ,{"name": "VREvent_VendorSpecific_Reserved_Start","value": "10000"} ,{"name": "VREvent_VendorSpecific_Reserved_End","value": "19999"} ]} @@ -936,6 +953,7 @@ ,{"name": "VRInitError_Compositor_CannotConnectToDisplayServer","value": "497"} ,{"name": "VRInitError_Compositor_GnomeNoDRMLeasing","value": "498"} ,{"name": "VRInitError_Compositor_FailedToInitializeEncoder","value": "499"} + ,{"name": "VRInitError_Compositor_CreateBlurTexture","value": "500"} ,{"name": "VRInitError_VendorSpecific_UnableToConnectToOculusRuntime","value": "1000"} ,{"name": "VRInitError_VendorSpecific_WindowsNotInDevMode","value": "1001"} ,{"name": "VRInitError_VendorSpecific_OculusLinkNotEnabled","value": "1002"} @@ -1431,7 +1449,7 @@ ,{ "constname": "IVRChaperoneSetup_Version","consttype": "const char *const", "constval": "IVRChaperoneSetup_006"} ,{ - "constname": "IVRCompositor_Version","consttype": "const char *const", "constval": "IVRCompositor_027"} + "constname": "IVRCompositor_Version","consttype": "const char *const", "constval": "IVRCompositor_028"} ,{ "constname": "k_unVROverlayMaxKeyLength","consttype": "const uint32_t", "constval": "128"} ,{ @@ -1636,6 +1654,10 @@ "constname": "k_pch_SteamVR_UsePrism_Bool","consttype": "const char *const", "constval": "usePrism"} ,{ "constname": "k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool","consttype": "const char *const", "constval": "allowFallbackMirrorWindowLinux"} +,{ + "constname": "k_pch_OpenXR_Section","consttype": "const char *const", "constval": "openxr"} +,{ + "constname": "k_pch_OpenXR_MetaUnityPluginCompatibility_Int32","consttype": "const char *const", "constval": "metaUnityPluginCompatibility"} ,{ "constname": "k_pch_DirectMode_Section","consttype": "const char *const", "constval": "direct_mode"} ,{ @@ -2238,6 +2260,10 @@ { "fieldname": "nBrowserIdentifier", "fieldtype": "int32_t"}]} ,{"struct": "vr::VREvent_HDCPError_t","fields": [ { "fieldname": "eCode", "fieldtype": "enum vr::EHDCPError"}]} +,{"struct": "vr::VREvent_AudioVolumeControl_t","fields": [ +{ "fieldname": "fVolumeLevel", "fieldtype": "float"}]} +,{"struct": "vr::VREvent_AudioMuteControl_t","fields": [ +{ "fieldname": "bMute", "fieldtype": "_Bool"}]} ,{"struct": "vr::(anonymous)","fields": [ { "fieldname": "reserved", "fieldtype": "struct vr::VREvent_Reserved_t"}, { "fieldname": "controller", "fieldtype": "struct vr::VREvent_Controller_t"}, @@ -2267,7 +2293,9 @@ { "fieldname": "progressUpdate", "fieldtype": "struct vr::VREvent_ProgressUpdate_t"}, { "fieldname": "showUi", "fieldtype": "struct vr::VREvent_ShowUI_t"}, { "fieldname": "showDevTools", "fieldtype": "struct vr::VREvent_ShowDevTools_t"}, -{ "fieldname": "hdcpError", "fieldtype": "struct vr::VREvent_HDCPError_t"}]} +{ "fieldname": "hdcpError", "fieldtype": "struct vr::VREvent_HDCPError_t"}, +{ "fieldname": "audioVolumeControl", "fieldtype": "struct vr::VREvent_AudioVolumeControl_t"}, +{ "fieldname": "audioMuteControl", "fieldtype": "struct vr::VREvent_AudioMuteControl_t"}]} ,{"struct": "vr::VREvent_t","fields": [ { "fieldname": "eventType", "fieldtype": "uint32_t"}, { "fieldname": "trackedDeviceIndex", "fieldtype": "TrackedDeviceIndex_t"}, @@ -3647,6 +3675,18 @@ { "paramname": "nSubmitFlags" ,"paramtype": "vr::EVRSubmitFlags"} ] } +,{ + "classname": "vr::IVRCompositor", + "methodname": "SubmitWithArrayIndex", + "returntype": "vr::EVRCompositorError", + "params": [ +{ "paramname": "eEye" ,"paramtype": "vr::EVREye"}, +{ "paramname": "pTexture" ,"paramtype": "const struct vr::Texture_t *"}, +{ "paramname": "unTextureArrayIndex" ,"paramtype": "uint32_t"}, +{ "paramname": "pBounds" ,"paramtype": "const struct vr::VRTextureBounds_t *"}, +{ "paramname": "nSubmitFlags" ,"paramtype": "vr::EVRSubmitFlags"} + ] +} ,{ "classname": "vr::IVRCompositor", "methodname": "ClearLastSubmittedFrame", diff --git a/headers/openvr_capi.h b/headers/openvr_capi.h index 9127957e..49fd4a7e 100644 --- a/headers/openvr_capi.h +++ b/headers/openvr_capi.h @@ -125,7 +125,7 @@ static const char * k_pch_MimeType_GameTheater = "vr/game_theater"; static const char * IVRApplications_Version = "IVRApplications_007"; static const char * IVRChaperone_Version = "IVRChaperone_004"; static const char * IVRChaperoneSetup_Version = "IVRChaperoneSetup_006"; -static const char * IVRCompositor_Version = "IVRCompositor_027"; +static const char * IVRCompositor_Version = "IVRCompositor_028"; static const unsigned long k_unVROverlayMaxKeyLength = 128; static const unsigned long k_unVROverlayMaxNameLength = 128; static const unsigned long k_unMaxOverlayCount = 128; @@ -228,6 +228,8 @@ static const char * k_pch_SteamVR_HDCPLegacyCompatibility_Bool = "hdcp14legacyCo static const char * k_pch_SteamVR_DisplayPortTrainingMode_Int = "displayPortTrainingMode"; static const char * k_pch_SteamVR_UsePrism_Bool = "usePrism"; static const char * k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = "allowFallbackMirrorWindowLinux"; +static const char * k_pch_OpenXR_Section = "openxr"; +static const char * k_pch_OpenXR_MetaUnityPluginCompatibility_Int32 = "metaUnityPluginCompatibility"; static const char * k_pch_DirectMode_Section = "direct_mode"; static const char * k_pch_DirectMode_Enable_Bool = "enable"; static const char * k_pch_DirectMode_Count_Int32 = "count"; @@ -660,6 +662,7 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_Hmd_SupportsHDR10_Bool = 2093, ETrackedDeviceProperty_Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, ETrackedDeviceProperty_Prop_DriverProvidedChaperoneJson_String = 2095, + ETrackedDeviceProperty_Prop_ForceSystemLayerUseAppPoses_Bool = 2096, ETrackedDeviceProperty_Prop_IpdUIRangeMinMeters_Float = 2100, ETrackedDeviceProperty_Prop_IpdUIRangeMaxMeters_Float = 2101, ETrackedDeviceProperty_Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, @@ -673,6 +676,9 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_DSCVersion_Int32 = 2110, ETrackedDeviceProperty_Prop_DSCSliceCount_Int32 = 2111, ETrackedDeviceProperty_Prop_DSCBPPx16_Int32 = 2112, + ETrackedDeviceProperty_Prop_Hmd_MaxDistortedTextureWidth_Int32 = 2113, + ETrackedDeviceProperty_Prop_Hmd_MaxDistortedTextureHeight_Int32 = 2114, + ETrackedDeviceProperty_Prop_Hmd_AllowSupersampleFiltering_Bool = 2115, ETrackedDeviceProperty_Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, ETrackedDeviceProperty_Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202, @@ -686,6 +692,12 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_Audio_DefaultRecordingDeviceId_String = 2301, ETrackedDeviceProperty_Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, ETrackedDeviceProperty_Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + ETrackedDeviceProperty_Prop_Audio_DriverManagesPlaybackVolumeControl_Bool = 2304, + ETrackedDeviceProperty_Prop_Audio_DriverPlaybackVolume_Float = 2305, + ETrackedDeviceProperty_Prop_Audio_DriverPlaybackMute_Bool = 2306, + ETrackedDeviceProperty_Prop_Audio_DriverManagesRecordingVolumeControl_Bool = 2307, + ETrackedDeviceProperty_Prop_Audio_DriverRecordingVolume_Float = 2308, + ETrackedDeviceProperty_Prop_Audio_DriverRecordingMute_Bool = 2309, ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000, ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001, ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002, @@ -725,6 +737,7 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_HasDriverDirectModeComponent_Bool = 6005, ETrackedDeviceProperty_Prop_HasVirtualDisplayComponent_Bool = 6006, ETrackedDeviceProperty_Prop_HasSpatialAnchorsSupport_Bool = 6007, + ETrackedDeviceProperty_Prop_SupportsXrTextureSets_Bool = 6008, ETrackedDeviceProperty_Prop_ControllerType_String = 7000, ETrackedDeviceProperty_Prop_ControllerHandSelectionPriority_Int32 = 7002, ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000, @@ -869,6 +882,8 @@ typedef enum EVREventType EVREventType_VREvent_ElevatePrism = 533, EVREventType_VREvent_OverlayClosed = 534, EVREventType_VREvent_DashboardThumbChanged = 535, + EVREventType_VREvent_DesktopMightBeVisible = 536, + EVREventType_VREvent_DesktopMightBeHidden = 537, EVREventType_VREvent_Notification_Shown = 600, EVREventType_VREvent_Notification_Hidden = 601, EVREventType_VREvent_Notification_BeginInteraction = 602, @@ -963,6 +978,10 @@ typedef enum EVREventType EVREventType_VREvent_SystemReport_Started = 1900, EVREventType_VREvent_Monitor_ShowHeadsetView = 2000, EVREventType_VREvent_Monitor_HideHeadsetView = 2001, + EVREventType_VREvent_Audio_SetSpeakersVolume = 2100, + EVREventType_VREvent_Audio_SetSpeakersMute = 2101, + EVREventType_VREvent_Audio_SetMicrophoneVolume = 2102, + EVREventType_VREvent_Audio_SetMicrophoneMute = 2103, EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000, EVREventType_VREvent_VendorSpecific_Reserved_End = 19999, } EVREventType; @@ -1393,6 +1412,7 @@ typedef enum EVRInitError EVRInitError_VRInitError_Compositor_CannotConnectToDisplayServer = 497, EVRInitError_VRInitError_Compositor_GnomeNoDRMLeasing = 498, EVRInitError_VRInitError_Compositor_FailedToInitializeEncoder = 499, + EVRInitError_VRInitError_Compositor_CreateBlurTexture = 500, EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, EVRInitError_VRInitError_VendorSpecific_WindowsNotInDevMode = 1001, EVRInitError_VRInitError_VendorSpecific_OculusLinkNotEnabled = 1002, @@ -2287,6 +2307,16 @@ typedef struct VREvent_HDCPError_t enum EHDCPError eCode; } VREvent_HDCPError_t; +typedef struct VREvent_AudioVolumeControl_t +{ + float fVolumeLevel; +} VREvent_AudioVolumeControl_t; + +typedef struct VREvent_AudioMuteControl_t +{ + bool bMute; +} VREvent_AudioMuteControl_t; + typedef struct RenderModel_ComponentState_t { struct HmdMatrix34_t mTrackingToComponentRenderModel; @@ -2709,6 +2739,12 @@ typedef union VREvent_InputBindingLoad_t inputBinding; VREvent_InputActionManifestLoad_t actionManifest; VREvent_SpatialAnchor_t spatialAnchor; + VREvent_ProgressUpdate_t progressUpdate; + VREvent_ShowUI_t showUi; + VREvent_ShowDevTools_t showDevTools; + VREvent_HDCPError_t hdcpError; + VREvent_AudioVolumeControl_t audioVolumeControl; + VREvent_AudioMuteControl_t audioMuteControl; } VREvent_Data_t; #if defined(__linux__) || defined(__APPLE__) @@ -2901,6 +2937,7 @@ struct VR_IVRCompositor_FnTable EVRCompositorError (OPENVR_FNTABLE_CALLTYPE *GetLastPoses)(struct TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, struct TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount); EVRCompositorError (OPENVR_FNTABLE_CALLTYPE *GetLastPoseForTrackedDeviceIndex)(TrackedDeviceIndex_t unDeviceIndex, struct TrackedDevicePose_t * pOutputPose, struct TrackedDevicePose_t * pOutputGamePose); EVRCompositorError (OPENVR_FNTABLE_CALLTYPE *Submit)(EVREye eEye, struct Texture_t * pTexture, struct VRTextureBounds_t * pBounds, EVRSubmitFlags nSubmitFlags); + EVRCompositorError (OPENVR_FNTABLE_CALLTYPE *SubmitWithArrayIndex)(EVREye eEye, struct Texture_t * pTexture, uint32_t unTextureArrayIndex, struct VRTextureBounds_t * pBounds, EVRSubmitFlags nSubmitFlags); void (OPENVR_FNTABLE_CALLTYPE *ClearLastSubmittedFrame)(); void (OPENVR_FNTABLE_CALLTYPE *PostPresentHandoff)(); bool (OPENVR_FNTABLE_CALLTYPE *GetFrameTiming)(struct Compositor_FrameTiming * pTiming, uint32_t unFramesAgo); diff --git a/headers/openvr_driver.h b/headers/openvr_driver.h index 671a6ca3..c473831e 100644 --- a/headers/openvr_driver.h +++ b/headers/openvr_driver.h @@ -16,8 +16,8 @@ namespace vr { static const uint32_t k_nSteamVRVersionMajor = 2; - static const uint32_t k_nSteamVRVersionMinor = 0; - static const uint32_t k_nSteamVRVersionBuild = 10; + static const uint32_t k_nSteamVRVersionMinor = 2; + static const uint32_t k_nSteamVRVersionBuild = 3; } // namespace vr // public_vrtypes.h @@ -531,6 +531,7 @@ enum ETrackedDeviceProperty Prop_Hmd_SupportsHDR10_Bool = 2093, Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, Prop_DriverProvidedChaperoneJson_String = 2095, // higher priority than Prop_DriverProvidedChaperonePath_String + Prop_ForceSystemLayerUseAppPoses_Bool = 2096, Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, @@ -547,6 +548,10 @@ enum ETrackedDeviceProperty Prop_DSCSliceCount_Int32 = 2111, Prop_DSCBPPx16_Int32 = 2112, + Prop_Hmd_MaxDistortedTextureWidth_Int32 = 2113, + Prop_Hmd_MaxDistortedTextureHeight_Int32 = 2114, + Prop_Hmd_AllowSupersampleFiltering_Bool = 2115, + // Driver requested mura correction properties Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, @@ -558,10 +563,16 @@ enum ETrackedDeviceProperty Prop_DriverRequestedMuraFeather_OuterTop_Int32 = 2207, Prop_DriverRequestedMuraFeather_OuterBottom_Int32 = 2208, - Prop_Audio_DefaultPlaybackDeviceId_String = 2300, - Prop_Audio_DefaultRecordingDeviceId_String = 2301, - Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, - Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + Prop_Audio_DefaultPlaybackDeviceId_String = 2300, + Prop_Audio_DefaultRecordingDeviceId_String = 2301, + Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, + Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, + Prop_Audio_DriverManagesPlaybackVolumeControl_Bool = 2304, + Prop_Audio_DriverPlaybackVolume_Float = 2305, + Prop_Audio_DriverPlaybackMute_Bool = 2306, + Prop_Audio_DriverManagesRecordingVolumeControl_Bool = 2307, + Prop_Audio_DriverRecordingVolume_Float = 2308, + Prop_Audio_DriverRecordingMute_Bool = 2309, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -610,7 +621,8 @@ enum ETrackedDeviceProperty Prop_HasCameraComponent_Bool = 6004, Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, - Prop_HasSpatialAnchorsSupport_Bool = 6007, + Prop_HasSpatialAnchorsSupport_Bool = 6007, + Prop_SupportsXrTextureSets_Bool = 6008, // Properties that are set internally based on other information provided by drivers Prop_ControllerType_String = 7000, @@ -870,6 +882,9 @@ enum EVREventType VREvent_DashboardThumbChanged = 535, // Sent when a dashboard thumbnail image changes + VREvent_DesktopMightBeVisible = 536, // Sent when any known desktop related overlay is visible + VREvent_DesktopMightBeHidden = 537, // Sent when all known desktop related overlays are hidden + VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, VREvent_Notification_BeginInteraction = 602, @@ -990,6 +1005,11 @@ enum EVREventType VREvent_Monitor_ShowHeadsetView = 2000, // data is process VREvent_Monitor_HideHeadsetView = 2001, // data is process + VREvent_Audio_SetSpeakersVolume = 2100, + VREvent_Audio_SetSpeakersMute = 2101, + VREvent_Audio_SetMicrophoneVolume = 2102, + VREvent_Audio_SetMicrophoneMute = 2103, + // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, @@ -1302,6 +1322,16 @@ struct VREvent_HDCPError_t EHDCPError eCode; }; +struct VREvent_AudioVolumeControl_t +{ + float fVolumeLevel; +}; + +struct VREvent_AudioMuteControl_t +{ + bool bMute; +}; + typedef union { VREvent_Reserved_t reserved; @@ -1333,7 +1363,9 @@ typedef union VREvent_ShowUI_t showUi; VREvent_ShowDevTools_t showDevTools; VREvent_HDCPError_t hdcpError; - /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ + VREvent_AudioVolumeControl_t audioVolumeControl; + VREvent_AudioMuteControl_t audioMuteControl; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py and openvr_api_flat.h.py */ } VREvent_Data_t; @@ -1865,6 +1897,7 @@ enum EVRInitError VRInitError_Compositor_CannotConnectToDisplayServer = 497, VRInitError_Compositor_GnomeNoDRMLeasing = 498, VRInitError_Compositor_FailedToInitializeEncoder = 499, + VRInitError_Compositor_CreateBlurTexture = 500, VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, VRInitError_VendorSpecific_WindowsNotInDevMode = 1001, @@ -2474,6 +2507,11 @@ namespace vr static const char * const k_pch_SteamVR_UsePrism_Bool = "usePrism"; static const char * const k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = "allowFallbackMirrorWindowLinux"; + //----------------------------------------------------------------------------- + // openxr keys + static const char * const k_pch_OpenXR_Section = "openxr"; + static const char * const k_pch_OpenXR_MetaUnityPluginCompatibility_Int32 = "metaUnityPluginCompatibility"; + //----------------------------------------------------------------------------- // direct mode keys static const char * const k_pch_DirectMode_Section = "direct_mode"; diff --git a/lib/linuxarm64/libopenvr_api_unity.so b/lib/linuxarm64/libopenvr_api_unity.so index b6fa1b80..f971ade9 100644 Binary files a/lib/linuxarm64/libopenvr_api_unity.so and b/lib/linuxarm64/libopenvr_api_unity.so differ diff --git a/samples/bin/linux32/libopenvr_api.so b/samples/bin/linux32/libopenvr_api.so index 837b5331..fd2a93b0 100644 Binary files a/samples/bin/linux32/libopenvr_api.so and b/samples/bin/linux32/libopenvr_api.so differ diff --git a/samples/bin/linux64/libopenvr_api.so b/samples/bin/linux64/libopenvr_api.so index 9deedeed..18159159 100644 Binary files a/samples/bin/linux64/libopenvr_api.so and b/samples/bin/linux64/libopenvr_api.so differ diff --git a/samples/bin/linuxarm64/libopenvr_api.so b/samples/bin/linuxarm64/libopenvr_api.so index 50752c7d..1712fddc 100644 Binary files a/samples/bin/linuxarm64/libopenvr_api.so and b/samples/bin/linuxarm64/libopenvr_api.so differ diff --git a/samples/bin/win32/hmd_opencv_sandbox.exe b/samples/bin/win32/hmd_opencv_sandbox.exe index 36a4d6d3..27baf63b 100755 Binary files a/samples/bin/win32/hmd_opencv_sandbox.exe and b/samples/bin/win32/hmd_opencv_sandbox.exe differ diff --git a/samples/bin/win32/openvr_api.dll b/samples/bin/win32/openvr_api.dll index 4c05f2cf..cfc8f4ca 100644 Binary files a/samples/bin/win32/openvr_api.dll and b/samples/bin/win32/openvr_api.dll differ diff --git a/samples/bin/win64/hmd_opencv_sandbox.exe b/samples/bin/win64/hmd_opencv_sandbox.exe index d5a038a6..b0ddde02 100755 Binary files a/samples/bin/win64/hmd_opencv_sandbox.exe and b/samples/bin/win64/hmd_opencv_sandbox.exe differ diff --git a/samples/bin/win64/openvr_api.dll b/samples/bin/win64/openvr_api.dll index 5289e8d7..2acefbf1 100644 Binary files a/samples/bin/win64/openvr_api.dll and b/samples/bin/win64/openvr_api.dll differ diff --git a/src/vrcore/hmderrors_public.cpp b/src/vrcore/hmderrors_public.cpp index 5ce51544..ef204bd9 100644 --- a/src/vrcore/hmderrors_public.cpp +++ b/src/vrcore/hmderrors_public.cpp @@ -336,6 +336,7 @@ const char *GetIDForVRInitError( vr::EVRInitError eError ) RETURN_ENUM_AS_STRING( VRInitError_Compositor_CannotConnectToDisplayServer ); RETURN_ENUM_AS_STRING( VRInitError_Compositor_GnomeNoDRMLeasing ); RETURN_ENUM_AS_STRING( VRInitError_Compositor_FailedToInitializeEncoder ); + RETURN_ENUM_AS_STRING( VRInitError_Compositor_CreateBlurTexture ); // Vendor-specific errors RETURN_ENUM_AS_STRING( VRInitError_VendorSpecific_UnableToConnectToOculusRuntime); diff --git a/src/vrcore/pathtools_public.cpp b/src/vrcore/pathtools_public.cpp index a29154f9..161522be 100644 --- a/src/vrcore/pathtools_public.cpp +++ b/src/vrcore/pathtools_public.cpp @@ -746,9 +746,18 @@ std::string Path_ReadTextFile( const std::string &strFilename ) if (!buf) return ""; - // convert CRLF -> LF + int i = 1; /* start working at byte 1 (in-place) */ size_t outsize = 1; - for (int i=1; i < size; i++) + + // remove UTF8 BOM + if ( size >= 3 && buf[0] == 0xEF && buf[1] == 0xBB && buf[2] == 0xBF ) + { + i = 3; + outsize = 0; + } + + // convert CRLF -> LF + for ( ; i < size; i++ ) { if (buf[i] == '\n' && buf[i-1] == '\r') // CRLF buf[outsize-1] = '\n'; // ->LF