diff --git a/bin/linux32/libopenvr_api.so b/bin/linux32/libopenvr_api.so index 592dd2c1..62b1e9ad 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 80c0a20d..ea21013e 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 d4d628a8..bd4d32a0 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 c47bd94c..55cdfe7d 100755 Binary files a/bin/linux64/libopenvr_api.so.dbg and b/bin/linux64/libopenvr_api.so.dbg differ diff --git a/bin/osx32/libopenvr_api.dylib b/bin/osx32/libopenvr_api.dylib index a62096ff..0640d5b8 100755 Binary files a/bin/osx32/libopenvr_api.dylib and b/bin/osx32/libopenvr_api.dylib differ diff --git a/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib b/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib index 2bab4394..7c74b4c5 100644 Binary files a/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib and b/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib differ diff --git a/bin/win32/openvr_api.dll b/bin/win32/openvr_api.dll index 05cb0974..f7f7df74 100644 Binary files a/bin/win32/openvr_api.dll and b/bin/win32/openvr_api.dll differ diff --git a/bin/win32/openvr_api.pdb b/bin/win32/openvr_api.pdb index c73f94cf..3af34371 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 736677d3..c9539230 100644 Binary files a/bin/win64/openvr_api.dll and b/bin/win64/openvr_api.dll differ diff --git a/bin/win64/openvr_api.pdb b/bin/win64/openvr_api.pdb index 7373034c..2244c24a 100644 Binary files a/bin/win64/openvr_api.pdb and b/bin/win64/openvr_api.pdb differ diff --git a/headers/openvr.h b/headers/openvr.h index 4ad9486b..7f98acd5 100644 --- a/headers/openvr.h +++ b/headers/openvr.h @@ -36,7 +36,7 @@ typedef uint32_t glUInt_t; // right-handed system // +y is up // +x is to the right -// -z is going away from you +// -z is forward // Distance unit is meters struct HmdMatrix34_t { @@ -223,6 +223,7 @@ static const PropertyTypeTag_t k_unPathHandleInfoTag = 31; static const PropertyTypeTag_t k_unActionPropertyTag = 32; static const PropertyTypeTag_t k_unInputValuePropertyTag = 33; static const PropertyTypeTag_t k_unWildcardPropertyTag = 34; +static const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35; static const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000; static const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000; @@ -272,7 +273,7 @@ enum ETrackedDeviceProperty Prop_ParentDriver_Uint64 = 1034, Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, - Prop_InputProfileName_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided + Prop_InputProfilePath_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided // Properties that are unique to TrackedDeviceClass_HMD Prop_ReportsTimeSinceVSync_Bool = 2000, @@ -328,6 +329,10 @@ enum ETrackedDeviceProperty Prop_NamedIconPathControllerRightDeviceOff_String = 2052, // placeholder icon for "right" controller if not yet detected/loaded Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, // placeholder icon for sensor/base if not yet detected/loaded Prop_DoNotApplyPrediction_Bool = 2054, + Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DriverIsDrawingControllers_Bool = 2057, + Prop_DriverRequestsApplicationPause_Bool = 2058, + Prop_DriverRequestsReducedRendering_Bool = 2059, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -373,9 +378,15 @@ enum ETrackedDeviceProperty Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, + // Properties that are set internally based on other information provided by drivers + Prop_ControllerType_String = 7000, + Prop_LegacyInputProfile_String = 7001, + // Vendors are free to expose private debug data in this reserved region Prop_VendorSpecific_Reserved_Start = 10000, Prop_VendorSpecific_Reserved_End = 10999, + + Prop_TrackedDeviceProperty_Max = 1000000, }; /** No string property will ever be longer than this length */ @@ -413,6 +424,23 @@ struct VRTextureWithPose_t : public Texture_t HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures. }; +struct VRTextureDepthInfo_t +{ + void* handle; // See ETextureType definition above + HmdMatrix44_t mProjection; + HmdVector2_t vRange; // 0..1 +}; + +struct VRTextureWithDepth_t : public Texture_t +{ + VRTextureDepthInfo_t depth; +}; + +struct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t +{ + VRTextureDepthInfo_t depth; +}; + /** Allows the application to control how scene textures are used by the compositor when calling Submit. */ enum EVRSubmitFlags { @@ -431,7 +459,12 @@ enum EVRSubmitFlags Submit_Reserved = 0x04, // Set to indicate that pTexture is a pointer to a VRTextureWithPose_t. + // This flag can be combined with Submit_TextureWithDepth to pass a VRTextureWithPoseAndDepth_t. Submit_TextureWithPose = 0x08, + + // Set to indicate that pTexture is a pointer to a VRTextureWithDepth_t. + // This flag can be combined with Submit_TextureWithPose to pass a VRTextureWithPoseAndDepth_t. + Submit_TextureWithDepth = 0x10, }; /** Data required for passing Vulkan textures to IVRCompositor::Submit. @@ -591,9 +624,12 @@ enum EVREventType VREvent_KeyboardSectionSettingChanged = 862, VREvent_PerfSectionSettingChanged = 863, VREvent_DashboardSectionSettingChanged = 864, + VREvent_WebInterfaceSectionSettingChanged = 865, VREvent_StatusUpdate = 900, + VREvent_WebInterface_InstallDriverCompleted = 950, + VREvent_MCImageUpdated = 1000, VREvent_FirmwareUpdateStarted = 1100, @@ -630,6 +666,8 @@ enum EVREventType VREvent_MessageOverlay_Closed = 1650, VREvent_MessageOverlayCloseRequested = 1651, + VREvent_Input_HapticVibration = 1700, // data is hapticVibration + // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, @@ -844,6 +882,15 @@ struct VREvent_DualAnalog_t EDualAnalogWhich which; }; +struct VREvent_HapticVibration_t +{ + uint64_t containerHandle; // property container handle of the device with the haptic component + uint64_t componentHandle; // Which haptic component needs to vibrate + float fDurationSeconds; + float fFrequency; + float fAmplitude; +}; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ typedef union @@ -869,6 +916,7 @@ typedef union VREvent_MessageOverlay_t messageOverlay; VREvent_Property_t property; VREvent_DualAnalog_t dualAnalog; + VREvent_HapticVibration_t hapticVibration; } VREvent_Data_t; @@ -892,6 +940,21 @@ struct VREvent_t #pragma pack( pop ) #endif +enum EVRInputError +{ + VRInputError_None = 0, + VRInputError_NameNotFound = 1, + VRInputError_WrongType = 2, + VRInputError_InvalidHandle = 3, + VRInputError_InvalidParam = 4, + VRInputError_NoSteam = 5, + VRInputError_MaxCapacityReached = 6, + VRInputError_IPCError = 7, + VRInputError_NoActiveActionSet = 8, + VRInputError_InvalidDevice = 9, +}; + + /** The mesh to draw into the stencil (or depth) buffer to perform * early stencil (or depth) kills of pixels that will never appear on the HMD. * This mesh draws on all the pixels that will be hidden after distortion. @@ -1029,6 +1092,9 @@ enum EVROverlayError VROverlayError_NoNeighbor = 27, VROverlayError_TooManyMaskPrimitives = 29, VROverlayError_BadMaskPrimitive = 30, + VROverlayError_TextureAlreadyLocked = 31, + VROverlayError_TextureLockCapacityReached = 32, + VROverlayError_TextureNotLocked = 33, }; /** enum values to pass in to VR_Init to identify whether the application will @@ -1368,7 +1434,12 @@ class IVRSystem * pInstance must be the instance the application will use to query for the VkPhysicalDevice. The application * must create the VkInstance with extensions returned by IVRCompositor::GetVulkanInstanceExtensionsRequired enabled. * [macOS Only] - * Returns an id that should be used by the application. + * For TextureType_IOSurface returns the id that should be used by the application. + * On 10.13+ for TextureType_OpenGL returns the 'registryId' of the renderer which should be used + * by the application. See Apple Technical Q&A QA1168 for information on enumerating GL Renderers, and the + * new kCGLRPRegistryIDLow and kCGLRPRegistryIDHigh CGLRendererProperty values in the 10.13 SDK. + * Pre 10.13 for TextureType_OpenGL returns 0, as there is no dependable way to correlate the HMDs MTLDevice + * with a GL Renderer. */ virtual void GetOutputDevice( uint64_t *pnDevice, ETextureType textureType, VkInstance_T *pInstance = nullptr ) = 0; @@ -1477,6 +1548,11 @@ class IVRSystem /** Returns a matrix property. If the device index is not valid or the property is not a matrix type, this function will return identity. */ virtual HmdMatrix34_t GetMatrix34TrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) = 0; + + /** Returns an array of one type of property. If the device index is not valid or the property is not a single value or an array of the specified type, + * this function will return 0. Otherwise it returns the number of bytes necessary to hold the array of properties. If unBufferSize is + * greater than the returned size and pBuffer is non-NULL, pBuffer is filled with the contents of array of properties. */ + virtual uint32_t GetArrayTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, PropertyTypeTag_t propType, void *pBuffer, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L ) = 0; /** Returns a string property. If the device index is not valid or the property is not a string type this function will * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing @@ -1541,17 +1617,21 @@ class IVRSystem /** returns the name of an EVRControllerAxisType enum value */ virtual const char *GetControllerAxisTypeNameFromEnum( EVRControllerAxisType eAxisType ) = 0; - /** Tells OpenVR that this process wants exclusive access to controller button states and button events. Other apps will be notified that - * they have lost input focus with a VREvent_InputFocusCaptured event. Returns false if input focus could not be captured for - * some reason. */ - virtual bool CaptureInputFocus() = 0; + /** Returns true if this application is receiving input from the system. This would return false if + * system-related functionality is consuming the input stream. */ + virtual bool IsInputAvailable() = 0; - /** Tells OpenVR that this process no longer wants exclusive access to button states and button events. Other apps will be notified - * that input focus has been released with a VREvent_InputFocusReleased event. */ - virtual void ReleaseInputFocus() = 0; + /** Returns true SteamVR is drawing controllers on top of the application. Applications should consider + * not drawing anything attached to the user's hands in this case. */ + virtual bool IsSteamVRDrawingControllers() = 0; - /** Returns true if input focus is captured by another process. */ - virtual bool IsInputFocusCapturedByAnotherProcess() = 0; + /** Returns true if the user has put SteamVR into a mode that is distracting them from the application. + * For applications where this is appropriate, the application should pause ongoing activity. */ + virtual bool ShouldApplicationPause() = 0; + + /** Returns true if SteamVR is doing significant rendering work and the game should do what it can to reduce + * its own workload. One common way to do this is to reduce the size of the render target provided for each eye. */ + virtual bool ShouldApplicationReduceRenderingWork() = 0; // ------------------------------------ // Debug Methods @@ -1560,7 +1640,7 @@ class IVRSystem /** Sends a request to the driver for the specified device and returns the response. The maximum response size is 32k, * but this method can be called with a smaller buffer. If the response exceeds the size of the buffer, it is truncated. * The size of the response including its terminating null is returned. */ - virtual uint32_t DriverDebugRequest( vr::TrackedDeviceIndex_t unDeviceIndex, const char *pchRequest, char *pchResponseBuffer, uint32_t unResponseBufferSize ) = 0; + virtual uint32_t DriverDebugRequest( vr::TrackedDeviceIndex_t unDeviceIndex, const char *pchRequest, VR_OUT_STRING() char *pchResponseBuffer, uint32_t unResponseBufferSize ) = 0; // ------------------------------------ // Firmware methods @@ -1588,7 +1668,7 @@ class IVRSystem }; -static const char * const IVRSystem_Version = "IVRSystem_017"; +static const char * const IVRSystem_Version = "IVRSystem_019"; } @@ -1643,8 +1723,7 @@ namespace vr VRApplicationProperty_NewsURL_String = 51, VRApplicationProperty_ImagePath_String = 52, VRApplicationProperty_Source_String = 53, - VRApplicationProperty_ActionManifestPath_String = 54, - VRApplicationProperty_ActionBindingPath_String = 55, + VRApplicationProperty_ActionManifestURL_String = 54, VRApplicationProperty_IsDashboardOverlay_Bool = 60, VRApplicationProperty_IsTemplate_Bool = 61, @@ -1702,7 +1781,7 @@ namespace vr /** Returns the key of the application for the specified Process Id. The buffer should be at least * k_unMaxApplicationKeyLength in order to fit the key. */ - virtual EVRApplicationError GetApplicationKeyByProcessId( uint32_t unProcessId, char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; + virtual EVRApplicationError GetApplicationKeyByProcessId( uint32_t unProcessId, VR_OUT_STRING() char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; /** Launches the application. The existing scene application will exit and then the new application will start. * This call is not valid for dashboard overlay applications. */ @@ -1756,21 +1835,21 @@ namespace vr virtual EVRApplicationError SetDefaultApplicationForMimeType( const char *pchAppKey, const char *pchMimeType ) = 0; /** return the app key that will open this mime type */ - virtual bool GetDefaultApplicationForMimeType( const char *pchMimeType, char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; + virtual bool GetDefaultApplicationForMimeType( const char *pchMimeType, VR_OUT_STRING() char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; /** Get the list of supported mime types for this application, comma-delimited */ - virtual bool GetApplicationSupportedMimeTypes( const char *pchAppKey, char *pchMimeTypesBuffer, uint32_t unMimeTypesBuffer ) = 0; + virtual bool GetApplicationSupportedMimeTypes( const char *pchAppKey, VR_OUT_STRING() char *pchMimeTypesBuffer, uint32_t unMimeTypesBuffer ) = 0; /** Get the list of app-keys that support this mime type, comma-delimited, the return value is number of bytes you need to return the full string */ - virtual uint32_t GetApplicationsThatSupportMimeType( const char *pchMimeType, char *pchAppKeysThatSupportBuffer, uint32_t unAppKeysThatSupportBuffer ) = 0; + virtual uint32_t GetApplicationsThatSupportMimeType( const char *pchMimeType, VR_OUT_STRING() char *pchAppKeysThatSupportBuffer, uint32_t unAppKeysThatSupportBuffer ) = 0; /** Get the args list from an app launch that had the process already running, you call this when you get a VREvent_ApplicationMimeTypeLoad */ - virtual uint32_t GetApplicationLaunchArguments( uint32_t unHandle, char *pchArgs, uint32_t unArgs ) = 0; + virtual uint32_t GetApplicationLaunchArguments( uint32_t unHandle, VR_OUT_STRING() char *pchArgs, uint32_t unArgs ) = 0; // --------------- Transition methods --------------- // /** Returns the app key for the application that is starting up */ - virtual EVRApplicationError GetStartingApplication( char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; + virtual EVRApplicationError GetStartingApplication( VR_OUT_STRING() char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; /** Returns the application transition state */ virtual EVRApplicationTransitionState GetTransitionState() = 0; @@ -1898,12 +1977,15 @@ namespace vr static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; static const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; + static const char * const k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * const k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; + static const char * const k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; //----------------------------------------------------------------------------- // lighthouse keys static const char * const k_pch_Lighthouse_Section = "driver_lighthouse"; static const char * const k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; + static const char * const k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; static const char * const k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation"; static const char * const k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"; static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; @@ -2872,7 +2954,7 @@ namespace vr virtual EVROverlayError GetOverlayTextureBounds( VROverlayHandle_t ulOverlayHandle, VRTextureBounds_t *pOverlayTextureBounds ) = 0; /** Gets render model to draw behind this overlay */ - virtual uint32_t GetOverlayRenderModel( vr::VROverlayHandle_t ulOverlayHandle, char *pchValue, uint32_t unBufferSize, HmdColor_t *pColor, vr::EVROverlayError *pError ) = 0; + virtual uint32_t GetOverlayRenderModel( vr::VROverlayHandle_t ulOverlayHandle, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, HmdColor_t *pColor, vr::EVROverlayError *pError ) = 0; /** Sets render model to draw behind this overlay and the vertex color to use, pass null for pColor to match the overlays vertex color. The model is scaled by the same amount as the overlay, with a default of 1m. */ @@ -2898,7 +2980,7 @@ namespace vr virtual EVROverlayError SetOverlayTransformTrackedDeviceComponent( VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t unDeviceIndex, const char *pchComponentName ) = 0; /** Gets the transform information when the overlay is rendering on a component. */ - virtual EVROverlayError GetOverlayTransformTrackedDeviceComponent( VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t *punDeviceIndex, char *pchComponentName, uint32_t unComponentNameSize ) = 0; + virtual EVROverlayError GetOverlayTransformTrackedDeviceComponent( VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t *punDeviceIndex, VR_OUT_STRING() char *pchComponentName, uint32_t unComponentNameSize ) = 0; /** Gets the transform if it is relative to another overlay. Returns an error if the transform is some other type. */ virtual vr::EVROverlayError GetOverlayTransformOverlayRelative( VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t *ulOverlayHandleParent, HmdMatrix34_t *pmatParentOverlayToOverlayTransform ) = 0; @@ -2944,13 +3026,6 @@ namespace vr * specified settings. Returns false if there is no intersection. */ virtual bool ComputeOverlayIntersection( VROverlayHandle_t ulOverlayHandle, const VROverlayIntersectionParams_t *pParams, VROverlayIntersectionResults_t *pResults ) = 0; - /** Processes mouse input from the specified controller as though it were a mouse pointed at a compositor overlay with the - * specified settings. The controller is treated like a laser pointer on the -z axis. The point where the laser pointer would - * intersect with the overlay is the mouse position, the trigger is left mouse, and the track pad is right mouse. - * - * Return true if the controller is pointed at the overlay and an event was generated. */ - virtual bool HandleControllerOverlayInteractionAsMouse( VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t unControllerDeviceIndex ) = 0; - /** Returns true if the specified overlay is the hover target. An overlay is the hover target when it is the last overlay "moused over" * by the virtual mouse pointer */ virtual bool IsHoverTargetOverlay( VROverlayHandle_t ulOverlayHandle ) = 0; @@ -3085,7 +3160,7 @@ namespace vr virtual void CloseMessageOverlay() = 0; }; - static const char * const IVROverlay_Version = "IVROverlay_017"; + static const char * const IVROverlay_Version = "IVROverlay_018"; } // namespace vr @@ -3505,7 +3580,7 @@ class IVRResources /** Provides the full path to the specified resource. Resource names can include named directories for * drivers and other things, and this resolves all of those and returns the actual physical path. * pchResourceTypeDirectory is the subdirectory of resources to look in. */ - virtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, char *pchPathBuffer, uint32_t unBufferLen ) = 0; + virtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, VR_OUT_STRING() char *pchPathBuffer, uint32_t unBufferLen ) = 0; }; static const char * const IVRResources_Version = "IVRResources_001"; diff --git a/headers/openvr_api.cs b/headers/openvr_api.cs index 001f8933..201eafb9 100644 --- a/headers/openvr_api.cs +++ b/headers/openvr_api.cs @@ -150,6 +150,11 @@ public struct IVRSystem [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetMatrix34TrackedDeviceProperty GetMatrix34TrackedDeviceProperty; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate uint _GetArrayTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, uint propType, IntPtr pBuffer, uint unBufferSize, ref ETrackedPropertyError pError); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetArrayTrackedDeviceProperty GetArrayTrackedDeviceProperty; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate uint _GetStringTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, System.Text.StringBuilder pchValue, uint unBufferSize, ref ETrackedPropertyError pError); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -206,22 +211,27 @@ public struct IVRSystem internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _CaptureInputFocus(); + internal delegate bool _IsInputAvailable(); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _IsInputAvailable IsInputAvailable; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate bool _IsSteamVRDrawingControllers(); [MarshalAs(UnmanagedType.FunctionPtr)] - internal _CaptureInputFocus CaptureInputFocus; + internal _IsSteamVRDrawingControllers IsSteamVRDrawingControllers; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _ReleaseInputFocus(); + internal delegate bool _ShouldApplicationPause(); [MarshalAs(UnmanagedType.FunctionPtr)] - internal _ReleaseInputFocus ReleaseInputFocus; + internal _ShouldApplicationPause ShouldApplicationPause; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _IsInputFocusCapturedByAnotherProcess(); + internal delegate bool _ShouldApplicationReduceRenderingWork(); [MarshalAs(UnmanagedType.FunctionPtr)] - internal _IsInputFocusCapturedByAnotherProcess IsInputFocusCapturedByAnotherProcess; + internal _ShouldApplicationReduceRenderingWork ShouldApplicationReduceRenderingWork; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate uint _DriverDebugRequest(uint unDeviceIndex, string pchRequest, string pchResponseBuffer, uint unResponseBufferSize); + internal delegate uint _DriverDebugRequest(uint unDeviceIndex, string pchRequest, System.Text.StringBuilder pchResponseBuffer, uint unResponseBufferSize); [MarshalAs(UnmanagedType.FunctionPtr)] internal _DriverDebugRequest DriverDebugRequest; @@ -356,7 +366,7 @@ public struct IVRApplications internal _GetApplicationKeyByIndex GetApplicationKeyByIndex; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, string pchAppKeyBuffer, uint unAppKeyBufferLen); + internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId; @@ -431,27 +441,27 @@ public struct IVRApplications internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _GetDefaultApplicationForMimeType(string pchMimeType, string pchAppKeyBuffer, uint unAppKeyBufferLen); + internal delegate bool _GetDefaultApplicationForMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _GetApplicationSupportedMimeTypes(string pchAppKey, string pchMimeTypesBuffer, uint unMimeTypesBuffer); + internal delegate bool _GetApplicationSupportedMimeTypes(string pchAppKey, System.Text.StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate uint _GetApplicationsThatSupportMimeType(string pchMimeType, string pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer); + internal delegate uint _GetApplicationsThatSupportMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate uint _GetApplicationLaunchArguments(uint unHandle, string pchArgs, uint unArgs); + internal delegate uint _GetApplicationLaunchArguments(uint unHandle, System.Text.StringBuilder pchArgs, uint unArgs); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetApplicationLaunchArguments GetApplicationLaunchArguments; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVRApplicationError _GetStartingApplication(string pchAppKeyBuffer, uint unAppKeyBufferLen); + internal delegate EVRApplicationError _GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetStartingApplication GetStartingApplication; @@ -1011,7 +1021,7 @@ public struct IVROverlay internal _GetOverlayTextureBounds GetOverlayTextureBounds; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate uint _GetOverlayRenderModel(ulong ulOverlayHandle, string pchValue, uint unBufferSize, ref HmdColor_t pColor, ref EVROverlayError pError); + internal delegate uint _GetOverlayRenderModel(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref HmdColor_t pColor, ref EVROverlayError pError); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayRenderModel GetOverlayRenderModel; @@ -1051,7 +1061,7 @@ public struct IVROverlay internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, string pchComponentName, uint unComponentNameSize); + internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameSize); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent; @@ -1115,11 +1125,6 @@ public struct IVROverlay [MarshalAs(UnmanagedType.FunctionPtr)] internal _ComputeOverlayIntersection ComputeOverlayIntersection; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate bool _HandleControllerOverlayInteractionAsMouse(ulong ulOverlayHandle, uint unControllerDeviceIndex); - [MarshalAs(UnmanagedType.FunctionPtr)] - internal _HandleControllerOverlayInteractionAsMouse HandleControllerOverlayInteractionAsMouse; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -1501,7 +1506,7 @@ public struct IVRResources internal _LoadSharedResource LoadSharedResource; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate uint _GetResourceFullPath(string pchResourceName, string pchResourceTypeDirectory, string pchPathBuffer, uint unBufferLen); + internal delegate uint _GetResourceFullPath(string pchResourceName, string pchResourceTypeDirectory, System.Text.StringBuilder pchPathBuffer, uint unBufferLen); [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetResourceFullPath GetResourceFullPath; @@ -1668,6 +1673,11 @@ public HmdMatrix34_t GetMatrix34TrackedDeviceProperty(uint unDeviceIndex,ETracke HmdMatrix34_t result = FnTable.GetMatrix34TrackedDeviceProperty(unDeviceIndex,prop,ref pError); return result; } + public uint GetArrayTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,uint propType,IntPtr pBuffer,uint unBufferSize,ref ETrackedPropertyError pError) + { + uint result = FnTable.GetArrayTrackedDeviceProperty(unDeviceIndex,prop,propType,pBuffer,unBufferSize,ref pError); + return result; + } public uint GetStringTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,System.Text.StringBuilder pchValue,uint unBufferSize,ref ETrackedPropertyError pError) { uint result = FnTable.GetStringTrackedDeviceProperty(unDeviceIndex,prop,pchValue,unBufferSize,ref pError); @@ -1800,21 +1810,27 @@ public string GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType) IntPtr result = FnTable.GetControllerAxisTypeNameFromEnum(eAxisType); return Marshal.PtrToStringAnsi(result); } - public bool CaptureInputFocus() + public bool IsInputAvailable() { - bool result = FnTable.CaptureInputFocus(); + bool result = FnTable.IsInputAvailable(); return result; } - public void ReleaseInputFocus() + public bool IsSteamVRDrawingControllers() { - FnTable.ReleaseInputFocus(); + bool result = FnTable.IsSteamVRDrawingControllers(); + return result; + } + public bool ShouldApplicationPause() + { + bool result = FnTable.ShouldApplicationPause(); + return result; } - public bool IsInputFocusCapturedByAnotherProcess() + public bool ShouldApplicationReduceRenderingWork() { - bool result = FnTable.IsInputFocusCapturedByAnotherProcess(); + bool result = FnTable.ShouldApplicationReduceRenderingWork(); return result; } - public uint DriverDebugRequest(uint unDeviceIndex,string pchRequest,string pchResponseBuffer,uint unResponseBufferSize) + public uint DriverDebugRequest(uint unDeviceIndex,string pchRequest,System.Text.StringBuilder pchResponseBuffer,uint unResponseBufferSize) { uint result = FnTable.DriverDebugRequest(unDeviceIndex,pchRequest,pchResponseBuffer,unResponseBufferSize); return result; @@ -1977,7 +1993,7 @@ public EVRApplicationError GetApplicationKeyByIndex(uint unApplicationIndex,Syst EVRApplicationError result = FnTable.GetApplicationKeyByIndex(unApplicationIndex,pchAppKeyBuffer,unAppKeyBufferLen); return result; } - public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,string pchAppKeyBuffer,uint unAppKeyBufferLen) + public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen) { EVRApplicationError result = FnTable.GetApplicationKeyByProcessId(unProcessId,pchAppKeyBuffer,unAppKeyBufferLen); return result; @@ -2052,27 +2068,27 @@ public EVRApplicationError SetDefaultApplicationForMimeType(string pchAppKey,str EVRApplicationError result = FnTable.SetDefaultApplicationForMimeType(pchAppKey,pchMimeType); return result; } - public bool GetDefaultApplicationForMimeType(string pchMimeType,string pchAppKeyBuffer,uint unAppKeyBufferLen) + public bool GetDefaultApplicationForMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen) { bool result = FnTable.GetDefaultApplicationForMimeType(pchMimeType,pchAppKeyBuffer,unAppKeyBufferLen); return result; } - public bool GetApplicationSupportedMimeTypes(string pchAppKey,string pchMimeTypesBuffer,uint unMimeTypesBuffer) + public bool GetApplicationSupportedMimeTypes(string pchAppKey,System.Text.StringBuilder pchMimeTypesBuffer,uint unMimeTypesBuffer) { bool result = FnTable.GetApplicationSupportedMimeTypes(pchAppKey,pchMimeTypesBuffer,unMimeTypesBuffer); return result; } - public uint GetApplicationsThatSupportMimeType(string pchMimeType,string pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer) + public uint GetApplicationsThatSupportMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer) { uint result = FnTable.GetApplicationsThatSupportMimeType(pchMimeType,pchAppKeysThatSupportBuffer,unAppKeysThatSupportBuffer); return result; } - public uint GetApplicationLaunchArguments(uint unHandle,string pchArgs,uint unArgs) + public uint GetApplicationLaunchArguments(uint unHandle,System.Text.StringBuilder pchArgs,uint unArgs) { uint result = FnTable.GetApplicationLaunchArguments(unHandle,pchArgs,unArgs); return result; } - public EVRApplicationError GetStartingApplication(string pchAppKeyBuffer,uint unAppKeyBufferLen) + public EVRApplicationError GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen) { EVRApplicationError result = FnTable.GetStartingApplication(pchAppKeyBuffer,unAppKeyBufferLen); return result; @@ -2653,7 +2669,7 @@ public EVROverlayError GetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextu EVROverlayError result = FnTable.GetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds); return result; } - public uint GetOverlayRenderModel(ulong ulOverlayHandle,string pchValue,uint unBufferSize,ref HmdColor_t pColor,ref EVROverlayError pError) + public uint GetOverlayRenderModel(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref HmdColor_t pColor,ref EVROverlayError pError) { uint result = FnTable.GetOverlayRenderModel(ulOverlayHandle,pchValue,unBufferSize,ref pColor,ref pError); return result; @@ -2694,7 +2710,7 @@ public EVROverlayError SetOverlayTransformTrackedDeviceComponent(ulong ulOverlay EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,unDeviceIndex,pchComponentName); return result; } - public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,string pchComponentName,uint unComponentNameSize) + public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameSize) { punDeviceIndex = 0; EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize); @@ -2787,11 +2803,6 @@ public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayInters bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults); return result; } - public bool HandleControllerOverlayInteractionAsMouse(ulong ulOverlayHandle,uint unControllerDeviceIndex) - { - bool result = FnTable.HandleControllerOverlayInteractionAsMouse(ulOverlayHandle,unControllerDeviceIndex); - return result; - } public bool IsHoverTargetOverlay(ulong ulOverlayHandle) { bool result = FnTable.IsHoverTargetOverlay(ulOverlayHandle); @@ -3221,7 +3232,7 @@ public uint LoadSharedResource(string pchResourceName,string pchBuffer,uint unBu uint result = FnTable.LoadSharedResource(pchResourceName,pchBuffer,unBufferLen); return result; } - public uint GetResourceFullPath(string pchResourceName,string pchResourceTypeDirectory,string pchPathBuffer,uint unBufferLen) + public uint GetResourceFullPath(string pchResourceName,string pchResourceTypeDirectory,System.Text.StringBuilder pchPathBuffer,uint unBufferLen) { uint result = FnTable.GetResourceFullPath(pchResourceName,pchResourceTypeDirectory,pchPathBuffer,unBufferLen); return result; @@ -3358,7 +3369,7 @@ public enum ETrackedDeviceProperty Prop_ParentDriver_Uint64 = 1034, Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, - Prop_InputProfileName_String = 1037, + Prop_InputProfilePath_String = 1037, Prop_ReportsTimeSinceVSync_Bool = 2000, Prop_SecondsFromVsyncToPhotons_Float = 2001, Prop_DisplayFrequency_Float = 2002, @@ -3412,6 +3423,10 @@ public enum ETrackedDeviceProperty Prop_NamedIconPathControllerRightDeviceOff_String = 2052, Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, Prop_DoNotApplyPrediction_Bool = 2054, + Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DriverIsDrawingControllers_Bool = 2057, + Prop_DriverRequestsApplicationPause_Bool = 2058, + Prop_DriverRequestsReducedRendering_Bool = 2059, Prop_AttachedDeviceId_String = 3000, Prop_SupportedButtons_Uint64 = 3001, Prop_Axis0Type_Int32 = 3002, @@ -3446,8 +3461,11 @@ public enum ETrackedDeviceProperty Prop_HasCameraComponent_Bool = 6004, Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, + Prop_ControllerType_String = 7000, + Prop_LegacyInputProfile_String = 7001, Prop_VendorSpecific_Reserved_Start = 10000, Prop_VendorSpecific_Reserved_End = 10999, + Prop_TrackedDeviceProperty_Max = 1000000, } public enum ETrackedPropertyError { @@ -3472,6 +3490,7 @@ public enum EVRSubmitFlags Submit_GlRenderBuffer = 2, Submit_Reserved = 4, Submit_TextureWithPose = 8, + Submit_TextureWithDepth = 16, } public enum EVRState { @@ -3589,7 +3608,9 @@ public enum EVREventType VREvent_KeyboardSectionSettingChanged = 862, VREvent_PerfSectionSettingChanged = 863, VREvent_DashboardSectionSettingChanged = 864, + VREvent_WebInterfaceSectionSettingChanged = 865, VREvent_StatusUpdate = 900, + VREvent_WebInterface_InstallDriverCompleted = 950, VREvent_MCImageUpdated = 1000, VREvent_FirmwareUpdateStarted = 1100, VREvent_FirmwareUpdateFinished = 1101, @@ -3618,6 +3639,7 @@ public enum EVREventType VREvent_PerformanceTest_FidelityLevel = 1602, VREvent_MessageOverlay_Closed = 1650, VREvent_MessageOverlayCloseRequested = 1651, + VREvent_Input_HapticVibration = 1700, VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, } @@ -3661,6 +3683,19 @@ public enum EDualAnalogWhich k_EDualAnalog_Left = 0, k_EDualAnalog_Right = 1, } +public enum EVRInputError +{ + None = 0, + NameNotFound = 1, + WrongType = 2, + InvalidHandle = 3, + InvalidParam = 4, + NoSteam = 5, + MaxCapacityReached = 6, + IPCError = 7, + NoActiveActionSet = 8, + InvalidDevice = 9, +} public enum EHiddenAreaMeshType { k_eHiddenAreaMesh_Standard = 0, @@ -3712,6 +3747,9 @@ public enum EVROverlayError NoNeighbor = 27, TooManyMaskPrimitives = 29, BadMaskPrimitive = 30, + TextureAlreadyLocked = 31, + TextureLockCapacityReached = 32, + TextureNotLocked = 33, } public enum EVRApplicationType { @@ -3905,8 +3943,7 @@ public enum EVRApplicationProperty NewsURL_String = 51, ImagePath_String = 52, Source_String = 53, - ActionManifestPath_String = 54, - ActionBindingPath_String = 55, + ActionManifestURL_String = 54, IsDashboardOverlay_Bool = 60, IsTemplate_Bool = 61, IsInstanced_Bool = 62, @@ -4107,6 +4144,9 @@ public enum EVRScreenshotError [FieldOffset(0)] public VREvent_ApplicationLaunch_t applicationLaunch; [FieldOffset(0)] public VREvent_EditingCameraSurface_t cameraSurface; [FieldOffset(0)] public VREvent_MessageOverlay_t messageOverlay; + [FieldOffset(0)] public VREvent_Property_t property; + [FieldOffset(0)] public VREvent_DualAnalog_t dualAnalog; + [FieldOffset(0)] public VREvent_HapticVibration_t hapticVibration; [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug } @@ -4238,6 +4278,20 @@ public enum EVRScreenshotError { public HmdMatrix34_t mDeviceToAbsoluteTracking; } +[StructLayout(LayoutKind.Sequential)] public struct VRTextureDepthInfo_t +{ + public IntPtr handle; // void * + public HmdMatrix44_t mProjection; + public HmdVector2_t vRange; +} +[StructLayout(LayoutKind.Sequential)] public struct VRTextureWithDepth_t +{ + public VRTextureDepthInfo_t depth; +} +[StructLayout(LayoutKind.Sequential)] public struct VRTextureWithPoseAndDepth_t +{ + public VRTextureDepthInfo_t depth; +} [StructLayout(LayoutKind.Sequential)] public struct VRVulkanTextureData_t { public ulong m_nImage; @@ -4367,6 +4421,14 @@ public enum EVRScreenshotError public float transformedY; public EDualAnalogWhich which; } +[StructLayout(LayoutKind.Sequential)] public struct VREvent_HapticVibration_t +{ + public ulong containerHandle; + public ulong componentHandle; + public float fDurationSeconds; + public float fFrequency; + public float fAmplitude; +} [StructLayout(LayoutKind.Sequential)] public struct VREvent_t { public uint eventType; @@ -4733,13 +4795,14 @@ public static uint GetInitToken() public const uint k_unActionPropertyTag = 32; public const uint k_unInputValuePropertyTag = 33; public const uint k_unWildcardPropertyTag = 34; + public const uint k_unHapticVibrationPropertyTag = 35; public const uint k_unOpenVRInternalReserved_Start = 1000; public const uint k_unOpenVRInternalReserved_End = 10000; public const uint k_unMaxPropertyStringSize = 32768; public const uint k_unControllerStateAxisCount = 5; public const ulong k_ulOverlayHandleInvalid = 0; public const uint k_unScreenshotHandleInvalid = 0; - public const string IVRSystem_Version = "IVRSystem_017"; + public const string IVRSystem_Version = "IVRSystem_019"; public const string IVRExtendedDisplay_Version = "IVRExtendedDisplay_001"; public const string IVRTrackedCamera_Version = "IVRTrackedCamera_003"; public const uint k_unMaxApplicationKeyLength = 128; @@ -4753,7 +4816,7 @@ public static uint GetInitToken() public const uint k_unVROverlayMaxNameLength = 128; public const uint k_unMaxOverlayCount = 64; public const uint k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; - public const string IVROverlay_Version = "IVROverlay_017"; + public const string IVROverlay_Version = "IVROverlay_018"; public const string k_pch_Controller_Component_GDC2015 = "gdc2015"; public const string k_pch_Controller_Component_Base = "base"; public const string k_pch_Controller_Component_Tip = "tip"; @@ -4808,9 +4871,12 @@ public static uint GetInitToken() public const string k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; public const string k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; public const string k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; + public const string k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; public const string k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; + public const string k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; public const string k_pch_Lighthouse_Section = "driver_lighthouse"; public const string k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; + public const string k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; public const string k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation"; public const string k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"; public const string k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; diff --git a/headers/openvr_api.json b/headers/openvr_api.json index e5aa93d5..86cc03a2 100644 --- a/headers/openvr_api.json +++ b/headers/openvr_api.json @@ -112,7 +112,7 @@ ,{"name": "Prop_ParentDriver_Uint64","value": "1034"} ,{"name": "Prop_ResourceRoot_String","value": "1035"} ,{"name": "Prop_RegisteredDeviceType_String","value": "1036"} - ,{"name": "Prop_InputProfileName_String","value": "1037"} + ,{"name": "Prop_InputProfilePath_String","value": "1037"} ,{"name": "Prop_ReportsTimeSinceVSync_Bool","value": "2000"} ,{"name": "Prop_SecondsFromVsyncToPhotons_Float","value": "2001"} ,{"name": "Prop_DisplayFrequency_Float","value": "2002"} @@ -166,6 +166,10 @@ ,{"name": "Prop_NamedIconPathControllerRightDeviceOff_String","value": "2052"} ,{"name": "Prop_NamedIconPathTrackingReferenceDeviceOff_String","value": "2053"} ,{"name": "Prop_DoNotApplyPrediction_Bool","value": "2054"} + ,{"name": "Prop_CameraToHeadTransforms_Matrix34_Array","value": "2055"} + ,{"name": "Prop_DriverIsDrawingControllers_Bool","value": "2057"} + ,{"name": "Prop_DriverRequestsApplicationPause_Bool","value": "2058"} + ,{"name": "Prop_DriverRequestsReducedRendering_Bool","value": "2059"} ,{"name": "Prop_AttachedDeviceId_String","value": "3000"} ,{"name": "Prop_SupportedButtons_Uint64","value": "3001"} ,{"name": "Prop_Axis0Type_Int32","value": "3002"} @@ -200,8 +204,11 @@ ,{"name": "Prop_HasCameraComponent_Bool","value": "6004"} ,{"name": "Prop_HasDriverDirectModeComponent_Bool","value": "6005"} ,{"name": "Prop_HasVirtualDisplayComponent_Bool","value": "6006"} + ,{"name": "Prop_ControllerType_String","value": "7000"} + ,{"name": "Prop_LegacyInputProfile_String","value": "7001"} ,{"name": "Prop_VendorSpecific_Reserved_Start","value": "10000"} ,{"name": "Prop_VendorSpecific_Reserved_End","value": "10999"} + ,{"name": "Prop_TrackedDeviceProperty_Max","value": "1000000"} ]} , {"enumname": "vr::ETrackedPropertyError","values": [ {"name": "TrackedProp_Success","value": "0"} @@ -224,6 +231,7 @@ ,{"name": "Submit_GlRenderBuffer","value": "2"} ,{"name": "Submit_Reserved","value": "4"} ,{"name": "Submit_TextureWithPose","value": "8"} + ,{"name": "Submit_TextureWithDepth","value": "16"} ]} , {"enumname": "vr::EVRState","values": [ {"name": "VRState_Undefined","value": "-1"} @@ -339,7 +347,9 @@ ,{"name": "VREvent_KeyboardSectionSettingChanged","value": "862"} ,{"name": "VREvent_PerfSectionSettingChanged","value": "863"} ,{"name": "VREvent_DashboardSectionSettingChanged","value": "864"} + ,{"name": "VREvent_WebInterfaceSectionSettingChanged","value": "865"} ,{"name": "VREvent_StatusUpdate","value": "900"} + ,{"name": "VREvent_WebInterface_InstallDriverCompleted","value": "950"} ,{"name": "VREvent_MCImageUpdated","value": "1000"} ,{"name": "VREvent_FirmwareUpdateStarted","value": "1100"} ,{"name": "VREvent_FirmwareUpdateFinished","value": "1101"} @@ -368,6 +378,7 @@ ,{"name": "VREvent_PerformanceTest_FidelityLevel","value": "1602"} ,{"name": "VREvent_MessageOverlay_Closed","value": "1650"} ,{"name": "VREvent_MessageOverlayCloseRequested","value": "1651"} + ,{"name": "VREvent_Input_HapticVibration","value": "1700"} ,{"name": "VREvent_VendorSpecific_Reserved_Start","value": "10000"} ,{"name": "VREvent_VendorSpecific_Reserved_End","value": "19999"} ]} @@ -407,6 +418,18 @@ {"name": "k_EDualAnalog_Left","value": "0"} ,{"name": "k_EDualAnalog_Right","value": "1"} ]} +, {"enumname": "vr::EVRInputError","values": [ + {"name": "VRInputError_None","value": "0"} + ,{"name": "VRInputError_NameNotFound","value": "1"} + ,{"name": "VRInputError_WrongType","value": "2"} + ,{"name": "VRInputError_InvalidHandle","value": "3"} + ,{"name": "VRInputError_InvalidParam","value": "4"} + ,{"name": "VRInputError_NoSteam","value": "5"} + ,{"name": "VRInputError_MaxCapacityReached","value": "6"} + ,{"name": "VRInputError_IPCError","value": "7"} + ,{"name": "VRInputError_NoActiveActionSet","value": "8"} + ,{"name": "VRInputError_InvalidDevice","value": "9"} +]} , {"enumname": "vr::EHiddenAreaMeshType","values": [ {"name": "k_eHiddenAreaMesh_Standard","value": "0"} ,{"name": "k_eHiddenAreaMesh_Inverse","value": "1"} @@ -453,6 +476,9 @@ ,{"name": "VROverlayError_NoNeighbor","value": "27"} ,{"name": "VROverlayError_TooManyMaskPrimitives","value": "29"} ,{"name": "VROverlayError_BadMaskPrimitive","value": "30"} + ,{"name": "VROverlayError_TextureAlreadyLocked","value": "31"} + ,{"name": "VROverlayError_TextureLockCapacityReached","value": "32"} + ,{"name": "VROverlayError_TextureNotLocked","value": "33"} ]} , {"enumname": "vr::EVRApplicationType","values": [ {"name": "VRApplication_Other","value": "0"} @@ -636,8 +662,7 @@ ,{"name": "VRApplicationProperty_NewsURL_String","value": "51"} ,{"name": "VRApplicationProperty_ImagePath_String","value": "52"} ,{"name": "VRApplicationProperty_Source_String","value": "53"} - ,{"name": "VRApplicationProperty_ActionManifestPath_String","value": "54"} - ,{"name": "VRApplicationProperty_ActionBindingPath_String","value": "55"} + ,{"name": "VRApplicationProperty_ActionManifestURL_String","value": "54"} ,{"name": "VRApplicationProperty_IsDashboardOverlay_Bool","value": "60"} ,{"name": "VRApplicationProperty_IsTemplate_Bool","value": "61"} ,{"name": "VRApplicationProperty_IsInstanced_Bool","value": "62"} @@ -842,6 +867,8 @@ "constname": "k_unInputValuePropertyTag","consttype": "const PropertyTypeTag_t", "constval": "33"} ,{ "constname": "k_unWildcardPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "34"} +,{ + "constname": "k_unHapticVibrationPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "35"} ,{ "constname": "k_unOpenVRInternalReserved_Start","consttype": "const PropertyTypeTag_t", "constval": "1000"} ,{ @@ -855,7 +882,7 @@ ,{ "constname": "k_unScreenshotHandleInvalid","consttype": "const uint32_t", "constval": "0"} ,{ - "constname": "IVRSystem_Version","consttype": "const char *const", "constval": "IVRSystem_017"} + "constname": "IVRSystem_Version","consttype": "const char *const", "constval": "IVRSystem_019"} ,{ "constname": "IVRExtendedDisplay_Version","consttype": "const char *const", "constval": "IVRExtendedDisplay_001"} ,{ @@ -883,7 +910,7 @@ ,{ "constname": "k_unMaxOverlayIntersectionMaskPrimitivesCount","consttype": "const uint32_t", "constval": "32"} ,{ - "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_017"} + "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_018"} ,{ "constname": "k_pch_Controller_Component_GDC2015","consttype": "const char *const", "constval": "gdc2015"} ,{ @@ -992,12 +1019,18 @@ "constname": "k_pch_SteamVR_AllowSupersampleFiltering_Bool","consttype": "const char *const", "constval": "allowSupersampleFiltering"} ,{ "constname": "k_pch_SteamVR_EnableLinuxVulkanAsync_Bool","consttype": "const char *const", "constval": "enableLinuxVulkanAsync"} +,{ + "constname": "k_pch_SteamVR_AllowDisplayLockedMode_Bool","consttype": "const char *const", "constval": "allowDisplayLockedMode"} ,{ "constname": "k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool","consttype": "const char *const", "constval": "haveStartedTutorialForNativeChaperoneDriver"} +,{ + "constname": "k_pch_SteamVR_ForceWindows32bitVRMonitor","consttype": "const char *const", "constval": "forceWindows32BitVRMonitor"} ,{ "constname": "k_pch_Lighthouse_Section","consttype": "const char *const", "constval": "driver_lighthouse"} ,{ "constname": "k_pch_Lighthouse_DisableIMU_Bool","consttype": "const char *const", "constval": "disableimu"} +,{ + "constname": "k_pch_Lighthouse_DisableIMUExceptHMD_Bool","consttype": "const char *const", "constval": "disableimuexcepthmd"} ,{ "constname": "k_pch_Lighthouse_UseDisambiguation_String","consttype": "const char *const", "constval": "usedisambiguation"} ,{ @@ -1210,6 +1243,14 @@ { "fieldname": "vMax", "fieldtype": "float"}]} ,{"struct": "vr::VRTextureWithPose_t","fields": [ { "fieldname": "mDeviceToAbsoluteTracking", "fieldtype": "struct vr::HmdMatrix34_t"}]} +,{"struct": "vr::VRTextureDepthInfo_t","fields": [ +{ "fieldname": "handle", "fieldtype": "void *"}, +{ "fieldname": "mProjection", "fieldtype": "struct vr::HmdMatrix44_t"}, +{ "fieldname": "vRange", "fieldtype": "struct vr::HmdVector2_t"}]} +,{"struct": "vr::VRTextureWithDepth_t","fields": [ +{ "fieldname": "depth", "fieldtype": "struct vr::VRTextureDepthInfo_t"}]} +,{"struct": "vr::VRTextureWithPoseAndDepth_t","fields": [ +{ "fieldname": "depth", "fieldtype": "struct vr::VRTextureDepthInfo_t"}]} ,{"struct": "vr::VRVulkanTextureData_t","fields": [ { "fieldname": "m_nImage", "fieldtype": "uint64_t"}, { "fieldname": "m_pDevice", "fieldtype": "struct VkDevice_T *"}, @@ -1290,6 +1331,12 @@ { "fieldname": "transformedX", "fieldtype": "float"}, { "fieldname": "transformedY", "fieldtype": "float"}, { "fieldname": "which", "fieldtype": "enum vr::EDualAnalogWhich"}]} +,{"struct": "vr::VREvent_HapticVibration_t","fields": [ +{ "fieldname": "containerHandle", "fieldtype": "uint64_t"}, +{ "fieldname": "componentHandle", "fieldtype": "uint64_t"}, +{ "fieldname": "fDurationSeconds", "fieldtype": "float"}, +{ "fieldname": "fFrequency", "fieldtype": "float"}, +{ "fieldname": "fAmplitude", "fieldtype": "float"}]} ,{"struct": "vr::(anonymous)","fields": [ { "fieldname": "reserved", "fieldtype": "struct vr::VREvent_Reserved_t"}, { "fieldname": "controller", "fieldtype": "struct vr::VREvent_Controller_t"}, @@ -1311,7 +1358,8 @@ { "fieldname": "cameraSurface", "fieldtype": "struct vr::VREvent_EditingCameraSurface_t"}, { "fieldname": "messageOverlay", "fieldtype": "struct vr::VREvent_MessageOverlay_t"}, { "fieldname": "property", "fieldtype": "struct vr::VREvent_Property_t"}, -{ "fieldname": "dualAnalog", "fieldtype": "struct vr::VREvent_DualAnalog_t"}]} +{ "fieldname": "dualAnalog", "fieldtype": "struct vr::VREvent_DualAnalog_t"}, +{ "fieldname": "hapticVibration", "fieldtype": "struct vr::VREvent_HapticVibration_t"}]} ,{"struct": "vr::VREvent_t","fields": [ { "fieldname": "eventType", "fieldtype": "uint32_t"}, { "fieldname": "trackedDeviceIndex", "fieldtype": "TrackedDeviceIndex_t"}, @@ -1696,6 +1744,19 @@ { "paramname": "pError" ,"paramtype": "vr::ETrackedPropertyError *"} ] } +,{ + "classname": "vr::IVRSystem", + "methodname": "GetArrayTrackedDeviceProperty", + "returntype": "uint32_t", + "params": [ +{ "paramname": "unDeviceIndex" ,"paramtype": "vr::TrackedDeviceIndex_t"}, +{ "paramname": "prop" ,"paramtype": "vr::ETrackedDeviceProperty"}, +{ "paramname": "propType" ,"paramtype": "vr::PropertyTypeTag_t"}, +{ "paramname": "pBuffer" ,"paramtype": "void *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32_t"}, +{ "paramname": "pError" ,"paramtype": "vr::ETrackedPropertyError *"} + ] +} ,{ "classname": "vr::IVRSystem", "methodname": "GetStringTrackedDeviceProperty", @@ -1803,17 +1864,22 @@ } ,{ "classname": "vr::IVRSystem", - "methodname": "CaptureInputFocus", + "methodname": "IsInputAvailable", "returntype": "bool" } ,{ "classname": "vr::IVRSystem", - "methodname": "ReleaseInputFocus", - "returntype": "void" + "methodname": "IsSteamVRDrawingControllers", + "returntype": "bool" +} +,{ + "classname": "vr::IVRSystem", + "methodname": "ShouldApplicationPause", + "returntype": "bool" } ,{ "classname": "vr::IVRSystem", - "methodname": "IsInputFocusCapturedByAnotherProcess", + "methodname": "ShouldApplicationReduceRenderingWork", "returntype": "bool" } ,{ @@ -1823,7 +1889,7 @@ "params": [ { "paramname": "unDeviceIndex" ,"paramtype": "vr::TrackedDeviceIndex_t"}, { "paramname": "pchRequest" ,"paramtype": "const char *"}, -{ "paramname": "pchResponseBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchResponseBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unResponseBufferSize" ,"paramtype": "uint32_t"} ] } @@ -2051,7 +2117,7 @@ "returntype": "vr::EVRApplicationError", "params": [ { "paramname": "unProcessId" ,"paramtype": "uint32_t"}, -{ "paramname": "pchAppKeyBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchAppKeyBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unAppKeyBufferLen" ,"paramtype": "uint32_t"} ] } @@ -2188,7 +2254,7 @@ "returntype": "bool", "params": [ { "paramname": "pchMimeType" ,"paramtype": "const char *"}, -{ "paramname": "pchAppKeyBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchAppKeyBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unAppKeyBufferLen" ,"paramtype": "uint32_t"} ] } @@ -2198,7 +2264,7 @@ "returntype": "bool", "params": [ { "paramname": "pchAppKey" ,"paramtype": "const char *"}, -{ "paramname": "pchMimeTypesBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchMimeTypesBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unMimeTypesBuffer" ,"paramtype": "uint32_t"} ] } @@ -2208,7 +2274,7 @@ "returntype": "uint32_t", "params": [ { "paramname": "pchMimeType" ,"paramtype": "const char *"}, -{ "paramname": "pchAppKeysThatSupportBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchAppKeysThatSupportBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unAppKeysThatSupportBuffer" ,"paramtype": "uint32_t"} ] } @@ -2218,7 +2284,7 @@ "returntype": "uint32_t", "params": [ { "paramname": "unHandle" ,"paramtype": "uint32_t"}, -{ "paramname": "pchArgs" ,"paramtype": "char *"}, +{ "paramname": "pchArgs" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unArgs" ,"paramtype": "uint32_t"} ] } @@ -2227,7 +2293,7 @@ "methodname": "GetStartingApplication", "returntype": "vr::EVRApplicationError", "params": [ -{ "paramname": "pchAppKeyBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchAppKeyBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unAppKeyBufferLen" ,"paramtype": "uint32_t"} ] } @@ -3096,7 +3162,7 @@ "returntype": "uint32_t", "params": [ { "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, -{ "paramname": "pchValue" ,"paramtype": "char *"}, +{ "paramname": "pchValue" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unBufferSize" ,"paramtype": "uint32_t"}, { "paramname": "pColor" ,"paramtype": "struct vr::HmdColor_t *"}, { "paramname": "pError" ,"paramtype": "vr::EVROverlayError *"} @@ -3178,7 +3244,7 @@ "params": [ { "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, { "paramname": "punDeviceIndex" ,"paramtype": "vr::TrackedDeviceIndex_t *"}, -{ "paramname": "pchComponentName" ,"paramtype": "char *"}, +{ "paramname": "pchComponentName" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unComponentNameSize" ,"paramtype": "uint32_t"} ] } @@ -3293,15 +3359,6 @@ { "paramname": "pResults" ,"paramtype": "struct vr::VROverlayIntersectionResults_t *"} ] } -,{ - "classname": "vr::IVROverlay", - "methodname": "HandleControllerOverlayInteractionAsMouse", - "returntype": "bool", - "params": [ -{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, -{ "paramname": "unControllerDeviceIndex" ,"paramtype": "vr::TrackedDeviceIndex_t"} - ] -} ,{ "classname": "vr::IVROverlay", "methodname": "IsHoverTargetOverlay", @@ -3989,7 +4046,7 @@ "params": [ { "paramname": "pchResourceName" ,"paramtype": "const char *"}, { "paramname": "pchResourceTypeDirectory" ,"paramtype": "const char *"}, -{ "paramname": "pchPathBuffer" ,"paramtype": "char *"}, +{ "paramname": "pchPathBuffer" ,"out_string": " " ,"paramtype": "char *"}, { "paramname": "unBufferLen" ,"paramtype": "uint32_t"} ] } diff --git a/headers/openvr_capi.h b/headers/openvr_capi.h index fb4616aa..e32fb643 100644 --- a/headers/openvr_capi.h +++ b/headers/openvr_capi.h @@ -85,13 +85,14 @@ static const unsigned int k_unPathHandleInfoTag = 31; static const unsigned int k_unActionPropertyTag = 32; static const unsigned int k_unInputValuePropertyTag = 33; static const unsigned int k_unWildcardPropertyTag = 34; +static const unsigned int k_unHapticVibrationPropertyTag = 35; static const unsigned int k_unOpenVRInternalReserved_Start = 1000; static const unsigned int k_unOpenVRInternalReserved_End = 10000; static const unsigned int k_unMaxPropertyStringSize = 32768; static const unsigned int k_unControllerStateAxisCount = 5; static const unsigned long k_ulOverlayHandleInvalid = 0; static const unsigned int k_unScreenshotHandleInvalid = 0; -static const char * IVRSystem_Version = "IVRSystem_017"; +static const char * IVRSystem_Version = "IVRSystem_019"; static const char * IVRExtendedDisplay_Version = "IVRExtendedDisplay_001"; static const char * IVRTrackedCamera_Version = "IVRTrackedCamera_003"; static const unsigned int k_unMaxApplicationKeyLength = 128; @@ -105,7 +106,7 @@ static const unsigned int k_unVROverlayMaxKeyLength = 128; static const unsigned int k_unVROverlayMaxNameLength = 128; static const unsigned int k_unMaxOverlayCount = 64; static const unsigned int k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; -static const char * IVROverlay_Version = "IVROverlay_017"; +static const char * IVROverlay_Version = "IVROverlay_018"; static const char * k_pch_Controller_Component_GDC2015 = "gdc2015"; static const char * k_pch_Controller_Component_Base = "base"; static const char * k_pch_Controller_Component_Tip = "tip"; @@ -160,9 +161,12 @@ static const char * k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; static const char * k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; static const char * k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; +static const char * k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; +static const char * k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; static const char * k_pch_Lighthouse_Section = "driver_lighthouse"; static const char * k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; +static const char * k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; static const char * k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation"; static const char * k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"; static const char * k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; @@ -342,7 +346,7 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_ParentDriver_Uint64 = 1034, ETrackedDeviceProperty_Prop_ResourceRoot_String = 1035, ETrackedDeviceProperty_Prop_RegisteredDeviceType_String = 1036, - ETrackedDeviceProperty_Prop_InputProfileName_String = 1037, + ETrackedDeviceProperty_Prop_InputProfilePath_String = 1037, ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000, ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001, ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002, @@ -396,6 +400,10 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_NamedIconPathControllerRightDeviceOff_String = 2052, ETrackedDeviceProperty_Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, ETrackedDeviceProperty_Prop_DoNotApplyPrediction_Bool = 2054, + ETrackedDeviceProperty_Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + ETrackedDeviceProperty_Prop_DriverIsDrawingControllers_Bool = 2057, + ETrackedDeviceProperty_Prop_DriverRequestsApplicationPause_Bool = 2058, + ETrackedDeviceProperty_Prop_DriverRequestsReducedRendering_Bool = 2059, ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000, ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001, ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002, @@ -430,8 +438,11 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_HasCameraComponent_Bool = 6004, ETrackedDeviceProperty_Prop_HasDriverDirectModeComponent_Bool = 6005, ETrackedDeviceProperty_Prop_HasVirtualDisplayComponent_Bool = 6006, + ETrackedDeviceProperty_Prop_ControllerType_String = 7000, + ETrackedDeviceProperty_Prop_LegacyInputProfile_String = 7001, ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000, ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999, + ETrackedDeviceProperty_Prop_TrackedDeviceProperty_Max = 1000000, } ETrackedDeviceProperty; typedef enum ETrackedPropertyError @@ -458,6 +469,7 @@ typedef enum EVRSubmitFlags EVRSubmitFlags_Submit_GlRenderBuffer = 2, EVRSubmitFlags_Submit_Reserved = 4, EVRSubmitFlags_Submit_TextureWithPose = 8, + EVRSubmitFlags_Submit_TextureWithDepth = 16, } EVRSubmitFlags; typedef enum EVRState @@ -577,7 +589,9 @@ typedef enum EVREventType EVREventType_VREvent_KeyboardSectionSettingChanged = 862, EVREventType_VREvent_PerfSectionSettingChanged = 863, EVREventType_VREvent_DashboardSectionSettingChanged = 864, + EVREventType_VREvent_WebInterfaceSectionSettingChanged = 865, EVREventType_VREvent_StatusUpdate = 900, + EVREventType_VREvent_WebInterface_InstallDriverCompleted = 950, EVREventType_VREvent_MCImageUpdated = 1000, EVREventType_VREvent_FirmwareUpdateStarted = 1100, EVREventType_VREvent_FirmwareUpdateFinished = 1101, @@ -606,6 +620,7 @@ typedef enum EVREventType EVREventType_VREvent_PerformanceTest_FidelityLevel = 1602, EVREventType_VREvent_MessageOverlay_Closed = 1650, EVREventType_VREvent_MessageOverlayCloseRequested = 1651, + EVREventType_VREvent_Input_HapticVibration = 1700, EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000, EVREventType_VREvent_VendorSpecific_Reserved_End = 19999, } EVREventType; @@ -654,6 +669,20 @@ typedef enum EDualAnalogWhich EDualAnalogWhich_k_EDualAnalog_Right = 1, } EDualAnalogWhich; +typedef enum EVRInputError +{ + EVRInputError_VRInputError_None = 0, + EVRInputError_VRInputError_NameNotFound = 1, + EVRInputError_VRInputError_WrongType = 2, + EVRInputError_VRInputError_InvalidHandle = 3, + EVRInputError_VRInputError_InvalidParam = 4, + EVRInputError_VRInputError_NoSteam = 5, + EVRInputError_VRInputError_MaxCapacityReached = 6, + EVRInputError_VRInputError_IPCError = 7, + EVRInputError_VRInputError_NoActiveActionSet = 8, + EVRInputError_VRInputError_InvalidDevice = 9, +} EVRInputError; + typedef enum EHiddenAreaMeshType { EHiddenAreaMeshType_k_eHiddenAreaMesh_Standard = 0, @@ -709,6 +738,9 @@ typedef enum EVROverlayError EVROverlayError_VROverlayError_NoNeighbor = 27, EVROverlayError_VROverlayError_TooManyMaskPrimitives = 29, EVROverlayError_VROverlayError_BadMaskPrimitive = 30, + EVROverlayError_VROverlayError_TextureAlreadyLocked = 31, + EVROverlayError_VROverlayError_TextureLockCapacityReached = 32, + EVROverlayError_VROverlayError_TextureNotLocked = 33, } EVROverlayError; typedef enum EVRApplicationType @@ -912,8 +944,7 @@ typedef enum EVRApplicationProperty EVRApplicationProperty_VRApplicationProperty_NewsURL_String = 51, EVRApplicationProperty_VRApplicationProperty_ImagePath_String = 52, EVRApplicationProperty_VRApplicationProperty_Source_String = 53, - EVRApplicationProperty_VRApplicationProperty_ActionManifestPath_String = 54, - EVRApplicationProperty_VRApplicationProperty_ActionBindingPath_String = 55, + EVRApplicationProperty_VRApplicationProperty_ActionManifestURL_String = 54, EVRApplicationProperty_VRApplicationProperty_IsDashboardOverlay_Bool = 60, EVRApplicationProperty_VRApplicationProperty_IsTemplate_Bool = 61, EVRApplicationProperty_VRApplicationProperty_IsInstanced_Bool = 62, @@ -1247,6 +1278,23 @@ typedef struct VRTextureWithPose_t struct HmdMatrix34_t mDeviceToAbsoluteTracking; } VRTextureWithPose_t; +typedef struct VRTextureDepthInfo_t +{ + void * handle; // void * + struct HmdMatrix44_t mProjection; + struct HmdVector2_t vRange; +} VRTextureDepthInfo_t; + +typedef struct VRTextureWithDepth_t +{ + struct VRTextureDepthInfo_t depth; +} VRTextureWithDepth_t; + +typedef struct VRTextureWithPoseAndDepth_t +{ + struct VRTextureDepthInfo_t depth; +} VRTextureWithPoseAndDepth_t; + typedef struct VRVulkanTextureData_t { uint64_t m_nImage; @@ -1396,6 +1444,15 @@ typedef struct VREvent_DualAnalog_t enum EDualAnalogWhich which; } VREvent_DualAnalog_t; +typedef struct VREvent_HapticVibration_t +{ + uint64_t containerHandle; + uint64_t componentHandle; + float fDurationSeconds; + float fFrequency; + float fAmplitude; +} VREvent_HapticVibration_t; + typedef struct HiddenAreaMesh_t { struct HmdVector2_t * pVertexData; // const struct vr::HmdVector2_t * @@ -1682,6 +1739,7 @@ struct VR_IVRSystem_FnTable int32_t (OPENVR_FNTABLE_CALLTYPE *GetInt32TrackedDeviceProperty)(TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError * pError); uint64_t (OPENVR_FNTABLE_CALLTYPE *GetUint64TrackedDeviceProperty)(TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError * pError); struct HmdMatrix34_t (OPENVR_FNTABLE_CALLTYPE *GetMatrix34TrackedDeviceProperty)(TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError * pError); + uint32_t (OPENVR_FNTABLE_CALLTYPE *GetArrayTrackedDeviceProperty)(TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, PropertyTypeTag_t propType, void * pBuffer, uint32_t unBufferSize, ETrackedPropertyError * pError); uint32_t (OPENVR_FNTABLE_CALLTYPE *GetStringTrackedDeviceProperty)(TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, char * pchValue, uint32_t unBufferSize, ETrackedPropertyError * pError); char * (OPENVR_FNTABLE_CALLTYPE *GetPropErrorNameFromEnum)(ETrackedPropertyError error); bool (OPENVR_FNTABLE_CALLTYPE *PollNextEvent)(struct VREvent_t * pEvent, uint32_t uncbVREvent); @@ -1693,9 +1751,10 @@ struct VR_IVRSystem_FnTable void (OPENVR_FNTABLE_CALLTYPE *TriggerHapticPulse)(TrackedDeviceIndex_t unControllerDeviceIndex, uint32_t unAxisId, unsigned short usDurationMicroSec); char * (OPENVR_FNTABLE_CALLTYPE *GetButtonIdNameFromEnum)(EVRButtonId eButtonId); char * (OPENVR_FNTABLE_CALLTYPE *GetControllerAxisTypeNameFromEnum)(EVRControllerAxisType eAxisType); - bool (OPENVR_FNTABLE_CALLTYPE *CaptureInputFocus)(); - void (OPENVR_FNTABLE_CALLTYPE *ReleaseInputFocus)(); - bool (OPENVR_FNTABLE_CALLTYPE *IsInputFocusCapturedByAnotherProcess)(); + bool (OPENVR_FNTABLE_CALLTYPE *IsInputAvailable)(); + bool (OPENVR_FNTABLE_CALLTYPE *IsSteamVRDrawingControllers)(); + bool (OPENVR_FNTABLE_CALLTYPE *ShouldApplicationPause)(); + bool (OPENVR_FNTABLE_CALLTYPE *ShouldApplicationReduceRenderingWork)(); uint32_t (OPENVR_FNTABLE_CALLTYPE *DriverDebugRequest)(TrackedDeviceIndex_t unDeviceIndex, char * pchRequest, char * pchResponseBuffer, uint32_t unResponseBufferSize); EVRFirmwareError (OPENVR_FNTABLE_CALLTYPE *PerformFirmwareUpdate)(TrackedDeviceIndex_t unDeviceIndex); void (OPENVR_FNTABLE_CALLTYPE *AcknowledgeQuit_Exiting)(); @@ -1896,7 +1955,6 @@ struct VR_IVROverlay_FnTable EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayMouseScale)(VROverlayHandle_t ulOverlayHandle, struct HmdVector2_t * pvecMouseScale); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayMouseScale)(VROverlayHandle_t ulOverlayHandle, struct HmdVector2_t * pvecMouseScale); bool (OPENVR_FNTABLE_CALLTYPE *ComputeOverlayIntersection)(VROverlayHandle_t ulOverlayHandle, struct VROverlayIntersectionParams_t * pParams, struct VROverlayIntersectionResults_t * pResults); - bool (OPENVR_FNTABLE_CALLTYPE *HandleControllerOverlayInteractionAsMouse)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t unControllerDeviceIndex); bool (OPENVR_FNTABLE_CALLTYPE *IsHoverTargetOverlay)(VROverlayHandle_t ulOverlayHandle); VROverlayHandle_t (OPENVR_FNTABLE_CALLTYPE *GetGamepadFocusOverlay)(); EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetGamepadFocusOverlay)(VROverlayHandle_t ulNewFocusOverlay); diff --git a/headers/openvr_driver.h b/headers/openvr_driver.h index e032bcac..301cd372 100644 --- a/headers/openvr_driver.h +++ b/headers/openvr_driver.h @@ -36,7 +36,7 @@ typedef uint32_t glUInt_t; // right-handed system // +y is up // +x is to the right -// -z is going away from you +// -z is forward // Distance unit is meters struct HmdMatrix34_t { @@ -223,6 +223,7 @@ static const PropertyTypeTag_t k_unPathHandleInfoTag = 31; static const PropertyTypeTag_t k_unActionPropertyTag = 32; static const PropertyTypeTag_t k_unInputValuePropertyTag = 33; static const PropertyTypeTag_t k_unWildcardPropertyTag = 34; +static const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35; static const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000; static const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000; @@ -272,7 +273,7 @@ enum ETrackedDeviceProperty Prop_ParentDriver_Uint64 = 1034, Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, - Prop_InputProfileName_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided + Prop_InputProfilePath_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided // Properties that are unique to TrackedDeviceClass_HMD Prop_ReportsTimeSinceVSync_Bool = 2000, @@ -328,6 +329,10 @@ enum ETrackedDeviceProperty Prop_NamedIconPathControllerRightDeviceOff_String = 2052, // placeholder icon for "right" controller if not yet detected/loaded Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, // placeholder icon for sensor/base if not yet detected/loaded Prop_DoNotApplyPrediction_Bool = 2054, + Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DriverIsDrawingControllers_Bool = 2057, + Prop_DriverRequestsApplicationPause_Bool = 2058, + Prop_DriverRequestsReducedRendering_Bool = 2059, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -373,9 +378,15 @@ enum ETrackedDeviceProperty Prop_HasDriverDirectModeComponent_Bool = 6005, Prop_HasVirtualDisplayComponent_Bool = 6006, + // Properties that are set internally based on other information provided by drivers + Prop_ControllerType_String = 7000, + Prop_LegacyInputProfile_String = 7001, + // Vendors are free to expose private debug data in this reserved region Prop_VendorSpecific_Reserved_Start = 10000, Prop_VendorSpecific_Reserved_End = 10999, + + Prop_TrackedDeviceProperty_Max = 1000000, }; /** No string property will ever be longer than this length */ @@ -413,6 +424,23 @@ struct VRTextureWithPose_t : public Texture_t HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures. }; +struct VRTextureDepthInfo_t +{ + void* handle; // See ETextureType definition above + HmdMatrix44_t mProjection; + HmdVector2_t vRange; // 0..1 +}; + +struct VRTextureWithDepth_t : public Texture_t +{ + VRTextureDepthInfo_t depth; +}; + +struct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t +{ + VRTextureDepthInfo_t depth; +}; + /** Allows the application to control how scene textures are used by the compositor when calling Submit. */ enum EVRSubmitFlags { @@ -431,7 +459,12 @@ enum EVRSubmitFlags Submit_Reserved = 0x04, // Set to indicate that pTexture is a pointer to a VRTextureWithPose_t. + // This flag can be combined with Submit_TextureWithDepth to pass a VRTextureWithPoseAndDepth_t. Submit_TextureWithPose = 0x08, + + // Set to indicate that pTexture is a pointer to a VRTextureWithDepth_t. + // This flag can be combined with Submit_TextureWithPose to pass a VRTextureWithPoseAndDepth_t. + Submit_TextureWithDepth = 0x10, }; /** Data required for passing Vulkan textures to IVRCompositor::Submit. @@ -591,9 +624,12 @@ enum EVREventType VREvent_KeyboardSectionSettingChanged = 862, VREvent_PerfSectionSettingChanged = 863, VREvent_DashboardSectionSettingChanged = 864, + VREvent_WebInterfaceSectionSettingChanged = 865, VREvent_StatusUpdate = 900, + VREvent_WebInterface_InstallDriverCompleted = 950, + VREvent_MCImageUpdated = 1000, VREvent_FirmwareUpdateStarted = 1100, @@ -630,6 +666,8 @@ enum EVREventType VREvent_MessageOverlay_Closed = 1650, VREvent_MessageOverlayCloseRequested = 1651, + VREvent_Input_HapticVibration = 1700, // data is hapticVibration + // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, @@ -844,6 +882,15 @@ struct VREvent_DualAnalog_t EDualAnalogWhich which; }; +struct VREvent_HapticVibration_t +{ + uint64_t containerHandle; // property container handle of the device with the haptic component + uint64_t componentHandle; // Which haptic component needs to vibrate + float fDurationSeconds; + float fFrequency; + float fAmplitude; +}; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ typedef union @@ -869,6 +916,7 @@ typedef union VREvent_MessageOverlay_t messageOverlay; VREvent_Property_t property; VREvent_DualAnalog_t dualAnalog; + VREvent_HapticVibration_t hapticVibration; } VREvent_Data_t; @@ -892,6 +940,21 @@ struct VREvent_t #pragma pack( pop ) #endif +enum EVRInputError +{ + VRInputError_None = 0, + VRInputError_NameNotFound = 1, + VRInputError_WrongType = 2, + VRInputError_InvalidHandle = 3, + VRInputError_InvalidParam = 4, + VRInputError_NoSteam = 5, + VRInputError_MaxCapacityReached = 6, + VRInputError_IPCError = 7, + VRInputError_NoActiveActionSet = 8, + VRInputError_InvalidDevice = 9, +}; + + /** The mesh to draw into the stencil (or depth) buffer to perform * early stencil (or depth) kills of pixels that will never appear on the HMD. * This mesh draws on all the pixels that will be hidden after distortion. @@ -1029,6 +1092,9 @@ enum EVROverlayError VROverlayError_NoNeighbor = 27, VROverlayError_TooManyMaskPrimitives = 29, VROverlayError_BadMaskPrimitive = 30, + VROverlayError_TextureAlreadyLocked = 31, + VROverlayError_TextureLockCapacityReached = 32, + VROverlayError_TextureNotLocked = 33, }; /** enum values to pass in to VR_Init to identify whether the application will @@ -1480,12 +1546,15 @@ namespace vr static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; static const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; + static const char * const k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * const k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; + static const char * const k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; //----------------------------------------------------------------------------- // lighthouse keys static const char * const k_pch_Lighthouse_Section = "driver_lighthouse"; static const char * const k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; + static const char * const k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; static const char * const k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation"; static const char * const k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"; static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; @@ -1818,35 +1887,6 @@ namespace vr } -// ivrcontrollercomponent.h -namespace vr -{ - - - // ---------------------------------------------------------------------------------------------- - // Purpose: Controller access on a single tracked device. - // ---------------------------------------------------------------------------------------------- - class IVRControllerComponent - { - public: - - // ------------------------------------ - // Controller Methods - // ------------------------------------ - - /** Gets the current state of a controller. */ - virtual VRControllerState_t GetControllerState( ) = 0; - - /** Returns a uint64 property. If the property is not available this function will return 0. */ - virtual bool TriggerHapticPulse( uint32_t unAxisId, uint16_t usPulseDurationMicroseconds ) = 0; - - }; - - - - static const char *IVRControllerComponent_Version = "IVRControllerComponent_001"; - -} // ivrcameracomponent.h namespace vr { @@ -1979,6 +2019,7 @@ static const char *IVRWatchdogProvider_Version = "IVRWatchdogProvider_001"; } // ivrproperties.h #include +#include namespace vr { @@ -2060,6 +2101,10 @@ class CVRPropertyHelpers * return an empty string. */ std::string GetStringProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError = nullptr ); + /** Reads a std::vector of data from a property. */ + template< typename T> + ETrackedPropertyError GetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector *pvecResults ); + /** Sets a scaler property. The new value will be returned on any subsequent call to get this property in any process. */ ETrackedPropertyError SetBoolProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, bool bNewValue ); ETrackedPropertyError SetFloatProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, float fNewValue ); @@ -2081,6 +2126,10 @@ class CVRPropertyHelpers /* Turns a device index into a property container handle. */ PropertyContainerHandle_t TrackedDeviceToPropertyContainer( TrackedDeviceIndex_t nDevice ) { return m_pProperties->TrackedDeviceToPropertyContainer( nDevice ); } + /** Sets a std::vector of typed data to a property. */ + template< typename T> + ETrackedPropertyError SetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector *vecProperties ); + private: template T GetPropertyHelper( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError, T bDefault, PropertyTypeTag_t unTypeTag ); @@ -2298,8 +2347,100 @@ inline ETrackedPropertyError CVRPropertyHelpers::EraseProperty( PropertyContaine } +template< typename T > +ETrackedPropertyError CVRPropertyHelpers::SetPropertyVector(PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, PropertyTypeTag_t unTag, std::vector *pvecProperties) +{ + return SetProperty( ulContainer, prop, &(*pvecProperties)[0], (uint32_t)(pvecProperties->size() * sizeof( T )), unTag ); } +template< typename T > +ETrackedPropertyError CVRPropertyHelpers::GetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector *pvecResults ) +{ + ETrackedPropertyError err; + PropertyTypeTag_t unTag; + uint32_t unNeeded; + if ( pvecResults->empty() ) + unNeeded = GetProperty( ulContainer, prop, nullptr, 0, &unTag, &err ); + else + unNeeded = GetProperty( ulContainer, prop, &(*pvecResults)[0], (uint32_t)(pvecResults->size() * sizeof( T )), &unTag, &err ); + uint32_t unFound = unNeeded / sizeof( T ); + if ( err == TrackedProp_Success ) + { + if ( unTag != unExpectedTag && unFound > 0 ) + { + return TrackedProp_WrongDataType; + } + + pvecResults->resize( unFound ); + return TrackedProp_Success; + } + else if ( err == TrackedProp_BufferTooSmall ) + { + pvecResults->resize( unFound ); + unNeeded = GetProperty( ulContainer, prop, &(*pvecResults)[0], (uint32_t)(pvecResults->size() * sizeof( T )), &unTag, &err ); + unFound = unNeeded / sizeof( T ); + + if ( err == TrackedProp_Success ) + { + if ( unTag != unExpectedTag ) + { + return TrackedProp_WrongDataType; + } + + pvecResults->resize( unFound ); + return TrackedProp_Success; + } + } + return err; +} + +} + + +// ivrdriverinput.h +namespace vr +{ + + typedef uint64_t VRInputComponentHandle_t; + static const VRInputComponentHandle_t k_ulInvalidInputComponentHandle = 0; + + enum EVRScalarType + { + VRScalarType_Absolute = 0, + VRScalarType_Relative = 1, + }; + + + enum EVRScalarUnits + { + VRScalarUnits_NormalizedOneSided = 0, // Value ranges from 0 to 1 + VRScalarUnits_NormalizedTwoSided = 1, // Value ranges from -1 to 1 + }; + + class IVRDriverInput + { + public: + + /** Creates a boolean input component for the device */ + virtual EVRInputError CreateBooleanComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0; + + /** Updates a boolean component */ + virtual EVRInputError UpdateBooleanComponent( VRInputComponentHandle_t ulComponent, bool bNewValue, double fTimeOffset ) = 0; + + /** Creates a scalar input component for the device */ + virtual EVRInputError CreateScalarComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle, EVRScalarType eType, EVRScalarUnits eUnits ) = 0; + + /** Updates a boolean component */ + virtual EVRInputError UpdateScalarComponent( VRInputComponentHandle_t ulComponent, float fNewValue, double fTimeOffset ) = 0; + + /** Creates a haptic component for the device */ + virtual EVRInputError CreateHapticComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0; + + }; + + static const char * const IVRDriverInput_Version = "IVRDriverInput_001"; + +} // namespace vr // ivrdriverlog.h namespace vr @@ -2343,24 +2484,6 @@ class IVRServerDriverHost * only permitted on devices of the HMD class. */ virtual void VsyncEvent( double vsyncTimeOffsetSeconds ) = 0; - /** notifies the server that the button was pressed */ - virtual void TrackedDeviceButtonPressed( uint32_t unWhichDevice, EVRButtonId eButtonId, double eventTimeOffset ) = 0; - - /** notifies the server that the button was unpressed */ - virtual void TrackedDeviceButtonUnpressed( uint32_t unWhichDevice, EVRButtonId eButtonId, double eventTimeOffset ) = 0; - - /** notifies the server that the button was pressed */ - virtual void TrackedDeviceButtonTouched( uint32_t unWhichDevice, EVRButtonId eButtonId, double eventTimeOffset ) = 0; - - /** notifies the server that the button was unpressed */ - virtual void TrackedDeviceButtonUntouched( uint32_t unWhichDevice, EVRButtonId eButtonId, double eventTimeOffset ) = 0; - - /** notifies the server than a controller axis changed */ - virtual void TrackedDeviceAxisUpdated( uint32_t unWhichDevice, uint32_t unWhichAxis, const VRControllerAxis_t & axisState ) = 0; - - /** Notifies the server that the proximity sensor on the specified device */ - virtual void ProximitySensorState( uint32_t unWhichDevice, bool bProximitySensorTriggered ) = 0; - /** Sends a vendor specific event (VREvent_VendorSpecific_Reserved_Start..VREvent_VendorSpecific_Reserved_End */ virtual void VendorSpecificEvent( uint32_t unWhichDevice, vr::EVREventType eventType, const VREvent_Data_t & eventData, double eventTimeOffset ) = 0; @@ -2381,7 +2504,7 @@ class IVRServerDriverHost virtual void TrackedDeviceDisplayTransformUpdated( uint32_t unWhichDevice, HmdMatrix34_t eyeToHeadLeft, HmdMatrix34_t eyeToHeadRight ) = 0; }; -static const char *IVRServerDriverHost_Version = "IVRServerDriverHost_004"; +static const char *IVRServerDriverHost_Version = "IVRServerDriverHost_005"; } @@ -2505,7 +2628,7 @@ class IVRResources /** Provides the full path to the specified resource. Resource names can include named directories for * drivers and other things, and this resolves all of those and returns the actual physical path. * pchResourceTypeDirectory is the subdirectory of resources to look in. */ - virtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, char *pchPathBuffer, uint32_t unBufferLen ) = 0; + virtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, VR_OUT_STRING() char *pchPathBuffer, uint32_t unBufferLen ) = 0; }; static const char * const IVRResources_Version = "IVRResources_001"; @@ -2541,7 +2664,6 @@ namespace vr ITrackedDeviceServerDriver_Version, IVRDisplayComponent_Version, IVRDriverDirectModeComponent_Version, - IVRControllerComponent_Version, IVRCameraComponent_Version, IServerTrackedDeviceProvider_Version, IVRWatchdogProvider_Version, @@ -2655,6 +2777,16 @@ namespace vr return m_pVRResources; } + IVRDriverInput *VRDriverInput() + { + if ( !m_pVRDriverInput ) + { + EVRInitError eError; + m_pVRDriverInput = (IVRDriverInput *)VRDriverContext()->GetGenericInterface( IVRDriverInput_Version, &eError ); + } + return m_pVRDriverInput; + } + private: CVRPropertyHelpers m_propertyHelpers; CVRHiddenAreaHelpers m_hiddenAreaHelpers; @@ -2666,6 +2798,7 @@ namespace vr IVRDriverLog *m_pVRDriverLog; IVRDriverManager *m_pVRDriverManager; IVRResources *m_pVRResources; + IVRDriverInput *m_pVRDriverInput; }; inline COpenVRDriverContext &OpenVRInternal_ModuleServerDriverContext() @@ -2684,6 +2817,7 @@ namespace vr inline DriverHandle_t VR_CALLTYPE VRDriverHandle() { return OpenVRInternal_ModuleServerDriverContext().VRDriverHandle(); } inline IVRDriverManager *VR_CALLTYPE VRDriverManager() { return OpenVRInternal_ModuleServerDriverContext().VRDriverManager(); } inline IVRResources *VR_CALLTYPE VRResources() { return OpenVRInternal_ModuleServerDriverContext().VRResources(); } + inline IVRDriverInput *VR_CALLTYPE VRDriverInput() { return OpenVRInternal_ModuleServerDriverContext().VRDriverInput(); } inline void COpenVRDriverContext::Clear() { @@ -2694,6 +2828,7 @@ namespace vr m_pVRWatchdogHost = nullptr; m_pVRDriverManager = nullptr; m_pVRResources = nullptr; + m_pVRDriverInput = nullptr; } inline EVRInitError COpenVRDriverContext::InitServer() diff --git a/lib/linux32/libopenvr_api.so b/lib/linux32/libopenvr_api.so index cd355b1a..3707af1e 100755 Binary files a/lib/linux32/libopenvr_api.so and b/lib/linux32/libopenvr_api.so differ diff --git a/lib/linux64/libopenvr_api.so b/lib/linux64/libopenvr_api.so index cdd35590..9501b7ca 100755 Binary files a/lib/linux64/libopenvr_api.so and b/lib/linux64/libopenvr_api.so differ diff --git a/lib/win32/openvr_api.lib b/lib/win32/openvr_api.lib index 2ae7254d..52308d45 100644 Binary files a/lib/win32/openvr_api.lib and b/lib/win32/openvr_api.lib differ diff --git a/lib/win64/openvr_api.lib b/lib/win64/openvr_api.lib index 62de19d3..543028b1 100644 Binary files a/lib/win64/openvr_api.lib and b/lib/win64/openvr_api.lib differ diff --git a/samples/bin/linux64/libopenvr_api.so b/samples/bin/linux64/libopenvr_api.so index d4d628a8..bd4d32a0 100644 Binary files a/samples/bin/linux64/libopenvr_api.so and b/samples/bin/linux64/libopenvr_api.so differ diff --git a/samples/bin/osx32/libopenvr_api.dylib b/samples/bin/osx32/libopenvr_api.dylib index a62096ff..0640d5b8 100644 Binary files a/samples/bin/osx32/libopenvr_api.dylib and b/samples/bin/osx32/libopenvr_api.dylib differ diff --git a/samples/bin/win32/openvr_api.dll b/samples/bin/win32/openvr_api.dll index 05cb0974..f7f7df74 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/openvr_api.dll b/samples/bin/win64/openvr_api.dll index 736677d3..c9539230 100644 Binary files a/samples/bin/win64/openvr_api.dll and b/samples/bin/win64/openvr_api.dll differ diff --git a/samples/hellovr_dx12/hellovr_dx12_main.cpp b/samples/hellovr_dx12/hellovr_dx12_main.cpp index 879b88c2..6e067a0a 100644 --- a/samples/hellovr_dx12/hellovr_dx12_main.cpp +++ b/samples/hellovr_dx12/hellovr_dx12_main.cpp @@ -1444,8 +1444,8 @@ void CMainApplication::AddCubeToScene( Matrix4 mat, std::vector &vertdata //----------------------------------------------------------------------------- void CMainApplication::UpdateControllerAxes() { - // don't draw controllers if somebody else has input focus - if( m_pHMD->IsInputFocusCapturedByAnotherProcess() ) + // Don't attempt to update controllers if input is not available + if( !m_pHMD->IsInputAvailable() ) return; std::vector vertdataarray; @@ -1753,9 +1753,9 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) m_pCommandList->DrawInstanced( m_uiVertcount, 1, 0, 0 ); } - bool bIsInputCapturedByAnotherProcess = m_pHMD->IsInputFocusCapturedByAnotherProcess(); + bool bIsInputAvailable = m_pHMD->IsInputAvailable(); - if( !bIsInputCapturedByAnotherProcess && m_pControllerAxisVertexBuffer ) + if( bIsInputAvailable && m_pControllerAxisVertexBuffer ) { // draw the controller axis lines m_pCommandList->SetPipelineState( m_pAxesPipelineState.Get() ); @@ -1776,7 +1776,7 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) if( !pose.bPoseIsValid ) continue; - if( bIsInputCapturedByAnotherProcess && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) + if( !bIsInputAvailable && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) continue; const Matrix4 & matDeviceToTracking = m_rmat4DevicePose[ unTrackedDevice ]; diff --git a/samples/hellovr_opengl/hellovr_opengl_main.cpp b/samples/hellovr_opengl/hellovr_opengl_main.cpp index 9d004a9b..f154b630 100644 --- a/samples/hellovr_opengl/hellovr_opengl_main.cpp +++ b/samples/hellovr_opengl/hellovr_opengl_main.cpp @@ -1124,8 +1124,8 @@ void CMainApplication::AddCubeToScene( Matrix4 mat, std::vector &vertdata //----------------------------------------------------------------------------- void CMainApplication::RenderControllerAxes() { - // don't draw controllers if somebody else has input focus - if( m_pHMD->IsInputFocusCapturedByAnotherProcess() ) + // Don't attempt to update controllers if input is not available + if( !m_pHMD->IsInputAvailable() ) return; std::vector vertdataarray; @@ -1410,9 +1410,9 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) glBindVertexArray( 0 ); } - bool bIsInputCapturedByAnotherProcess = m_pHMD->IsInputFocusCapturedByAnotherProcess(); + bool bIsInputAvailable = m_pHMD->IsInputAvailable(); - if( !bIsInputCapturedByAnotherProcess ) + if( bIsInputAvailable ) { // draw the controller axis lines glUseProgram( m_unControllerTransformProgramID ); @@ -1434,7 +1434,7 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) if( !pose.bPoseIsValid ) continue; - if( bIsInputCapturedByAnotherProcess && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) + if( !bIsInputAvailable && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) continue; const Matrix4 & matDeviceToTracking = m_rmat4DevicePose[ unTrackedDevice ]; diff --git a/samples/hellovr_vulkan/hellovr_vulkan_main.cpp b/samples/hellovr_vulkan/hellovr_vulkan_main.cpp index 8beaa2df..b8af7ba6 100644 --- a/samples/hellovr_vulkan/hellovr_vulkan_main.cpp +++ b/samples/hellovr_vulkan/hellovr_vulkan_main.cpp @@ -2490,8 +2490,8 @@ void CMainApplication::AddCubeToScene( Matrix4 mat, std::vector &vertdata //----------------------------------------------------------------------------- void CMainApplication::UpdateControllerAxes() { - // don't draw controllers if somebody else has input focus - if( m_pHMD->IsInputFocusCapturedByAnotherProcess() ) + // Don't attempt to update controllers if input is not available + if( !m_pHMD->IsInputAvailable() ) return; std::vector vertdataarray; @@ -3050,8 +3050,8 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) vkCmdDraw( m_currentCommandBuffer.m_pCommandBuffer, m_uiVertcount, 1, 0, 0 ); } - bool bIsInputCapturedByAnotherProcess = m_pHMD->IsInputFocusCapturedByAnotherProcess(); - if( !bIsInputCapturedByAnotherProcess && m_pControllerAxesVertexBuffer != VK_NULL_HANDLE ) + bool bIsInputAvailable = m_pHMD->IsInputAvailable(); + if( bIsInputAvailable && m_pControllerAxesVertexBuffer != VK_NULL_HANDLE ) { // draw the controller axis lines vkCmdBindPipeline( m_currentCommandBuffer.m_pCommandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_pPipelines[ PSO_AXES ] ); @@ -3072,7 +3072,7 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) if( !pose.bPoseIsValid ) continue; - if( bIsInputCapturedByAnotherProcess && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) + if( !bIsInputAvailable && m_pHMD->GetTrackedDeviceClass( unTrackedDevice ) == vr::TrackedDeviceClass_Controller ) continue; const Matrix4 & matDeviceToTracking = m_rmat4DevicePose[ unTrackedDevice ]; diff --git a/samples/helloworldoverlay/helloworldoverlay.pro b/samples/helloworldoverlay/helloworldoverlay.pro index aee8a6d2..a1ec7bf5 100644 --- a/samples/helloworldoverlay/helloworldoverlay.pro +++ b/samples/helloworldoverlay/helloworldoverlay.pro @@ -5,6 +5,7 @@ #------------------------------------------------- QT += core gui +QT += core gui opengl CONFIG += c++11 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets @@ -24,6 +25,25 @@ FORMS += overlaywidget.ui INCLUDEPATH += ../../headers -LIBS += -L../../lib/win32 -lopenvr_api +win32:contains(QMAKE_HOST.arch, x86_64) { + LIBS += -L../../lib/win64 -lopenvr_api + DESTDIR = ../bin/win64 +} else { + LIBS += -L../../lib/win32 -lopenvr_api + DESTDIR = ../bin/win32 +} +unix:!macx { +LIBS += -L../../lib/win32 -lopenvr_api + LIBS += -L../../lib/linux32 -lopenvr_api + DESTDIR = ../bin/linux32 +} + +macx: { + #QMAKE_CXXFLAGS += -std=c++11 + CONFIG += c++11 + LIBS += -L../../lib/osx32 -lopenvr_api DESTDIR = ../bin/win32 + DESTDIR = ../bin/osx32 +} + diff --git a/samples/helloworldoverlay/main.cpp b/samples/helloworldoverlay/main.cpp index 3c571717..efef0296 100644 --- a/samples/helloworldoverlay/main.cpp +++ b/samples/helloworldoverlay/main.cpp @@ -1,6 +1,6 @@ #include "overlaywidget.h" #include "openvroverlaycontroller.h" -#include +#include int main(int argc, char *argv[]) { diff --git a/samples/helloworldoverlay/openvroverlaycontroller.cpp b/samples/helloworldoverlay/openvroverlaycontroller.cpp index edb80322..07d1b14a 100644 --- a/samples/helloworldoverlay/openvroverlaycontroller.cpp +++ b/samples/helloworldoverlay/openvroverlaycontroller.cpp @@ -36,20 +36,19 @@ COpenVROverlayController *COpenVROverlayController::SharedInstance() //----------------------------------------------------------------------------- COpenVROverlayController::COpenVROverlayController() : BaseClass() + , m_strVRDriver( "No Driver" ) + , m_strVRDisplay( "No Display" ) , m_eLastHmdError( vr::VRInitError_None ) , m_eCompositorError( vr::VRInitError_None ) , m_eOverlayError( vr::VRInitError_None ) - , m_strVRDriver( "No Driver" ) - , m_strVRDisplay( "No Display" ) + , m_ulOverlayHandle( vr::k_ulOverlayHandleInvalid ) , m_pOpenGLContext( NULL ) , m_pScene( NULL ) - , m_pOffscreenSurface ( NULL ) , m_pFbo( NULL ) - , m_pWidget( NULL ) + , m_pOffscreenSurface ( NULL ) , m_pPumpEventsTimer( NULL ) + , m_pWidget( NULL ) , m_lastMouseButtons( 0 ) - , m_ulOverlayHandle( vr::k_ulOverlayHandleInvalid ) - , m_bManualMouseHandling( false ) { } @@ -171,7 +170,7 @@ void COpenVROverlayController::Shutdown() void COpenVROverlayController::OnSceneChanged( const QList& ) { // skip rendering if the overlay isn't visible - if( !vr::VROverlay() || + if( ( m_ulOverlayHandle == k_ulOverlayHandleInvalid ) || !vr::VROverlay() || ( !vr::VROverlay()->IsOverlayVisible( m_ulOverlayHandle ) && !vr::VROverlay()->IsOverlayVisible( m_ulOverlayThumbnailHandle ) ) ) return; @@ -202,19 +201,6 @@ void COpenVROverlayController::OnTimeoutPumpEvents() if( !vr::VRSystem() ) return; - - if( m_bManualMouseHandling ) - { - // tell OpenVR to make some events for us - for( vr::TrackedDeviceIndex_t unDeviceId = 1; unDeviceId < vr::k_unControllerStateAxisCount; unDeviceId++ ) - { - if( vr::VROverlay()->HandleControllerOverlayInteractionAsMouse( m_ulOverlayHandle, unDeviceId ) ) - { - break; - } - } - } - vr::VREvent_t vrEvent; while( vr::VROverlay()->PollNextOverlayEvent( m_ulOverlayHandle, &vrEvent, sizeof( vrEvent ) ) ) { diff --git a/samples/helloworldoverlay/openvroverlaycontroller.h b/samples/helloworldoverlay/openvroverlaycontroller.h index df67c30c..85916168 100644 --- a/samples/helloworldoverlay/openvroverlaycontroller.h +++ b/samples/helloworldoverlay/openvroverlaycontroller.h @@ -11,15 +11,15 @@ #include // because of incompatibilities with QtOpenGL and GLEW we need to cherry pick includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include +#include #include -#include -class QOpenGLFramebufferObject; +#include class COpenVROverlayController : public QObject { @@ -83,7 +83,6 @@ public slots: QPointF m_ptLastMouse; Qt::MouseButtons m_lastMouseButtons; - bool m_bManualMouseHandling; }; diff --git a/samples/helloworldoverlay/overlaywidget.h b/samples/helloworldoverlay/overlaywidget.h index 6e83611d..08ce3aa1 100644 --- a/samples/helloworldoverlay/overlaywidget.h +++ b/samples/helloworldoverlay/overlaywidget.h @@ -1,7 +1,7 @@ #ifndef OVERLAYWIDGET_H #define OVERLAYWIDGET_H -#include +#include namespace Ui { class OverlayWidget; diff --git a/samples/shared/Vectors.h b/samples/shared/Vectors.h index 2e08103c..2efb840a 100644 --- a/samples/shared/Vectors.h +++ b/samples/shared/Vectors.h @@ -237,8 +237,8 @@ inline float& Vector2::operator[](int index) { return (&x)[index]; } -inline void Vector2::set(float x, float y) { - this->x = x; this->y = y; +inline void Vector2::set(float x_, float y_) { + this->x = x_; this->y = y_; } inline float Vector2::length() const { @@ -356,8 +356,8 @@ inline float& Vector3::operator[](int index) { return (&x)[index]; } -inline void Vector3::set(float x, float y, float z) { - this->x = x; this->y = y; this->z = z; +inline void Vector3::set(float x_, float y_, float z_) { + this->x = x_; this->y = y_; this->z = z_; } inline float Vector3::length() const { @@ -481,8 +481,8 @@ inline float& Vector4::operator[](int index) { return (&x)[index]; } -inline void Vector4::set(float x, float y, float z, float w) { - this->x = x; this->y = y; this->z = z; this->w = w; +inline void Vector4::set(float x_, float y_, float z_, float w_) { + this->x = x_; this->y = y_; this->z = z_; this->w = w_; } inline float Vector4::length() const { diff --git a/src/vrcommon/hmderrors_public.cpp b/src/vrcommon/hmderrors_public.cpp index c7356f92..cac9b902 100644 --- a/src/vrcommon/hmderrors_public.cpp +++ b/src/vrcommon/hmderrors_public.cpp @@ -160,6 +160,7 @@ const char *GetIDForVRInitError( vr::EVRInitError eError ) RETURN_ENUM_AS_STRING( VRInitError_Init_RebootingBusy ); RETURN_ENUM_AS_STRING( VRInitError_Init_FirmwareUpdateBusy ); RETURN_ENUM_AS_STRING( VRInitError_Init_FirmwareRecoveryBusy ); + RETURN_ENUM_AS_STRING( VRInitError_Init_USBServiceBusy ); RETURN_ENUM_AS_STRING( VRInitError_Init_HmdDriverIdIsNone ); RETURN_ENUM_AS_STRING( VRInitError_Init_HmdNotFoundPresenceFailed ); diff --git a/src/vrcommon/pathtools_public.cpp b/src/vrcommon/pathtools_public.cpp index 843caa35..885b2046 100644 --- a/src/vrcommon/pathtools_public.cpp +++ b/src/vrcommon/pathtools_public.cpp @@ -656,7 +656,7 @@ bool Path_WriteBinaryFile(const std::string &strFilename, unsigned char *pData, fclose(f); } - return written = nSize ? true : false; + return written == nSize ? true : false; } std::string Path_ReadTextFile( const std::string &strFilename )