Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/openvr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Selan <jeremys@valvesoftware.com>2017-05-02 00:02:33 +0300
committerJeremy Selan <jeremys@valvesoftware.com>2017-05-02 00:02:33 +0300
commitb6539291b88eaa65c58c076cafe4eacd0ae2e062 (patch)
tree475d015be4d6d6bc5d4a5b3b7f7fb3d3a17a0eae
parent7fa6470f2972970859f2395f1390f6d87d4b0fc3 (diff)
OpenVR SDK 1.0.7:v1.0.7
General: - Updated structure packing to be more consistent across platforms. - New property (Prop_SecondsFromPhotonsToVblank_Float) to support rolling illumination displays. - New property (Prop_ResourceRoot_String). When present identifies the properly named driver subdir to be used for sourcing resources. - New properties which are automatically set based on components a given driver implements. - Prop_HasDisplayComponent_Bool - Prop_HasControllerComponent_Bool - Prop_HasCameraComponent_Bool - Prop_HasDriverDirectModeComponent_Bool - Prop_HasVirtualDisplayComponent_Bool IVROverlay: - Added SetOverlayName method. - Added SetOverlayRenderModel method. 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. - Added GetOverlayRenderModel accessor. - Added SetOverlayTransformOverlayRelative method. Sets the transform to relative to the transform of the specified overlay. This overlays visibility will also track the parents visibility. - Added GetOverlayTransformOverlayRelative accessor. IVRServerDriverHost: - Added GetRawTrackedDevicePoses. Provides access to device poses for drivers. Poses are in their "raw" tracking space which is uniquely defined by each driver providing poses for its devices. It is up to clients of this function to correlate poses across different drivers. Poses are indexed by their device id, and their associated driver and other properties can be looked up via IVRProperties. IVRVirtualDisplay: - New interface drivers can implement to redirect display output. - Added new device type (TrackedDeviceClass_DisplayRedirect) for accessories which redirect display output. [git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 3936268]
-rwxr-xr-xbin/linux32/libopenvr_api.sobin0 -> 287376 bytes
-rwxr-xr-xbin/linux32/libopenvr_api.so.dbgbin0 -> 1969890 bytes
-rwxr-xr-xbin/linux64/libopenvr_api.sobin284733 -> 284827 bytes
-rwxr-xr-xbin/linux64/libopenvr_api.so.dbgbin2401947 -> 2453713 bytes
-rwxr-xr-xbin/osx32/libopenvr_api.dylibbin296540 -> 296772 bytes
-rw-r--r--bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylibbin1994700 -> 2009602 bytes
-rw-r--r--bin/win32/openvr_api.dllbin257312 -> 257312 bytes
-rw-r--r--bin/win32/openvr_api.pdbbin4599808 -> 4632576 bytes
-rw-r--r--bin/win64/openvr_api.dllbin302880 -> 302880 bytes
-rw-r--r--bin/win64/openvr_api.pdbbin4386816 -> 4435968 bytes
-rw-r--r--headers/openvr.h154
-rw-r--r--headers/openvr_api.cs181
-rw-r--r--headers/openvr_api.json71
-rw-r--r--headers/openvr_capi.h40
-rw-r--r--headers/openvr_driver.h109
-rwxr-xr-xlib/linux32/libopenvr_api.sobin0 -> 1963478 bytes
-rwxr-xr-xlib/linux64/libopenvr_api.sobin2395531 -> 2447145 bytes
-rw-r--r--lib/win32/openvr_api.libbin5750 -> 5964 bytes
-rw-r--r--lib/win64/openvr_api.libbin5668 -> 5876 bytes
-rw-r--r--samples/bin/drivers/sample/resources/driver.vrresources36
-rw-r--r--samples/bin/linux64/libopenvr_api.sobin284733 -> 284827 bytes
-rw-r--r--samples/bin/osx32/libopenvr_api.dylibbin296540 -> 296772 bytes
-rw-r--r--samples/bin/win32/openvr_api.dllbin257312 -> 257312 bytes
-rw-r--r--samples/bin/win64/openvr_api.dllbin302880 -> 302880 bytes
-rw-r--r--samples/driver_sample/driver_sample.cpp49
-rw-r--r--src/ivrclientcore.h2
-rw-r--r--src/vrcommon/pathtools_public.h3
-rw-r--r--src/vrcommon/sharedlibtools_public.cpp2
28 files changed, 512 insertions, 135 deletions
diff --git a/bin/linux32/libopenvr_api.so b/bin/linux32/libopenvr_api.so
new file mode 100755
index 0000000..00825b9
--- /dev/null
+++ b/bin/linux32/libopenvr_api.so
Binary files differ
diff --git a/bin/linux32/libopenvr_api.so.dbg b/bin/linux32/libopenvr_api.so.dbg
new file mode 100755
index 0000000..0230ff3
--- /dev/null
+++ b/bin/linux32/libopenvr_api.so.dbg
Binary files differ
diff --git a/bin/linux64/libopenvr_api.so b/bin/linux64/libopenvr_api.so
index eafad11..8d30531 100755
--- a/bin/linux64/libopenvr_api.so
+++ b/bin/linux64/libopenvr_api.so
Binary files differ
diff --git a/bin/linux64/libopenvr_api.so.dbg b/bin/linux64/libopenvr_api.so.dbg
index 877c284..ae4f8c5 100755
--- a/bin/linux64/libopenvr_api.so.dbg
+++ b/bin/linux64/libopenvr_api.so.dbg
Binary files differ
diff --git a/bin/osx32/libopenvr_api.dylib b/bin/osx32/libopenvr_api.dylib
index b3da84f..5a20f3a 100755
--- a/bin/osx32/libopenvr_api.dylib
+++ b/bin/osx32/libopenvr_api.dylib
Binary files 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 8ca6951..6fcf050 100644
--- 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
Binary files differ
diff --git a/bin/win32/openvr_api.dll b/bin/win32/openvr_api.dll
index 83ead53..aafef72 100644
--- a/bin/win32/openvr_api.dll
+++ b/bin/win32/openvr_api.dll
Binary files differ
diff --git a/bin/win32/openvr_api.pdb b/bin/win32/openvr_api.pdb
index a7bb091..6c8f14f 100644
--- a/bin/win32/openvr_api.pdb
+++ b/bin/win32/openvr_api.pdb
Binary files differ
diff --git a/bin/win64/openvr_api.dll b/bin/win64/openvr_api.dll
index 5767d72..ddda897 100644
--- a/bin/win64/openvr_api.dll
+++ b/bin/win64/openvr_api.dll
Binary files differ
diff --git a/bin/win64/openvr_api.pdb b/bin/win64/openvr_api.pdb
index 082d478..e5f67ed 100644
--- a/bin/win64/openvr_api.pdb
+++ b/bin/win64/openvr_api.pdb
Binary files differ
diff --git a/headers/openvr.h b/headers/openvr.h
index 19f2a0b..2020e9d 100644
--- a/headers/openvr.h
+++ b/headers/openvr.h
@@ -27,17 +27,7 @@ struct ID3D12CommandQueue;
namespace vr
{
-
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
typedef void* glSharedTextureHandle_t;
typedef int32_t glInt_t;
@@ -120,7 +110,7 @@ enum ETextureType
TextureType_DirectX = 0, // Handle is an ID3D11Texture
TextureType_OpenGL = 1, // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags
TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure
- TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurface
+ TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef
TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure
};
@@ -170,6 +160,7 @@ enum ETrackedDeviceClass
TrackedDeviceClass_Controller = 2, // Tracked controllers
TrackedDeviceClass_GenericTracker = 3, // Generic trackers, similar to controllers
TrackedDeviceClass_TrackingReference = 4, // Camera and base stations that serve as tracking reference points
+ TrackedDeviceClass_DisplayRedirect = 5, // Accessories that aren't necessarily tracked themselves, but may redirect video output from other tracked devices
};
@@ -272,7 +263,7 @@ enum ETrackedDeviceProperty
Prop_Firmware_ForceUpdateRequired_Bool = 1032,
Prop_ViveSystemButtonFixRequired_Bool = 1033,
Prop_ParentDriver_Uint64 = 1034,
-
+ Prop_ResourceRoot_String = 1035,
// Properties that are unique to TrackedDeviceClass_HMD
Prop_ReportsTimeSinceVSync_Bool = 2000,
@@ -317,7 +308,7 @@ enum ETrackedDeviceProperty
Prop_DisplayMCImageHeight_Int32 = 2039,
Prop_DisplayMCImageNumChannels_Int32 = 2040,
Prop_DisplayMCImageData_Binary = 2041,
- Prop_UsesDriverDirectMode_Bool = 2042,
+ Prop_SecondsFromPhotonsToVblank_Float = 2042,
// Properties that are unique to TrackedDeviceClass_Controller
Prop_AttachedDeviceId_String = 3000,
@@ -356,6 +347,11 @@ enum ETrackedDeviceProperty
// Properties that are unique to drivers
Prop_UserConfigPath_String = 6000,
Prop_InstallPath_String = 6001,
+ Prop_HasDisplayComponent_Bool = 6002,
+ Prop_HasControllerComponent_Bool = 6003,
+ Prop_HasCameraComponent_Bool = 6004,
+ Prop_HasDriverDirectModeComponent_Bool = 6005,
+ Prop_HasVirtualDisplayComponent_Bool = 6006,
// Vendors are free to expose private debug data in this reserved region
Prop_VendorSpecific_Reserved_Start = 10000,
@@ -561,6 +557,8 @@ enum EVREventType
VREvent_ApplicationListUpdated = 1303,
VREvent_ApplicationMimeTypeLoad = 1304,
VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,
+ VREvent_ProcessConnected = 1306,
+ VREvent_ProcessDisconnected = 1307,
VREvent_Compositor_MirrorWindowShown = 1400,
VREvent_Compositor_MirrorWindowHidden = 1401,
@@ -586,13 +584,17 @@ enum EVREventType
/** Level of Hmd activity */
+// UserInteraction_Timeout means the device is in the process of timing out.
+// InUse = ( k_EDeviceActivityLevel_UserInteraction || k_EDeviceActivityLevel_UserInteraction_Timeout )
+// VREvent_TrackedDeviceUserInteractionStarted fires when the devices transitions from Standby -> UserInteraction or Idle -> UserInteraction.
+// VREvent_TrackedDeviceUserInteractionEnded fires when the devices transitions from UserInteraction_Timeout -> Idle
enum EDeviceActivityLevel
-{
- k_EDeviceActivityLevel_Unknown = -1,
- k_EDeviceActivityLevel_Idle = 0,
- k_EDeviceActivityLevel_UserInteraction = 1,
- k_EDeviceActivityLevel_UserInteraction_Timeout = 2,
- k_EDeviceActivityLevel_Standby = 3,
+{
+ k_EDeviceActivityLevel_Unknown = -1,
+ k_EDeviceActivityLevel_Idle = 0, // No activity for the last 10 seconds
+ k_EDeviceActivityLevel_UserInteraction = 1, // Activity (movement or prox sensor) is happening now
+ k_EDeviceActivityLevel_UserInteraction_Timeout = 2, // No activity for the last 0.5 seconds
+ k_EDeviceActivityLevel_Standby = 3, // Idle for at least 5 seconds (configurable in Settings -> Power Management)
};
@@ -800,6 +802,13 @@ typedef union
VREvent_Property_t property;
} VREvent_Data_t;
+
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
/** An event posted by the server to all running applications */
struct VREvent_t
{
@@ -810,6 +819,9 @@ struct VREvent_t
VREvent_Data_t data;
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
/** 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.
@@ -858,6 +870,12 @@ struct VRControllerAxis_t
static const uint32_t k_unControllerStateAxisCount = 5;
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
/** Holds all the state of a controller at one moment in time. */
struct VRControllerState001_t
{
@@ -872,6 +890,9 @@ struct VRControllerState001_t
// Axis data for the controller's analog inputs
VRControllerAxis_t rAxis[ k_unControllerStateAxisCount ];
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
typedef VRControllerState001_t VRControllerState_t;
@@ -954,6 +975,7 @@ enum EVRApplicationType
// interfaces (like IVRSettings and IVRApplications) but not hardware.
VRApplication_VRMonitor = 5, // Reserved for vrmonitor
VRApplication_SteamWatchdog = 6,// Reserved for Steam
+ VRApplication_Bootstrapper = 7, // Start up SteamVR
VRApplication_Max
};
@@ -1728,7 +1750,6 @@ namespace vr
static const char * const k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
static const char * const k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
static const char * const k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
- static const char * const k_pch_SteamVR_EnableDistortion_Bool = "enableDistortion";
static const char * const k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
static const char * const k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
static const char * const k_pch_SteamVR_SendSystemButtonToAllApps_Bool= "sendSystemButtonToAllApps";
@@ -1889,16 +1910,7 @@ namespace vr
namespace vr
{
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
enum ChaperoneCalibrationState
{
@@ -2059,16 +2071,7 @@ static const char * const IVRChaperoneSetup_Version = "IVRChaperoneSetup_005";
namespace vr
{
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
/** Errors that can occur with the VR compositor */
enum EVRCompositorError
@@ -2344,16 +2347,7 @@ static const char * const IVRCompositor_Version = "IVRCompositor_020";
namespace vr
{
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
// Used for passing graphic data
struct NotificationBitmap_t
@@ -2613,7 +2607,7 @@ namespace vr
virtual EVROverlayError FindOverlay( const char *pchOverlayKey, VROverlayHandle_t * pOverlayHandle ) = 0;
/** Creates a new named overlay. All overlays start hidden and with default settings. */
- virtual EVROverlayError CreateOverlay( const char *pchOverlayKey, const char *pchOverlayFriendlyName, VROverlayHandle_t * pOverlayHandle ) = 0;
+ virtual EVROverlayError CreateOverlay( const char *pchOverlayKey, const char *pchOverlayName, VROverlayHandle_t * pOverlayHandle ) = 0;
/** Destroys the specified overlay. When an application calls VR_Shutdown all overlays created by that app are
* automatically destroyed. */
@@ -2638,6 +2632,9 @@ namespace vr
* the terminating null character. k_unVROverlayMaxNameLength will be enough bytes to fit the string. */
virtual uint32_t GetOverlayName( VROverlayHandle_t ulOverlayHandle, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, EVROverlayError *pError = 0L ) = 0;
+ /** set the name to use for this overlay */
+ virtual EVROverlayError SetOverlayName( VROverlayHandle_t ulOverlayHandle, const char *pchName ) = 0;
+
/** Gets the raw image data from an overlay. Overlay image data is always returned as RGBA data, 4 bytes per pixel. If the buffer is not large enough, width and height
* will be set and VROverlayError_ArrayTooSmall is returned. */
virtual EVROverlayError GetOverlayImageData( VROverlayHandle_t ulOverlayHandle, void *pvBuffer, uint32_t unBufferSize, uint32_t *punWidth, uint32_t *punHeight ) = 0;
@@ -2646,7 +2643,6 @@ namespace vr
* of the error enum value for all valid error codes */
virtual const char *GetOverlayErrorNameFromEnum( EVROverlayError error ) = 0;
-
// ---------------------------------------------
// Overlay rendering methods
// ---------------------------------------------
@@ -2723,6 +2719,13 @@ namespace vr
/** Gets the part of the texture to use for the overlay. UV Min is the upper left corner and UV Max is the lower right corner. */
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;
+
+ /** 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. */
+ virtual vr::EVROverlayError SetOverlayRenderModel( vr::VROverlayHandle_t ulOverlayHandle, const char *pchRenderModel, const HmdColor_t *pColor ) = 0;
+
/** Returns the transform type of this overlay. */
virtual EVROverlayError GetOverlayTransformType( VROverlayHandle_t ulOverlayHandle, VROverlayTransformType *peTransformType ) = 0;
@@ -2745,6 +2748,12 @@ namespace vr
/** 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;
+ /** 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;
+
+ /** Sets the transform to relative to the transform of the specified overlay. This overlays visibility will also track the parents visibility */
+ virtual vr::EVROverlayError SetOverlayTransformOverlayRelative( VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t ulOverlayHandleParent, const HmdMatrix34_t *pmatParentOverlayToOverlayTransform ) = 0;
+
/** Shows the VR overlay. For dashboard overlays, only the Dashboard Manager is allowed to call this. */
virtual EVROverlayError ShowOverlay( VROverlayHandle_t ulOverlayHandle ) = 0;
@@ -2915,7 +2924,7 @@ namespace vr
virtual VRMessageOverlayResponse ShowMessageOverlay( const char* pchText, const char* pchCaption, const char* pchButton0Text, const char* pchButton1Text = nullptr, const char* pchButton2Text = nullptr, const char* pchButton3Text = nullptr ) = 0;
};
- static const char * const IVROverlay_Version = "IVROverlay_014";
+ static const char * const IVROverlay_Version = "IVROverlay_016";
} // namespace vr
@@ -2929,16 +2938,7 @@ static const char * const k_pch_Controller_Component_Tip = "tip"; // F
static const char * const k_pch_Controller_Component_HandGrip = "handgrip"; // Neutral, ambidextrous hand-pose when holding controller. On plane between neutrally posed index finger and thumb
static const char * const k_pch_Controller_Component_Status = "status"; // 1:1 aspect ratio status area, with canonical [0,1] uv mapping
-#if defined(__linux__) || defined(__APPLE__)
-// The 32-bit version of gcc has the alignment requirement for uint64 and double set to
-// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
-// The 64-bit version of gcc has the alignment requirement for these types set to
-// 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
-// The 64-bit structure packing has to match the 32-bit structure packing for each platform.
-#pragma pack( push, 4 )
-#else
#pragma pack( push, 8 )
-#endif
/** Errors that can occur with the VR compositor */
enum EVRRenderModelError
@@ -2987,11 +2987,20 @@ struct RenderModel_Vertex_t
};
/** A texture map for use on a render model */
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
struct RenderModel_TextureMap_t
{
uint16_t unWidth, unHeight; // width and height of the texture map in pixels
const uint8_t *rubTextureMapData; // Map texture data. All textures are RGBA with 8 bits per channel per pixel. Data size is width * height * 4ub
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
/** Session unique texture identifier. Rendermodels which share the same texture will have the same id.
IDs <0 denote the texture is not present */
@@ -3000,6 +3009,12 @@ typedef int32_t TextureID_t;
const TextureID_t INVALID_TEXTURE_ID = -1;
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
struct RenderModel_t
{
const RenderModel_Vertex_t *rVertexData; // Vertex data for the mesh
@@ -3008,6 +3023,10 @@ struct RenderModel_t
uint32_t unTriangleCount; // Number of triangles in the mesh. Index count is 3 * TriangleCount
TextureID_t diffuseTextureId; // Session unique texture identifier. Rendermodels which share the same texture will have the same id. <0 == texture not present
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
+
struct RenderModel_ControllerMode_State_t
{
@@ -3244,7 +3263,7 @@ public:
* once SubmitScreenshot() is called.
* If Steam is not running, the paths will be in the user's
* documents folder under Documents\SteamVR\Screenshots.
- * Other VR applications can call this to initate a
+ * Other VR applications can call this to initiate a
* screenshot outside of user control.
* The destination file names do not need an extension,
* will be replaced with the correct one for the format
@@ -3282,7 +3301,7 @@ public:
* submitted scene textures of the running application and
* write them into the preview image and a side-by-side file
* for the VR image.
- * This is similiar to request screenshot, but doesn't ever
+ * This is similar to request screenshot, but doesn't ever
* talk to the application, just takes the shot and submits. */
virtual vr::EVRScreenshotError TakeStereoScreenshot( vr::ScreenshotHandle_t *pOutScreenshotHandle, const char *pchPreviewFilename, const char *pchVRFilename ) = 0;
@@ -3293,8 +3312,7 @@ public:
* function will display a notification to the user that the
* screenshot was taken. The paths should be full paths with
* extensions.
- * File paths should be absolute including
- * exntensions.
+ * File paths should be absolute including extensions.
* screenshotHandle can be k_unScreenshotHandleInvalid if this
* was a new shot taking by the app to be saved and not
* initiated by a user (achievement earned or something) */
@@ -3367,7 +3385,7 @@ namespace vr
/** Returns the name of the enum value for an EVRInitError. This function may be called outside of VR_Init()/VR_Shutdown(). */
VR_INTERFACE const char *VR_CALLTYPE VR_GetVRInitErrorAsSymbol( EVRInitError error );
- /** Returns an english string for an EVRInitError. Applications should call VR_GetVRInitErrorAsSymbol instead and
+ /** Returns an English string for an EVRInitError. Applications should call VR_GetVRInitErrorAsSymbol instead and
* use that as a key to look up their own localized error message. This function may be called outside of VR_Init()/VR_Shutdown(). */
VR_INTERFACE const char *VR_CALLTYPE VR_GetVRInitErrorAsEnglishDescription( EVRInitError error );
diff --git a/headers/openvr_api.cs b/headers/openvr_api.cs
index 33bfd25..377d91a 100644
--- a/headers/openvr_api.cs
+++ b/headers/openvr_api.cs
@@ -851,7 +851,7 @@ public struct IVROverlay
internal _FindOverlay FindOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- internal delegate EVROverlayError _CreateOverlay(string pchOverlayKey, string pchOverlayFriendlyName, ref ulong pOverlayHandle);
+ internal delegate EVROverlayError _CreateOverlay(string pchOverlayKey, string pchOverlayName, ref ulong pOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateOverlay CreateOverlay;
@@ -881,6 +881,11 @@ public struct IVROverlay
internal _GetOverlayName GetOverlayName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate EVROverlayError _SetOverlayName(ulong ulOverlayHandle, string pchName);
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ internal _SetOverlayName SetOverlayName;
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayImageData GetOverlayImageData;
@@ -991,6 +996,16 @@ 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);
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ internal _GetOverlayRenderModel GetOverlayRenderModel;
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate EVROverlayError _SetOverlayRenderModel(ulong ulOverlayHandle, string pchRenderModel, ref HmdColor_t pColor);
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ internal _SetOverlayRenderModel SetOverlayRenderModel;
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformType GetOverlayTransformType;
@@ -1026,6 +1041,16 @@ public struct IVROverlay
internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative;
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative;
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowOverlay ShowOverlay;
@@ -1603,8 +1628,32 @@ public class CVRSystem
IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
return Marshal.PtrToStringAnsi(result);
}
+// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
+// originally mis-compiled with the wrong packing for Linux and OSX.
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate bool _PollNextEventPacked(ref VREvent_t_Packed pEvent,uint uncbVREvent);
+ [StructLayout(LayoutKind.Explicit)]
+ struct PollNextEventUnion
+ {
+ [FieldOffset(0)]
+ public IVRSystem._PollNextEvent pPollNextEvent;
+ [FieldOffset(0)]
+ public _PollNextEventPacked pPollNextEventPacked;
+ }
public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
{
+ if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
+ (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
+ {
+ PollNextEventUnion u;
+ VREvent_t_Packed event_packed = new VREvent_t_Packed();
+ u.pPollNextEventPacked = null;
+ u.pPollNextEvent = FnTable.PollNextEvent;
+ bool packed_result = u.pPollNextEventPacked(ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
+
+ event_packed.Unpack(ref pEvent);
+ return packed_result;
+ }
bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
return result;
}
@@ -1623,7 +1672,7 @@ public class CVRSystem
HiddenAreaMesh_t result = FnTable.GetHiddenAreaMesh(eEye,type);
return result;
}
-// This is a terrible hack to workaround the fact that VRControllerState_t was
+// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerStatePacked(uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize);
@@ -1641,7 +1690,7 @@ public class CVRSystem
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
GetControllerStateUnion u;
- VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
+ VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
u.pGetControllerStatePacked = null;
u.pGetControllerState = FnTable.GetControllerState;
bool packed_result = u.pGetControllerStatePacked(unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)));
@@ -1652,7 +1701,7 @@ public class CVRSystem
bool result = FnTable.GetControllerState(unControllerDeviceIndex,ref pControllerState,unControllerStateSize);
return result;
}
-// This is a terrible hack to workaround the fact that VRControllerState_t was
+// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerStateWithPosePacked(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose);
@@ -1670,7 +1719,7 @@ public class CVRSystem
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
GetControllerStateWithPoseUnion u;
- VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
+ VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
u.pGetControllerStateWithPosePacked = null;
u.pGetControllerStateWithPose = FnTable.GetControllerStateWithPose;
bool packed_result = u.pGetControllerStateWithPosePacked(eOrigin,unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)),ref pTrackedDevicePose);
@@ -2381,10 +2430,10 @@ public class CVROverlay
EVROverlayError result = FnTable.FindOverlay(pchOverlayKey,ref pOverlayHandle);
return result;
}
- public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayFriendlyName,ref ulong pOverlayHandle)
+ public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayName,ref ulong pOverlayHandle)
{
pOverlayHandle = 0;
- EVROverlayError result = FnTable.CreateOverlay(pchOverlayKey,pchOverlayFriendlyName,ref pOverlayHandle);
+ EVROverlayError result = FnTable.CreateOverlay(pchOverlayKey,pchOverlayName,ref pOverlayHandle);
return result;
}
public EVROverlayError DestroyOverlay(ulong ulOverlayHandle)
@@ -2412,6 +2461,11 @@ public class CVROverlay
uint result = FnTable.GetOverlayName(ulOverlayHandle,pchValue,unBufferSize,ref pError);
return result;
}
+ public EVROverlayError SetOverlayName(ulong ulOverlayHandle,string pchName)
+ {
+ EVROverlayError result = FnTable.SetOverlayName(ulOverlayHandle,pchName);
+ return result;
+ }
public EVROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight)
{
punWidth = 0;
@@ -2534,6 +2588,16 @@ public class CVROverlay
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)
+ {
+ uint result = FnTable.GetOverlayRenderModel(ulOverlayHandle,pchValue,unBufferSize,ref pColor,ref pError);
+ return result;
+ }
+ public EVROverlayError SetOverlayRenderModel(ulong ulOverlayHandle,string pchRenderModel,ref HmdColor_t pColor)
+ {
+ EVROverlayError result = FnTable.SetOverlayRenderModel(ulOverlayHandle,pchRenderModel,ref pColor);
+ return result;
+ }
public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
{
EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
@@ -2571,6 +2635,17 @@ public class CVROverlay
EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize);
return result;
}
+ public EVROverlayError GetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ref ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
+ {
+ ulOverlayHandleParent = 0;
+ EVROverlayError result = FnTable.GetOverlayTransformOverlayRelative(ulOverlayHandle,ref ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
+ return result;
+ }
+ public EVROverlayError SetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
+ {
+ EVROverlayError result = FnTable.SetOverlayTransformOverlayRelative(ulOverlayHandle,ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
+ return result;
+ }
public EVROverlayError ShowOverlay(ulong ulOverlayHandle)
{
EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle);
@@ -2591,8 +2666,32 @@ public class CVROverlay
EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
return result;
}
+// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
+// originally mis-compiled with the wrong packing for Linux and OSX.
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate bool _PollNextOverlayEventPacked(ulong ulOverlayHandle,ref VREvent_t_Packed pEvent,uint uncbVREvent);
+ [StructLayout(LayoutKind.Explicit)]
+ struct PollNextOverlayEventUnion
+ {
+ [FieldOffset(0)]
+ public IVROverlay._PollNextOverlayEvent pPollNextOverlayEvent;
+ [FieldOffset(0)]
+ public _PollNextOverlayEventPacked pPollNextOverlayEventPacked;
+ }
public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
{
+ if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
+ (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
+ {
+ PollNextOverlayEventUnion u;
+ VREvent_t_Packed event_packed = new VREvent_t_Packed();
+ u.pPollNextOverlayEventPacked = null;
+ u.pPollNextOverlayEvent = FnTable.PollNextOverlayEvent;
+ bool packed_result = u.pPollNextOverlayEventPacked(ulOverlayHandle,ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
+
+ event_packed.Unpack(ref pEvent);
+ return packed_result;
+ }
bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
return result;
}
@@ -2843,7 +2942,7 @@ public class CVRRenderModels
uint result = FnTable.GetComponentRenderModelName(pchRenderModelName,pchComponentName,pchComponentRenderModelName,unComponentRenderModelNameLen);
return result;
}
-// This is a terrible hack to workaround the fact that VRControllerState_t was
+// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetComponentStatePacked(string pchRenderModelName,string pchComponentName,ref VRControllerState_t_Packed pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState);
@@ -2861,7 +2960,7 @@ public class CVRRenderModels
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
GetComponentStateUnion u;
- VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
+ VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
u.pGetComponentStatePacked = null;
u.pGetComponentState = FnTable.GetComponentState;
bool packed_result = u.pGetComponentStatePacked(pchRenderModelName,pchComponentName,ref state_packed,ref pState,ref pComponentState);
@@ -3101,6 +3200,7 @@ public enum ETrackedDeviceClass
Controller = 2,
GenericTracker = 3,
TrackingReference = 4,
+ DisplayRedirect = 5,
}
public enum ETrackedControllerRole
{
@@ -3152,6 +3252,7 @@ public enum ETrackedDeviceProperty
Prop_Firmware_ForceUpdateRequired_Bool = 1032,
Prop_ViveSystemButtonFixRequired_Bool = 1033,
Prop_ParentDriver_Uint64 = 1034,
+ Prop_ResourceRoot_String = 1035,
Prop_ReportsTimeSinceVSync_Bool = 2000,
Prop_SecondsFromVsyncToPhotons_Float = 2001,
Prop_DisplayFrequency_Float = 2002,
@@ -3194,7 +3295,7 @@ public enum ETrackedDeviceProperty
Prop_DisplayMCImageHeight_Int32 = 2039,
Prop_DisplayMCImageNumChannels_Int32 = 2040,
Prop_DisplayMCImageData_Binary = 2041,
- Prop_UsesDriverDirectMode_Bool = 2042,
+ Prop_SecondsFromPhotonsToVblank_Float = 2042,
Prop_AttachedDeviceId_String = 3000,
Prop_SupportedButtons_Uint64 = 3001,
Prop_Axis0Type_Int32 = 3002,
@@ -3223,6 +3324,11 @@ public enum ETrackedDeviceProperty
Prop_DisplayHiddenArea_Binary_End = 5150,
Prop_UserConfigPath_String = 6000,
Prop_InstallPath_String = 6001,
+ Prop_HasDisplayComponent_Bool = 6002,
+ Prop_HasControllerComponent_Bool = 6003,
+ Prop_HasCameraComponent_Bool = 6004,
+ Prop_HasDriverDirectModeComponent_Bool = 6005,
+ Prop_HasVirtualDisplayComponent_Bool = 6006,
Prop_VendorSpecific_Reserved_Start = 10000,
Prop_VendorSpecific_Reserved_End = 10999,
}
@@ -3356,6 +3462,8 @@ public enum EVREventType
VREvent_ApplicationListUpdated = 1303,
VREvent_ApplicationMimeTypeLoad = 1304,
VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,
+ VREvent_ProcessConnected = 1306,
+ VREvent_ProcessDisconnected = 1307,
VREvent_Compositor_MirrorWindowShown = 1400,
VREvent_Compositor_MirrorWindowHidden = 1401,
VREvent_Compositor_ChaperoneBoundsShown = 1410,
@@ -3468,7 +3576,8 @@ public enum EVRApplicationType
VRApplication_Utility = 4,
VRApplication_VRMonitor = 5,
VRApplication_SteamWatchdog = 6,
- VRApplication_Max = 7,
+ VRApplication_Bootstrapper = 7,
+ VRApplication_Max = 8,
}
public enum EVRFirmwareError
{
@@ -4087,6 +4196,28 @@ public enum EVRScreenshotError
public float eventAgeSeconds;
public VREvent_Data_t data;
}
+// This structure is for backwards binary compatibility on Linux and OSX only
+[StructLayout(LayoutKind.Sequential, Pack = 4)] public struct VREvent_t_Packed
+{
+ public uint eventType;
+ public uint trackedDeviceIndex;
+ public float eventAgeSeconds;
+ public VREvent_Data_t data;
+ public VREvent_t_Packed(VREvent_t unpacked)
+ {
+ this.eventType = unpacked.eventType;
+ this.trackedDeviceIndex = unpacked.trackedDeviceIndex;
+ this.eventAgeSeconds = unpacked.eventAgeSeconds;
+ this.data = unpacked.data;
+ }
+ public void Unpack(ref VREvent_t unpacked)
+ {
+ unpacked.eventType = this.eventType;
+ unpacked.trackedDeviceIndex = this.trackedDeviceIndex;
+ unpacked.eventAgeSeconds = this.eventAgeSeconds;
+ unpacked.data = this.data;
+ }
+}
[StructLayout(LayoutKind.Sequential)] public struct HiddenAreaMesh_t
{
public IntPtr pVertexData; // const struct vr::HmdVector2_t *
@@ -4119,6 +4250,17 @@ public enum EVRScreenshotError
public VRControllerAxis_t rAxis2;
public VRControllerAxis_t rAxis3;
public VRControllerAxis_t rAxis4;
+ public VRControllerState_t_Packed(VRControllerState_t unpacked)
+ {
+ this.unPacketNum = unpacked.unPacketNum;
+ this.ulButtonPressed = unpacked.ulButtonPressed;
+ this.ulButtonTouched = unpacked.ulButtonTouched;
+ this.rAxis0 = unpacked.rAxis0;
+ this.rAxis1 = unpacked.rAxis1;
+ this.rAxis2 = unpacked.rAxis2;
+ this.rAxis3 = unpacked.rAxis3;
+ this.rAxis4 = unpacked.rAxis4;
+ }
public void Unpack(ref VRControllerState_t unpacked)
{
unpacked.unPacketNum = this.unPacketNum;
@@ -4265,6 +4407,12 @@ public enum EVRScreenshotError
public char unWidth;
public char unHeight;
public IntPtr rubTextureMapData; // const uint8_t *
+ public RenderModel_TextureMap_t_Packed(RenderModel_TextureMap_t unpacked)
+ {
+ this.unWidth = unpacked.unWidth;
+ this.unHeight = unpacked.unHeight;
+ this.rubTextureMapData = unpacked.rubTextureMapData;
+ }
public void Unpack(ref RenderModel_TextureMap_t unpacked)
{
unpacked.unWidth = this.unWidth;
@@ -4288,6 +4436,14 @@ public enum EVRScreenshotError
public IntPtr rIndexData; // const uint16_t *
public uint unTriangleCount;
public int diffuseTextureId;
+ public RenderModel_t_Packed(RenderModel_t unpacked)
+ {
+ this.rVertexData = unpacked.rVertexData;
+ this.unVertexCount = unpacked.unVertexCount;
+ this.rIndexData = unpacked.rIndexData;
+ this.unTriangleCount = unpacked.unTriangleCount;
+ this.diffuseTextureId = unpacked.diffuseTextureId;
+ }
public void Unpack(ref RenderModel_t unpacked)
{
unpacked.rVertexData = this.rVertexData;
@@ -4405,7 +4561,7 @@ public class OpenVR
public const uint k_unVROverlayMaxNameLength = 128;
public const uint k_unMaxOverlayCount = 64;
public const uint k_unMaxOverlayIntersectionMaskPrimitivesCount = 32;
- public const string IVROverlay_Version = "IVROverlay_014";
+ public const string IVROverlay_Version = "IVROverlay_016";
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";
@@ -4422,7 +4578,6 @@ public class OpenVR
public const string k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
public const string k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
public const string k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
- public const string k_pch_SteamVR_EnableDistortion_Bool = "enableDistortion";
public const string k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
public const string k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
public const string k_pch_SteamVR_SendSystemButtonToAllApps_Bool = "sendSystemButtonToAllApps";
diff --git a/headers/openvr_api.json b/headers/openvr_api.json
index 688e137..43c3bf9 100644
--- a/headers/openvr_api.json
+++ b/headers/openvr_api.json
@@ -60,6 +60,7 @@
,{"name": "TrackedDeviceClass_Controller","value": "2"}
,{"name": "TrackedDeviceClass_GenericTracker","value": "3"}
,{"name": "TrackedDeviceClass_TrackingReference","value": "4"}
+ ,{"name": "TrackedDeviceClass_DisplayRedirect","value": "5"}
]}
, {"enumname": "vr::ETrackedControllerRole","values": [
{"name": "TrackedControllerRole_Invalid","value": "0"}
@@ -108,6 +109,7 @@
,{"name": "Prop_Firmware_ForceUpdateRequired_Bool","value": "1032"}
,{"name": "Prop_ViveSystemButtonFixRequired_Bool","value": "1033"}
,{"name": "Prop_ParentDriver_Uint64","value": "1034"}
+ ,{"name": "Prop_ResourceRoot_String","value": "1035"}
,{"name": "Prop_ReportsTimeSinceVSync_Bool","value": "2000"}
,{"name": "Prop_SecondsFromVsyncToPhotons_Float","value": "2001"}
,{"name": "Prop_DisplayFrequency_Float","value": "2002"}
@@ -150,7 +152,7 @@
,{"name": "Prop_DisplayMCImageHeight_Int32","value": "2039"}
,{"name": "Prop_DisplayMCImageNumChannels_Int32","value": "2040"}
,{"name": "Prop_DisplayMCImageData_Binary","value": "2041"}
- ,{"name": "Prop_UsesDriverDirectMode_Bool","value": "2042"}
+ ,{"name": "Prop_SecondsFromPhotonsToVblank_Float","value": "2042"}
,{"name": "Prop_AttachedDeviceId_String","value": "3000"}
,{"name": "Prop_SupportedButtons_Uint64","value": "3001"}
,{"name": "Prop_Axis0Type_Int32","value": "3002"}
@@ -179,6 +181,11 @@
,{"name": "Prop_DisplayHiddenArea_Binary_End","value": "5150"}
,{"name": "Prop_UserConfigPath_String","value": "6000"}
,{"name": "Prop_InstallPath_String","value": "6001"}
+ ,{"name": "Prop_HasDisplayComponent_Bool","value": "6002"}
+ ,{"name": "Prop_HasControllerComponent_Bool","value": "6003"}
+ ,{"name": "Prop_HasCameraComponent_Bool","value": "6004"}
+ ,{"name": "Prop_HasDriverDirectModeComponent_Bool","value": "6005"}
+ ,{"name": "Prop_HasVirtualDisplayComponent_Bool","value": "6006"}
,{"name": "Prop_VendorSpecific_Reserved_Start","value": "10000"}
,{"name": "Prop_VendorSpecific_Reserved_End","value": "10999"}
]}
@@ -308,6 +315,8 @@
,{"name": "VREvent_ApplicationListUpdated","value": "1303"}
,{"name": "VREvent_ApplicationMimeTypeLoad","value": "1304"}
,{"name": "VREvent_ApplicationTransitionNewAppLaunchComplete","value": "1305"}
+ ,{"name": "VREvent_ProcessConnected","value": "1306"}
+ ,{"name": "VREvent_ProcessDisconnected","value": "1307"}
,{"name": "VREvent_Compositor_MirrorWindowShown","value": "1400"}
,{"name": "VREvent_Compositor_MirrorWindowHidden","value": "1401"}
,{"name": "VREvent_Compositor_ChaperoneBoundsShown","value": "1410"}
@@ -411,7 +420,8 @@
,{"name": "VRApplication_Utility","value": "4"}
,{"name": "VRApplication_VRMonitor","value": "5"}
,{"name": "VRApplication_SteamWatchdog","value": "6"}
- ,{"name": "VRApplication_Max","value": "7"}
+ ,{"name": "VRApplication_Bootstrapper","value": "7"}
+ ,{"name": "VRApplication_Max","value": "8"}
]}
, {"enumname": "vr::EVRFirmwareError","values": [
{"name": "VRFirmwareError_None","value": "0"}
@@ -802,7 +812,7 @@
,{
"constname": "k_unMaxOverlayIntersectionMaskPrimitivesCount","consttype": "const uint32_t", "constval": "32"}
,{
- "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_014"}
+ "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_016"}
,{
"constname": "k_pch_Controller_Component_GDC2015","consttype": "const char *const", "constval": "gdc2015"}
,{
@@ -836,8 +846,6 @@
,{
"constname": "k_pch_SteamVR_DebugProcessPipe_String","consttype": "const char *const", "constval": "debugProcessPipe"}
,{
- "constname": "k_pch_SteamVR_EnableDistortion_Bool","consttype": "const char *const", "constval": "enableDistortion"}
-,{
"constname": "k_pch_SteamVR_DisplayDebugX_Int32","consttype": "const char *const", "constval": "displayDebugX"}
,{
"constname": "k_pch_SteamVR_DisplayDebugY_Int32","consttype": "const char *const", "constval": "displayDebugY"}
@@ -2697,7 +2705,7 @@
"returntype": "vr::EVROverlayError",
"params": [
{ "paramname": "pchOverlayKey" ,"paramtype": "const char *"},
-{ "paramname": "pchOverlayFriendlyName" ,"paramtype": "const char *"},
+{ "paramname": "pchOverlayName" ,"paramtype": "const char *"},
{ "paramname": "pOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t *"}
]
}
@@ -2746,6 +2754,15 @@
}
,{
"classname": "vr::IVROverlay",
+ "methodname": "SetOverlayName",
+ "returntype": "vr::EVROverlayError",
+ "params": [
+{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "pchName" ,"paramtype": "const char *"}
+ ]
+}
+,{
+ "classname": "vr::IVROverlay",
"methodname": "GetOverlayImageData",
"returntype": "vr::EVROverlayError",
"params": [
@@ -2953,6 +2970,28 @@
}
,{
"classname": "vr::IVROverlay",
+ "methodname": "GetOverlayRenderModel",
+ "returntype": "uint32_t",
+ "params": [
+{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "pchValue" ,"paramtype": "char *"},
+{ "paramname": "unBufferSize" ,"paramtype": "uint32_t"},
+{ "paramname": "pColor" ,"paramtype": "struct vr::HmdColor_t *"},
+{ "paramname": "pError" ,"paramtype": "vr::EVROverlayError *"}
+ ]
+}
+,{
+ "classname": "vr::IVROverlay",
+ "methodname": "SetOverlayRenderModel",
+ "returntype": "vr::EVROverlayError",
+ "params": [
+{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "pchRenderModel" ,"paramtype": "const char *"},
+{ "paramname": "pColor" ,"paramtype": "const struct vr::HmdColor_t *"}
+ ]
+}
+,{
+ "classname": "vr::IVROverlay",
"methodname": "GetOverlayTransformType",
"returntype": "vr::EVROverlayError",
"params": [
@@ -3023,6 +3062,26 @@
}
,{
"classname": "vr::IVROverlay",
+ "methodname": "GetOverlayTransformOverlayRelative",
+ "returntype": "vr::EVROverlayError",
+ "params": [
+{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "ulOverlayHandleParent" ,"paramtype": "vr::VROverlayHandle_t *"},
+{ "paramname": "pmatParentOverlayToOverlayTransform" ,"paramtype": "struct vr::HmdMatrix34_t *"}
+ ]
+}
+,{
+ "classname": "vr::IVROverlay",
+ "methodname": "SetOverlayTransformOverlayRelative",
+ "returntype": "vr::EVROverlayError",
+ "params": [
+{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "ulOverlayHandleParent" ,"paramtype": "vr::VROverlayHandle_t"},
+{ "paramname": "pmatParentOverlayToOverlayTransform" ,"paramtype": "const struct vr::HmdMatrix34_t *"}
+ ]
+}
+,{
+ "classname": "vr::IVROverlay",
"methodname": "ShowOverlay",
"returntype": "vr::EVROverlayError",
"params": [
diff --git a/headers/openvr_capi.h b/headers/openvr_capi.h
index a7ab2cf..f895668 100644
--- a/headers/openvr_capi.h
+++ b/headers/openvr_capi.h
@@ -17,7 +17,11 @@
#define EXTERN_C
#endif
+#if defined( _WIN32 )
#define OPENVR_FNTABLE_CALLTYPE __stdcall
+#else
+#define OPENVR_FNTABLE_CALLTYPE
+#endif
// OPENVR API export macro
#if defined( _WIN32 ) && !defined( _X360 )
@@ -93,7 +97,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_014";
+static const char * IVROverlay_Version = "IVROverlay_016";
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";
@@ -110,7 +114,6 @@ static const char * k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver";
static const char * k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
static const char * k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
static const char * k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
-static const char * k_pch_SteamVR_EnableDistortion_Bool = "enableDistortion";
static const char * k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
static const char * k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
static const char * k_pch_SteamVR_SendSystemButtonToAllApps_Bool = "sendSystemButtonToAllApps";
@@ -268,6 +271,7 @@ typedef enum ETrackedDeviceClass
ETrackedDeviceClass_TrackedDeviceClass_Controller = 2,
ETrackedDeviceClass_TrackedDeviceClass_GenericTracker = 3,
ETrackedDeviceClass_TrackedDeviceClass_TrackingReference = 4,
+ ETrackedDeviceClass_TrackedDeviceClass_DisplayRedirect = 5,
} ETrackedDeviceClass;
typedef enum ETrackedControllerRole
@@ -322,6 +326,7 @@ typedef enum ETrackedDeviceProperty
ETrackedDeviceProperty_Prop_Firmware_ForceUpdateRequired_Bool = 1032,
ETrackedDeviceProperty_Prop_ViveSystemButtonFixRequired_Bool = 1033,
ETrackedDeviceProperty_Prop_ParentDriver_Uint64 = 1034,
+ ETrackedDeviceProperty_Prop_ResourceRoot_String = 1035,
ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000,
ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001,
ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002,
@@ -364,7 +369,7 @@ typedef enum ETrackedDeviceProperty
ETrackedDeviceProperty_Prop_DisplayMCImageHeight_Int32 = 2039,
ETrackedDeviceProperty_Prop_DisplayMCImageNumChannels_Int32 = 2040,
ETrackedDeviceProperty_Prop_DisplayMCImageData_Binary = 2041,
- ETrackedDeviceProperty_Prop_UsesDriverDirectMode_Bool = 2042,
+ ETrackedDeviceProperty_Prop_SecondsFromPhotonsToVblank_Float = 2042,
ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000,
ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001,
ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002,
@@ -393,6 +398,11 @@ typedef enum ETrackedDeviceProperty
ETrackedDeviceProperty_Prop_DisplayHiddenArea_Binary_End = 5150,
ETrackedDeviceProperty_Prop_UserConfigPath_String = 6000,
ETrackedDeviceProperty_Prop_InstallPath_String = 6001,
+ ETrackedDeviceProperty_Prop_HasDisplayComponent_Bool = 6002,
+ ETrackedDeviceProperty_Prop_HasControllerComponent_Bool = 6003,
+ ETrackedDeviceProperty_Prop_HasCameraComponent_Bool = 6004,
+ ETrackedDeviceProperty_Prop_HasDriverDirectModeComponent_Bool = 6005,
+ ETrackedDeviceProperty_Prop_HasVirtualDisplayComponent_Bool = 6006,
ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000,
ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999,
} ETrackedDeviceProperty;
@@ -530,6 +540,8 @@ typedef enum EVREventType
EVREventType_VREvent_ApplicationListUpdated = 1303,
EVREventType_VREvent_ApplicationMimeTypeLoad = 1304,
EVREventType_VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,
+ EVREventType_VREvent_ProcessConnected = 1306,
+ EVREventType_VREvent_ProcessDisconnected = 1307,
EVREventType_VREvent_Compositor_MirrorWindowShown = 1400,
EVREventType_VREvent_Compositor_MirrorWindowHidden = 1401,
EVREventType_VREvent_Compositor_ChaperoneBoundsShown = 1410,
@@ -651,7 +663,8 @@ typedef enum EVRApplicationType
EVRApplicationType_VRApplication_Utility = 4,
EVRApplicationType_VRApplication_VRMonitor = 5,
EVRApplicationType_VRApplication_SteamWatchdog = 6,
- EVRApplicationType_VRApplication_Max = 7,
+ EVRApplicationType_VRApplication_Bootstrapper = 7,
+ EVRApplicationType_VRApplication_Max = 8,
} EVRApplicationType;
typedef enum EVRFirmwareError
@@ -1435,6 +1448,9 @@ typedef struct RenderModel_Vertex_t
float rfTextureCoord[2]; //float[2]
} RenderModel_Vertex_t;
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( push, 4 )
+#endif
typedef struct RenderModel_TextureMap_t
{
uint16_t unWidth;
@@ -1442,6 +1458,12 @@ typedef struct RenderModel_TextureMap_t
uint8_t * rubTextureMapData; // const uint8_t *
} RenderModel_TextureMap_t;
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( push, 4 )
+#endif
typedef struct RenderModel_t
{
struct RenderModel_Vertex_t * rVertexData; // const struct vr::RenderModel_Vertex_t *
@@ -1451,6 +1473,9 @@ typedef struct RenderModel_t
TextureID_t diffuseTextureId;
} RenderModel_t;
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
typedef struct RenderModel_ControllerMode_State_t
{
bool bScrollWheelVisible;
@@ -1715,12 +1740,13 @@ struct VR_IVRCompositor_FnTable
struct VR_IVROverlay_FnTable
{
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *FindOverlay)(char * pchOverlayKey, VROverlayHandle_t * pOverlayHandle);
- EVROverlayError (OPENVR_FNTABLE_CALLTYPE *CreateOverlay)(char * pchOverlayKey, char * pchOverlayFriendlyName, VROverlayHandle_t * pOverlayHandle);
+ EVROverlayError (OPENVR_FNTABLE_CALLTYPE *CreateOverlay)(char * pchOverlayKey, char * pchOverlayName, VROverlayHandle_t * pOverlayHandle);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *DestroyOverlay)(VROverlayHandle_t ulOverlayHandle);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetHighQualityOverlay)(VROverlayHandle_t ulOverlayHandle);
VROverlayHandle_t (OPENVR_FNTABLE_CALLTYPE *GetHighQualityOverlay)();
uint32_t (OPENVR_FNTABLE_CALLTYPE *GetOverlayKey)(VROverlayHandle_t ulOverlayHandle, char * pchValue, uint32_t unBufferSize, EVROverlayError * pError);
uint32_t (OPENVR_FNTABLE_CALLTYPE *GetOverlayName)(VROverlayHandle_t ulOverlayHandle, char * pchValue, uint32_t unBufferSize, EVROverlayError * pError);
+ EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayName)(VROverlayHandle_t ulOverlayHandle, char * pchName);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayImageData)(VROverlayHandle_t ulOverlayHandle, void * pvBuffer, uint32_t unBufferSize, uint32_t * punWidth, uint32_t * punHeight);
char * (OPENVR_FNTABLE_CALLTYPE *GetOverlayErrorNameFromEnum)(EVROverlayError error);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayRenderingPid)(VROverlayHandle_t ulOverlayHandle, uint32_t unPID);
@@ -1743,6 +1769,8 @@ struct VR_IVROverlay_FnTable
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTextureColorSpace)(VROverlayHandle_t ulOverlayHandle, EColorSpace * peTextureColorSpace);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTextureBounds)(VROverlayHandle_t ulOverlayHandle, struct VRTextureBounds_t * pOverlayTextureBounds);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTextureBounds)(VROverlayHandle_t ulOverlayHandle, struct VRTextureBounds_t * pOverlayTextureBounds);
+ uint32_t (OPENVR_FNTABLE_CALLTYPE *GetOverlayRenderModel)(VROverlayHandle_t ulOverlayHandle, char * pchValue, uint32_t unBufferSize, struct HmdColor_t * pColor, EVROverlayError * pError);
+ EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayRenderModel)(VROverlayHandle_t ulOverlayHandle, char * pchRenderModel, struct HmdColor_t * pColor);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformType)(VROverlayHandle_t ulOverlayHandle, VROverlayTransformType * peTransformType);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformAbsolute)(VROverlayHandle_t ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, struct HmdMatrix34_t * pmatTrackingOriginToOverlayTransform);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformAbsolute)(VROverlayHandle_t ulOverlayHandle, ETrackingUniverseOrigin * peTrackingOrigin, struct HmdMatrix34_t * pmatTrackingOriginToOverlayTransform);
@@ -1750,6 +1778,8 @@ struct VR_IVROverlay_FnTable
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformTrackedDeviceRelative)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t * punTrackedDevice, struct HmdMatrix34_t * pmatTrackedDeviceToOverlayTransform);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformTrackedDeviceComponent)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t unDeviceIndex, char * pchComponentName);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformTrackedDeviceComponent)(VROverlayHandle_t ulOverlayHandle, TrackedDeviceIndex_t * punDeviceIndex, char * pchComponentName, uint32_t unComponentNameSize);
+ EVROverlayError (OPENVR_FNTABLE_CALLTYPE *GetOverlayTransformOverlayRelative)(VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t * ulOverlayHandleParent, struct HmdMatrix34_t * pmatParentOverlayToOverlayTransform);
+ EVROverlayError (OPENVR_FNTABLE_CALLTYPE *SetOverlayTransformOverlayRelative)(VROverlayHandle_t ulOverlayHandle, VROverlayHandle_t ulOverlayHandleParent, struct HmdMatrix34_t * pmatParentOverlayToOverlayTransform);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *ShowOverlay)(VROverlayHandle_t ulOverlayHandle);
EVROverlayError (OPENVR_FNTABLE_CALLTYPE *HideOverlay)(VROverlayHandle_t ulOverlayHandle);
bool (OPENVR_FNTABLE_CALLTYPE *IsOverlayVisible)(VROverlayHandle_t ulOverlayHandle);
diff --git a/headers/openvr_driver.h b/headers/openvr_driver.h
index 455f8e8..e0732a0 100644
--- a/headers/openvr_driver.h
+++ b/headers/openvr_driver.h
@@ -27,17 +27,7 @@ struct ID3D12CommandQueue;
namespace vr
{
-
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
typedef void* glSharedTextureHandle_t;
typedef int32_t glInt_t;
@@ -120,7 +110,7 @@ enum ETextureType
TextureType_DirectX = 0, // Handle is an ID3D11Texture
TextureType_OpenGL = 1, // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags
TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure
- TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurface
+ TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef
TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure
};
@@ -170,6 +160,7 @@ enum ETrackedDeviceClass
TrackedDeviceClass_Controller = 2, // Tracked controllers
TrackedDeviceClass_GenericTracker = 3, // Generic trackers, similar to controllers
TrackedDeviceClass_TrackingReference = 4, // Camera and base stations that serve as tracking reference points
+ TrackedDeviceClass_DisplayRedirect = 5, // Accessories that aren't necessarily tracked themselves, but may redirect video output from other tracked devices
};
@@ -272,7 +263,7 @@ enum ETrackedDeviceProperty
Prop_Firmware_ForceUpdateRequired_Bool = 1032,
Prop_ViveSystemButtonFixRequired_Bool = 1033,
Prop_ParentDriver_Uint64 = 1034,
-
+ Prop_ResourceRoot_String = 1035,
// Properties that are unique to TrackedDeviceClass_HMD
Prop_ReportsTimeSinceVSync_Bool = 2000,
@@ -317,7 +308,7 @@ enum ETrackedDeviceProperty
Prop_DisplayMCImageHeight_Int32 = 2039,
Prop_DisplayMCImageNumChannels_Int32 = 2040,
Prop_DisplayMCImageData_Binary = 2041,
- Prop_UsesDriverDirectMode_Bool = 2042,
+ Prop_SecondsFromPhotonsToVblank_Float = 2042,
// Properties that are unique to TrackedDeviceClass_Controller
Prop_AttachedDeviceId_String = 3000,
@@ -356,6 +347,11 @@ enum ETrackedDeviceProperty
// Properties that are unique to drivers
Prop_UserConfigPath_String = 6000,
Prop_InstallPath_String = 6001,
+ Prop_HasDisplayComponent_Bool = 6002,
+ Prop_HasControllerComponent_Bool = 6003,
+ Prop_HasCameraComponent_Bool = 6004,
+ Prop_HasDriverDirectModeComponent_Bool = 6005,
+ Prop_HasVirtualDisplayComponent_Bool = 6006,
// Vendors are free to expose private debug data in this reserved region
Prop_VendorSpecific_Reserved_Start = 10000,
@@ -561,6 +557,8 @@ enum EVREventType
VREvent_ApplicationListUpdated = 1303,
VREvent_ApplicationMimeTypeLoad = 1304,
VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,
+ VREvent_ProcessConnected = 1306,
+ VREvent_ProcessDisconnected = 1307,
VREvent_Compositor_MirrorWindowShown = 1400,
VREvent_Compositor_MirrorWindowHidden = 1401,
@@ -586,13 +584,17 @@ enum EVREventType
/** Level of Hmd activity */
+// UserInteraction_Timeout means the device is in the process of timing out.
+// InUse = ( k_EDeviceActivityLevel_UserInteraction || k_EDeviceActivityLevel_UserInteraction_Timeout )
+// VREvent_TrackedDeviceUserInteractionStarted fires when the devices transitions from Standby -> UserInteraction or Idle -> UserInteraction.
+// VREvent_TrackedDeviceUserInteractionEnded fires when the devices transitions from UserInteraction_Timeout -> Idle
enum EDeviceActivityLevel
-{
- k_EDeviceActivityLevel_Unknown = -1,
- k_EDeviceActivityLevel_Idle = 0,
- k_EDeviceActivityLevel_UserInteraction = 1,
- k_EDeviceActivityLevel_UserInteraction_Timeout = 2,
- k_EDeviceActivityLevel_Standby = 3,
+{
+ k_EDeviceActivityLevel_Unknown = -1,
+ k_EDeviceActivityLevel_Idle = 0, // No activity for the last 10 seconds
+ k_EDeviceActivityLevel_UserInteraction = 1, // Activity (movement or prox sensor) is happening now
+ k_EDeviceActivityLevel_UserInteraction_Timeout = 2, // No activity for the last 0.5 seconds
+ k_EDeviceActivityLevel_Standby = 3, // Idle for at least 5 seconds (configurable in Settings -> Power Management)
};
@@ -800,6 +802,13 @@ typedef union
VREvent_Property_t property;
} VREvent_Data_t;
+
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
/** An event posted by the server to all running applications */
struct VREvent_t
{
@@ -810,6 +819,9 @@ struct VREvent_t
VREvent_Data_t data;
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
/** 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.
@@ -858,6 +870,12 @@ struct VRControllerAxis_t
static const uint32_t k_unControllerStateAxisCount = 5;
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
+
/** Holds all the state of a controller at one moment in time. */
struct VRControllerState001_t
{
@@ -872,6 +890,9 @@ struct VRControllerState001_t
// Axis data for the controller's analog inputs
VRControllerAxis_t rAxis[ k_unControllerStateAxisCount ];
};
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
typedef VRControllerState001_t VRControllerState_t;
@@ -954,6 +975,7 @@ enum EVRApplicationType
// interfaces (like IVRSettings and IVRApplications) but not hardware.
VRApplication_VRMonitor = 5, // Reserved for vrmonitor
VRApplication_SteamWatchdog = 6,// Reserved for Steam
+ VRApplication_Bootstrapper = 7, // Start up SteamVR
VRApplication_Max
};
@@ -1199,16 +1221,7 @@ static const uint32_t k_unScreenshotHandleInvalid = 0;
namespace vr
{
-#if defined(__linux__) || defined(__APPLE__)
- // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
- // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
- // The 64-bit version of gcc has the alignment requirement for these types set to
- // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
- // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
- #pragma pack( push, 4 )
-#else
- #pragma pack( push, 8 )
-#endif
+#pragma pack( push, 8 )
enum ECameraVideoStreamFormat
{
@@ -1341,7 +1354,6 @@ namespace vr
static const char * const k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
static const char * const k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
static const char * const k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
- static const char * const k_pch_SteamVR_EnableDistortion_Bool = "enableDistortion";
static const char * const k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
static const char * const k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
static const char * const k_pch_SteamVR_SendSystemButtonToAllApps_Bool= "sendSystemButtonToAllApps";
@@ -2260,11 +2272,18 @@ public:
/** Returns true and fills the event with the next event on the queue if there is one. If there are no events
* this method returns false. uncbVREvent should be the size in bytes of the VREvent_t struct */
virtual bool PollNextEvent( VREvent_t *pEvent, uint32_t uncbVREvent ) = 0;
+
+ /** Provides access to device poses for drivers. Poses are in their "raw" tracking space which is uniquely
+ * defined by each driver providing poses for its devices. It is up to clients of this function to correlate
+ * poses across different drivers. Poses are indexed by their device id, and their associated driver and
+ * other properties can be looked up via IVRProperties. */
+ virtual void GetRawTrackedDevicePoses( float fPredictedSecondsFromNow, TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount ) = 0;
};
static const char *IVRServerDriverHost_Version = "IVRServerDriverHost_004";
}
+
// ivrhiddenarea.h
namespace vr
{
@@ -2339,6 +2358,33 @@ static const char *IVRWatchdogHost_Version = "IVRWatchdogHost_001";
+// ivrvirtualdisplay.h
+namespace vr
+{
+ // ----------------------------------------------------------------------------------------------
+ // Purpose: This component is used for drivers that implement a virtual display (e.g. wireless).
+ // ----------------------------------------------------------------------------------------------
+ class IVRVirtualDisplay
+ {
+ public:
+
+ /** Submits final backbuffer for display. */
+ virtual void Present( vr::SharedTextureHandle_t backbufferTextureHandle ) = 0;
+
+ /** Block until the last presented buffer start scanning out. */
+ virtual void WaitForPresent() = 0;
+
+ /** Provides timing data for synchronizing with display. */
+ virtual bool GetTimeSinceLastVsync( float *pfSecondsSinceLastVsync, uint64_t *pulFrameCounter ) = 0;
+ };
+
+ static const char *IVRVirtualDisplay_Version = "IVRVirtualDisplay_001";
+
+ /** Returns the current IVRVirtualDisplay pointer or NULL the interface could not be found. */
+ VR_INTERFACE vr::IVRVirtualDisplay *VR_CALLTYPE VRVirtualDisplay();
+}
+
+
@@ -2355,6 +2401,7 @@ namespace vr
IVRCameraComponent_Version,
IServerTrackedDeviceProvider_Version,
IVRWatchdogProvider_Version,
+ IVRVirtualDisplay_Version,
nullptr
};
diff --git a/lib/linux32/libopenvr_api.so b/lib/linux32/libopenvr_api.so
new file mode 100755
index 0000000..ccfeaba
--- /dev/null
+++ b/lib/linux32/libopenvr_api.so
Binary files differ
diff --git a/lib/linux64/libopenvr_api.so b/lib/linux64/libopenvr_api.so
index 48e4045..d83a610 100755
--- a/lib/linux64/libopenvr_api.so
+++ b/lib/linux64/libopenvr_api.so
Binary files differ
diff --git a/lib/win32/openvr_api.lib b/lib/win32/openvr_api.lib
index 705736e..130bad0 100644
--- a/lib/win32/openvr_api.lib
+++ b/lib/win32/openvr_api.lib
Binary files differ
diff --git a/lib/win64/openvr_api.lib b/lib/win64/openvr_api.lib
index 33c8bbd..6d26485 100644
--- a/lib/win64/openvr_api.lib
+++ b/lib/win64/openvr_api.lib
Binary files differ
diff --git a/samples/bin/drivers/sample/resources/driver.vrresources b/samples/bin/drivers/sample/resources/driver.vrresources
new file mode 100644
index 0000000..6ed60ad
--- /dev/null
+++ b/samples/bin/drivers/sample/resources/driver.vrresources
@@ -0,0 +1,36 @@
+{
+ "jsonid" : "vrresources",
+ "statusicons" : {
+ "HMD" : {
+ "Prop_NamedIconPathDeviceOff_String" : "{sample}/icons/headset_sample_status_off.png",
+ "Prop_NamedIconPathDeviceSearching_String" : "{sample}/icons/headset_sample_status_searching.gif",
+ "Prop_NamedIconPathDeviceSearchingAlert_String" : "{sample}/icons/headset_sample_status_searching_alert.gif",
+ "Prop_NamedIconPathDeviceReady_String" : "{sample}/icons/headset_sample_status_ready.png",
+ "Prop_NamedIconPathDeviceReadyAlert_String" : "{sample}/icons/headset_sample_status_ready_alert.png",
+ "Prop_NamedIconPathDeviceNotReady_String" : "{sample}/icons/headset_sample_status_error.png",
+ "Prop_NamedIconPathDeviceStandby_String" : "{sample}/icons/headset_sample_status_standby.png",
+ "Prop_NamedIconPathDeviceAlertLow_String" : "{sample}/icons/headset_sample_status_ready_low.png"
+ },
+
+ "Model-v Defaults" : {
+ "Prop_NamedIconPathDeviceOff_String" : "{sample}/icons/headset_sample_status_off.png",
+ "Prop_NamedIconPathDeviceSearching_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceSearchingAlert_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceReady_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceReadyAlert_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceNotReady_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceStandby_String" : "Prop_NamedIconPathDeviceOff_String",
+ "Prop_NamedIconPathDeviceAlertLow_String" : "Prop_NamedIconPathDeviceOff_String"
+ },
+
+ "Model-v1.0" : {
+ "Alias" : "Model-v Defaults",
+ "Prop_NamedIconPathDeviceAlertLow_String" : "{sample}/icons/headset_model1_alertlow.png"
+ },
+
+ "Model-v2.0" : {
+ "Alias" : "Model-v1.0",
+ "Prop_NamedIconPathDeviceAlertLow_String" : "{sample}/icons/headset_model2_alertlow.png"
+ }
+ }
+} \ No newline at end of file
diff --git a/samples/bin/linux64/libopenvr_api.so b/samples/bin/linux64/libopenvr_api.so
index eafad11..7a6de64 100644
--- a/samples/bin/linux64/libopenvr_api.so
+++ b/samples/bin/linux64/libopenvr_api.so
Binary files differ
diff --git a/samples/bin/osx32/libopenvr_api.dylib b/samples/bin/osx32/libopenvr_api.dylib
index b3da84f..5a20f3a 100644
--- a/samples/bin/osx32/libopenvr_api.dylib
+++ b/samples/bin/osx32/libopenvr_api.dylib
Binary files differ
diff --git a/samples/bin/win32/openvr_api.dll b/samples/bin/win32/openvr_api.dll
index 83ead53..aafef72 100644
--- a/samples/bin/win32/openvr_api.dll
+++ b/samples/bin/win32/openvr_api.dll
Binary files differ
diff --git a/samples/bin/win64/openvr_api.dll b/samples/bin/win64/openvr_api.dll
index 5767d72..ddda897 100644
--- a/samples/bin/win64/openvr_api.dll
+++ b/samples/bin/win64/openvr_api.dll
Binary files differ
diff --git a/samples/driver_sample/driver_sample.cpp b/samples/driver_sample/driver_sample.cpp
index b14f12a..3271e62 100644
--- a/samples/driver_sample/driver_sample.cpp
+++ b/samples/driver_sample/driver_sample.cpp
@@ -161,7 +161,7 @@ public:
m_sSerialNumber = buf;
vr::VRSettings()->GetString( k_pch_Sample_Section, k_pch_Sample_ModelNumber_String, buf, sizeof( buf ) );
- m_sSerialNumber = buf;
+ m_sModelNumber = buf;
m_nWindowX = vr::VRSettings()->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowX_Int32 );
m_nWindowY = vr::VRSettings()->GetInt32( k_pch_Sample_Section, k_pch_Sample_WindowY_Int32 );
@@ -205,16 +205,43 @@ public:
// avoid "not fullscreen" warnings from vrmonitor
vr::VRProperties()->SetBoolProperty( m_ulPropertyContainer, Prop_IsOnDesktop_Bool, false );
- // Set icons for the HMD we're going to show
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, Prop_IconPathName_String, "icons" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceOff_String, "{sample}headset_sample_status_off.png" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearching_String, "{sample}headset_sample_status_searching.gif" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearchingAlert_String, "{sample}headset_sample_status_searching_alert.gif" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReady_String, "{sample}headset_sample_status_ready.png" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReadyAlert_String, "{sample}headset_sample_status_ready_alert.png" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceNotReady_String, "{sample}headset_sample_status_error.png" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceStandby_String, "{sample}headset_sample_status_standby.png" );
- vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceAlertLow_String, "{sample}headset_sample_status_ready_low.png" );
+ // Icons can be configured in code or automatically configured by an external file "drivername\resources\driver.vrresources".
+ // Icon properties NOT configured in code (post Activate) are then auto-configured by the optional presence of a driver's "drivername\resources\driver.vrresources".
+ // In this manner a driver can configure their icons in a flexible data driven fashion by using an external file.
+ //
+ // The structure of the driver.vrresources file allows a driver to specialize their icons based on their HW.
+ // Keys matching the value in "Prop_ModelNumber_String" are considered first, since the driver may have model specific icons.
+ // An absence of a matching "Prop_ModelNumber_String" then considers the ETrackedDeviceClass ("HMD", "Controller", "GenericTracker", "TrackingReference")
+ // since the driver may have specialized icons based on those device class names.
+ //
+ // An absence of either then falls back to the "system.vrresources" where generic device class icons are then supplied.
+ //
+ // Please refer to "bin\drivers\sample\resources\driver.vrresources" which contains this sample configuration.
+ //
+ // "Alias" is a reserved key and specifies chaining to another json block.
+ //
+ // In this sample configuration file (overly complex FOR EXAMPLE PURPOSES ONLY)....
+ //
+ // "Model-v2.0" chains through the alias to "Model-v1.0" which chains through the alias to "Model-v Defaults".
+ //
+ // Keys NOT found in "Model-v2.0" would then chase through the "Alias" to be resolved in "Model-v1.0" and either resolve their or continue through the alias.
+ // Thus "Prop_NamedIconPathDeviceAlertLow_String" in each model's block represent a specialization specific for that "model".
+ // Keys in "Model-v Defaults" are an example of mapping to the same states, and here all map to "Prop_NamedIconPathDeviceOff_String".
+ //
+ bool bSetupIconUsingExternalResourceFile = true;
+ if ( !bSetupIconUsingExternalResourceFile )
+ {
+ // Setup properties directly in code.
+ // Path values are of the form {drivername}\icons\some_icon_filename.png
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceOff_String, "{sample}/icons/headset_sample_status_off.png" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearching_String, "{sample}/icons/headset_sample_status_searching.gif" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearchingAlert_String, "{sample}/icons/headset_sample_status_searching_alert.gif" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReady_String, "{sample}/icons/headset_sample_status_ready.png" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReadyAlert_String, "{sample}/icons/headset_sample_status_ready_alert.png" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceNotReady_String, "{sample}/icons/headset_sample_status_error.png" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceStandby_String, "{sample}/icons/headset_sample_status_standby.png" );
+ vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceAlertLow_String, "{sample}/icons/headset_sample_status_ready_low.png" );
+ }
return VRInitError_None;
}
diff --git a/src/ivrclientcore.h b/src/ivrclientcore.h
index b4c6f3a..8144299 100644
--- a/src/ivrclientcore.h
+++ b/src/ivrclientcore.h
@@ -22,7 +22,7 @@ public:
/** Returns true if any driver has an HMD attached. Can be called outside of Init/Cleanup */
virtual bool BIsHmdPresent() = 0;
- /** Returns an english error string from inside vrclient.dll which might be newer than the API DLL */
+ /** Returns an English error string from inside vrclient.dll which might be newer than the API DLL */
virtual const char *GetEnglishStringForHmdError( vr::EVRInitError eError ) = 0;
/** Returns an error symbol from inside vrclient.dll which might be newer than the API DLL */
diff --git a/src/vrcommon/pathtools_public.h b/src/vrcommon/pathtools_public.h
index 7c34a71..13cb0d1 100644
--- a/src/vrcommon/pathtools_public.h
+++ b/src/vrcommon/pathtools_public.h
@@ -108,6 +108,7 @@ std::string GetUserDocumentsPath();
//-----------------------------------------------------------------------------
#if defined(WIN32)
#define DYNAMIC_LIB_EXT ".dll"
+#define PROGRAM_EXT ".exe"
#ifdef _WIN64
#define PLATSUBDIR "win64"
#else
@@ -116,8 +117,10 @@ std::string GetUserDocumentsPath();
#elif defined(OSX)
#define DYNAMIC_LIB_EXT ".dylib"
#define PLATSUBDIR "osx32"
+#define PROGRAM_EXT ""
#elif defined(LINUX)
#define DYNAMIC_LIB_EXT ".so"
+#define PROGRAM_EXT ""
#if defined( LINUX32 )
#define PLATSUBDIR "linux32"
#else
diff --git a/src/vrcommon/sharedlibtools_public.cpp b/src/vrcommon/sharedlibtools_public.cpp
index 9c0661e..6ba9ac4 100644
--- a/src/vrcommon/sharedlibtools_public.cpp
+++ b/src/vrcommon/sharedlibtools_public.cpp
@@ -31,6 +31,8 @@ void *SharedLib_GetFunction( SharedLibHandle lib, const char *pchFunctionName)
void SharedLib_Unload( SharedLibHandle lib )
{
+ if ( !lib )
+ return;
#if defined( _WIN32)
FreeLibrary( (HMODULE)lib );
#elif defined(POSIX)