Skip to content

Commit 9d48ccf

Browse files
committed
OpenVR SDK 1.0.5
General: * Added final support for submitting Vulkan overlays and eye images. See this document for more information: https://github.com/ValveSoftware/openvr/wiki/Vulkan * Added TextureType_Vulkan, VRVulkanTextureData_t * Rename EGraphicsAPIConvention -> ETextureType. * New synchronous MessageOverlay API. Use IVROverlay::ShowMessageOverlay to display a message with up to four buttons. * Added ETrackedDeviceClass, GenericTracker * Added ETrackedPropertyError, PermissionDenied IVRSystem (v15): * GetProjectionMatrix signature change, removed EGraphicsAPIConvention eProjType IVRCompositor (v19): * Added GetVulkanInstanceExtensionsRequired, GetVulkanDeviceExtensionsRequired IVROverlay (v14): * Added VROverlayFlags_VisibleInDashboard * GetOverlayTexture signature change (includes overlay texture bounds) * Added GetOverlayFlags * Added ShowMessageOverlay IVRTrackedCamera (v13): * Renamed GetCameraIntrinsics [git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 3739504]
1 parent 84e877f commit 9d48ccf

30 files changed

+441
-157
lines changed

bin/linux64/libopenvr_api.so

0 Bytes
Binary file not shown.

bin/linux64/libopenvr_api.so.dbg

952 Bytes
Binary file not shown.

bin/osx32/libopenvr_api.dylib

0 Bytes
Binary file not shown.
Binary file not shown.

bin/win32/openvr_api.dll

0 Bytes
Binary file not shown.

bin/win32/openvr_api.pdb

72 KB
Binary file not shown.

bin/win64/openvr_api.dll

0 Bytes
Binary file not shown.

bin/win64/openvr_api.pdb

80 KB
Binary file not shown.

headers/openvr.h

+74-27
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ enum EVREye
111111
Eye_Right = 1
112112
};
113113

114-
enum EGraphicsAPIConvention
114+
enum ETextureType
115115
{
116-
API_DirectX = 0, // Normalized Z goes from 0 at the viewer to 1 at the far clip plane
117-
API_OpenGL = 1, // Normalized Z goes from 1 at the viewer to -1 at the far clip plane
116+
TextureType_DirectX = 0, // Handle is an ID3D11Texture
117+
TextureType_OpenGL = 1, // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags
118+
TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure
118119
};
119120

120121
enum EColorSpace
@@ -126,8 +127,8 @@ enum EColorSpace
126127

127128
struct Texture_t
128129
{
129-
void* handle; // Native d3d texture pointer or GL texture id.
130-
EGraphicsAPIConvention eType;
130+
void* handle; // See ETextureType definition above
131+
ETextureType eType;
131132
EColorSpace eColorSpace;
132133
};
133134

@@ -161,11 +162,8 @@ enum ETrackedDeviceClass
161162
TrackedDeviceClass_Invalid = 0, // the ID was not valid.
162163
TrackedDeviceClass_HMD = 1, // Head-Mounted Displays
163164
TrackedDeviceClass_Controller = 2, // Tracked controllers
165+
TrackedDeviceClass_GenericTracker = 3, // Generic trackers, similar to controllers
164166
TrackedDeviceClass_TrackingReference = 4, // Camera and base stations that serve as tracking reference points
165-
166-
TrackedDeviceClass_Count, // This isn't a class that will ever be returned. It is used for allocating arrays and such
167-
168-
TrackedDeviceClass_Other = 1000,
169167
};
170168

171169

@@ -198,14 +196,16 @@ enum ETrackingUniverseOrigin
198196
{
199197
TrackingUniverseSeated = 0, // Poses are provided relative to the seated zero pose
200198
TrackingUniverseStanding = 1, // Poses are provided relative to the safe bounds configured by the user
201-
TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. You probably don't want this one.
199+
TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. It has Y up and is unified for devices of the same driver. You usually don't want this one.
202200
};
203201

204202

205203
/** Each entry in this enum represents a property that can be retrieved about a
206204
* tracked device. Many fields are only valid for one ETrackedDeviceClass. */
207205
enum ETrackedDeviceProperty
208206
{
207+
Prop_Invalid = 0,
208+
209209
// general properties that apply to all device classes
210210
Prop_TrackingSystemName_String = 1000,
211211
Prop_ModelNumber_String = 1001,
@@ -333,6 +333,7 @@ enum ETrackedPropertyError
333333
TrackedProp_ValueNotProvidedByDevice = 7,
334334
TrackedProp_StringExceedsMaximumLength = 8,
335335
TrackedProp_NotYetAvailable = 9, // The property value isn't known yet, but is expected soon. Call again later.
336+
TrackedProp_PermissionDenied = 10,
336337
};
337338

338339
/** Allows the application to control what part of the provided texture will be used in the
@@ -358,13 +359,13 @@ enum EVRSubmitFlags
358359
// If the texture pointer passed in is actually a renderbuffer (e.g. for MSAA in OpenGL) then set this flag.
359360
Submit_GlRenderBuffer = 0x02,
360361

361-
// Handle is pointer to VulkanData_t
362-
Submit_VulkanTexture = 0x04,
362+
// Do not use
363+
Submit_Reserved = 0x04,
363364
};
364365

365366
/** Data required for passing Vulkan textures to IVRCompositor::Submit.
366367
* Be sure to call OpenVR_Shutdown before destroying these resources. */
367-
struct VulkanData_t
368+
struct VRVulkanTextureData_t
368369
{
369370
uint64_t m_nImage; // VkImage
370371
VkDevice_T *m_pDevice;
@@ -517,6 +518,8 @@ enum EVREventType
517518
VREvent_PerformanceTest_EnableCapture = 1600,
518519
VREvent_PerformanceTest_DisableCapture = 1601,
519520
VREvent_PerformanceTest_FidelityLevel = 1602,
521+
522+
VREvent_MessageOverlay_Closed = 1650,
520523

521524
// Vendors are free to expose private events in this reserved region
522525
VREvent_VendorSpecific_Reserved_Start = 10000,
@@ -703,6 +706,11 @@ struct VREvent_EditingCameraSurface_t
703706
uint32_t nVisualMode;
704707
};
705708

709+
struct VREvent_MessageOverlay_t
710+
{
711+
uint32_t unVRMessageOverlayResponse; // vr::VRMessageOverlayResponse enum
712+
};
713+
706714
/** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */
707715
typedef union
708716
{
@@ -724,6 +732,7 @@ typedef union
724732
VREvent_ScreenshotProgress_t screenshotProgress;
725733
VREvent_ApplicationLaunch_t applicationLaunch;
726734
VREvent_EditingCameraSurface_t cameraSurface;
735+
VREvent_MessageOverlay_t messageOverlay;
727736
} VREvent_Data_t;
728737

729738
/** An event posted by the server to all running applications */
@@ -944,6 +953,8 @@ enum EVRInitError
944953
VRInitError_Init_InvalidApplicationType = 130,
945954
VRInitError_Init_NotAvailableToWatchdogApps = 131,
946955
VRInitError_Init_WatchdogDisabledInSettings = 132,
956+
VRInitError_Init_VRDashboardNotFound = 133,
957+
VRInitError_Init_VRDashboardStartupFailed = 134,
947958

948959
VRInitError_Driver_Failed = 200,
949960
VRInitError_Driver_Unknown = 201,
@@ -1131,7 +1142,7 @@ class IVRSystem
11311142
virtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight ) = 0;
11321143

11331144
/** The projection matrix for the specified eye */
1134-
virtual HmdMatrix44_t GetProjectionMatrix( EVREye eEye, float fNearZ, float fFarZ, EGraphicsAPIConvention eProjType ) = 0;
1145+
virtual HmdMatrix44_t GetProjectionMatrix( EVREye eEye, float fNearZ, float fFarZ ) = 0;
11351146

11361147
/** The components necessary to build your own projection matrix in case your
11371148
* application is doing something fancy like infinite Z */
@@ -1384,7 +1395,7 @@ class IVRSystem
13841395

13851396
};
13861397

1387-
static const char * const IVRSystem_Version = "IVRSystem_014";
1398+
static const char * const IVRSystem_Version = "IVRSystem_015";
13881399

13891400
}
13901401

@@ -1640,7 +1651,6 @@ namespace vr
16401651

16411652
//-----------------------------------------------------------------------------
16421653
// steamvr keys
1643-
16441654
static const char * const k_pch_SteamVR_Section = "steamvr";
16451655
static const char * const k_pch_SteamVR_RequireHmd_String = "requireHmd";
16461656
static const char * const k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver";
@@ -1677,27 +1687,26 @@ namespace vr
16771687
static const char * const k_pch_SteamVR_ShowMirrorView_Bool = "showMirrorView";
16781688
static const char * const k_pch_SteamVR_MirrorViewGeometry_String = "mirrorViewGeometry";
16791689
static const char * const k_pch_SteamVR_StartMonitorFromAppLaunch = "startMonitorFromAppLaunch";
1690+
static const char * const k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = "startCompositorFromAppLaunch";
1691+
static const char * const k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = "startDashboardFromAppLaunch";
1692+
static const char * const k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = "startOverlayAppsFromDashboard";
16801693
static const char * const k_pch_SteamVR_EnableHomeApp = "enableHomeApp";
16811694
static const char * const k_pch_SteamVR_SetInitialDefaultHomeApp = "setInitialDefaultHomeApp";
16821695
static const char * const k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBackgroundImageTimeSec";
16831696
static const char * const k_pch_SteamVR_RetailDemo_Bool = "retailDemo";
16841697
static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset";
16851698

1686-
16871699
//-----------------------------------------------------------------------------
16881700
// lighthouse keys
1689-
16901701
static const char * const k_pch_Lighthouse_Section = "driver_lighthouse";
16911702
static const char * const k_pch_Lighthouse_DisableIMU_Bool = "disableimu";
16921703
static const char * const k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation";
16931704
static const char * const k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug";
1694-
16951705
static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation";
16961706
static const char * const k_pch_Lighthouse_DBHistory_Bool = "dbhistory";
16971707

16981708
//-----------------------------------------------------------------------------
16991709
// null keys
1700-
17011710
static const char * const k_pch_Null_Section = "driver_null";
17021711
static const char * const k_pch_Null_EnableNullDriver_Bool = "enable";
17031712
static const char * const k_pch_Null_SerialNumber_String = "serialNumber";
@@ -1830,7 +1839,7 @@ enum ChaperoneCalibrationState
18301839

18311840
// Errors
18321841
ChaperoneCalibrationState_Error = 200, // The UniverseID is invalid
1833-
ChaperoneCalibrationState_Error_BaseStationUninitalized = 201, // Tracking center hasn't be calibrated for at least one of the base stations
1842+
ChaperoneCalibrationState_Error_BaseStationUninitialized = 201, // Tracking center hasn't be calibrated for at least one of the base stations
18341843
ChaperoneCalibrationState_Error_BaseStationConflict = 202, // Tracking center is calibrated, but base stations disagree on the tracking space
18351844
ChaperoneCalibrationState_Error_PlayAreaInvalid = 203, // Play Area hasn't been calibrated for the current tracking center
18361845
ChaperoneCalibrationState_Error_CollisionBoundsInvalid = 204, // Collision Bounds haven't been calibrated for the current tracking center
@@ -2236,9 +2245,20 @@ class IVRCompositor
22362245
virtual bool ReleaseSharedGLTexture( vr::glUInt_t glTextureId, vr::glSharedTextureHandle_t glSharedTextureHandle ) = 0;
22372246
virtual void LockGLSharedTextureForAccess( vr::glSharedTextureHandle_t glSharedTextureHandle ) = 0;
22382247
virtual void UnlockGLSharedTextureForAccess( vr::glSharedTextureHandle_t glSharedTextureHandle ) = 0;
2248+
2249+
/** [Vulkan Only]
2250+
* return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing
2251+
* null. The string will be a space separated list of-required instance extensions to enable in VkCreateInstance */
2252+
virtual uint32_t GetVulkanInstanceExtensionsRequired( VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0;
2253+
2254+
/** [Vulkan only]
2255+
* return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing
2256+
* null. The string will be a space separated list of required device extensions to enable in VkCreateDevice */
2257+
virtual uint32_t GetVulkanDeviceExtensionsRequired( VkPhysicalDevice_T *pPhysicalDevice, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0;
2258+
22392259
};
22402260

2241-
static const char * const IVRCompositor_Version = "IVRCompositor_018";
2261+
static const char * const IVRCompositor_Version = "IVRCompositor_019";
22422262

22432263
} // namespace vr
22442264

@@ -2414,6 +2434,20 @@ namespace vr
24142434
// If this is set on an overlay owned by the scene application that overlay
24152435
// will be sorted with the "Other" overlays on top of all other scene overlays
24162436
VROverlayFlags_SortWithNonSceneOverlays = 14,
2437+
2438+
// If set, the overlay will be shown in the dashboard, otherwise it will be hidden.
2439+
VROverlayFlags_VisibleInDashboard = 15,
2440+
};
2441+
2442+
enum VRMessageOverlayResponse
2443+
{
2444+
VRMessageOverlayResponse_ButtonPress_0 = 0,
2445+
VRMessageOverlayResponse_ButtonPress_1 = 1,
2446+
VRMessageOverlayResponse_ButtonPress_2 = 2,
2447+
VRMessageOverlayResponse_ButtonPress_3 = 3,
2448+
VRMessageOverlayResponse_CouldntFindSystemOverlay = 4,
2449+
VRMessageOverlayResponse_CouldntFindOrCreateClientOverlay= 5,
2450+
VRMessageOverlayResponse_ApplicationQuit = 6
24172451
};
24182452

24192453
struct VROverlayIntersectionParams_t
@@ -2731,7 +2765,7 @@ namespace vr
27312765
* pNativeTextureHandle is an OUTPUT, it will be a pointer to a ID3D11ShaderResourceView *.
27322766
* pNativeTextureRef is an INPUT and should be a ID3D11Resource *. The device used by pNativeTextureRef will be used to bind pNativeTextureHandle.
27332767
*/
2734-
virtual EVROverlayError GetOverlayTexture( VROverlayHandle_t ulOverlayHandle, void **pNativeTextureHandle, void *pNativeTextureRef, uint32_t *pWidth, uint32_t *pHeight, uint32_t *pNativeFormat, EGraphicsAPIConvention *pAPI, EColorSpace *pColorSpace ) = 0;
2768+
virtual EVROverlayError GetOverlayTexture( VROverlayHandle_t ulOverlayHandle, void **pNativeTextureHandle, void *pNativeTextureRef, uint32_t *pWidth, uint32_t *pHeight, uint32_t *pNativeFormat, ETextureType *pAPIType, EColorSpace *pColorSpace, VRTextureBounds_t *pTextureBounds ) = 0;
27352769

27362770
/** Release the pNativeTextureHandle provided from the GetOverlayTexture call, this allows the system to free the underlying GPU resources for this object,
27372771
* so only do it once you stop rendering this texture.
@@ -2794,9 +2828,18 @@ namespace vr
27942828
/** Sets a list of primitives to be used for controller ray intersection
27952829
* typically the size of the underlying UI in pixels (not in world space). */
27962830
virtual EVROverlayError SetOverlayIntersectionMask( VROverlayHandle_t ulOverlayHandle, VROverlayIntersectionMaskPrimitive_t *pMaskPrimitives, uint32_t unNumMaskPrimitives, uint32_t unPrimitiveSize = sizeof( VROverlayIntersectionMaskPrimitive_t ) ) = 0;
2831+
2832+
virtual EVROverlayError GetOverlayFlags( VROverlayHandle_t ulOverlayHandle, uint32_t *pFlags ) = 0;
2833+
2834+
// ---------------------------------------------
2835+
// Message box methods
2836+
// ---------------------------------------------
2837+
2838+
/** Show the message overlay. This will block and return you a result. **/
2839+
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;
27972840
};
27982841

2799-
static const char * const IVROverlay_Version = "IVROverlay_013";
2842+
static const char * const IVROverlay_Version = "IVROverlay_014";
28002843

28012844
} // namespace vr
28022845

@@ -3041,7 +3084,7 @@ class IVRTrackedCamera
30413084
/** Gets size of the image frame. */
30423085
virtual vr::EVRTrackedCameraError GetCameraFrameSize( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, uint32_t *pnWidth, uint32_t *pnHeight, uint32_t *pnFrameBufferSize ) = 0;
30433086

3044-
virtual vr::EVRTrackedCameraError GetCameraIntrinisics( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, vr::HmdVector2_t *pFocalLength, vr::HmdVector2_t *pCenter ) = 0;
3087+
virtual vr::EVRTrackedCameraError GetCameraIntrinsics( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, vr::HmdVector2_t *pFocalLength, vr::HmdVector2_t *pCenter ) = 0;
30453088

30463089
virtual vr::EVRTrackedCameraError GetCameraProjection( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, vr::HmdMatrix44_t *pProjection ) = 0;
30473090

@@ -3062,7 +3105,12 @@ class IVRTrackedCamera
30623105
/** Gets size of the image frame. */
30633106
virtual vr::EVRTrackedCameraError GetVideoStreamTextureSize( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, vr::VRTextureBounds_t *pTextureBounds, uint32_t *pnWidth, uint32_t *pnHeight ) = 0;
30643107

3065-
/** Access a shared D3D11 texture for the specified tracked camera stream */
3108+
/** Access a shared D3D11 texture for the specified tracked camera stream.
3109+
* The camera frame type VRTrackedCameraFrameType_Undistorted is not supported directly as a shared texture. It is an interior subregion of the shared texture VRTrackedCameraFrameType_MaximumUndistorted.
3110+
* Instead, use GetVideoStreamTextureSize() with VRTrackedCameraFrameType_Undistorted to determine the proper interior subregion bounds along with GetVideoStreamTextureD3D11() with
3111+
* VRTrackedCameraFrameType_MaximumUndistorted to provide the texture. The VRTrackedCameraFrameType_MaximumUndistorted will yield an image where the invalid regions are decoded
3112+
* by the alpha channel having a zero component. The valid regions all have a non-zero alpha component. The subregion as described by VRTrackedCameraFrameType_Undistorted
3113+
* guarantees a rectangle where all pixels are valid. */
30663114
virtual vr::EVRTrackedCameraError GetVideoStreamTextureD3D11( vr::TrackedCameraHandle_t hTrackedCamera, vr::EVRTrackedCameraFrameType eFrameType, void *pD3D11DeviceOrResource, void **ppD3D11ShaderResourceView, vr::CameraVideoStreamFrameHeader_t *pFrameHeader, uint32_t nFrameHeaderSize ) = 0;
30673115

30683116
/** Access a shared GL texture for the specified tracked camera stream */
@@ -3263,7 +3311,6 @@ namespace vr
32633311
// They will go away in the future.
32643312
typedef EVRInitError HmdError;
32653313
typedef EVREye Hmd_Eye;
3266-
typedef EGraphicsAPIConvention GraphicsAPIConvention;
32673314
typedef EColorSpace ColorSpace;
32683315
typedef ETrackingResult HmdTrackingResult;
32693316
typedef ETrackedDeviceClass TrackedDeviceClass;

0 commit comments

Comments
 (0)