Updated OpenVR to version 1.0.7.
This commit is contained in:
Vendored
+86
-68
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user