Skip to content

Commit c174baf

Browse files
committed
OpenVR SDK 0.9.16:
Note: This update includes significant changes to the OpenVR driver interface to simplify driver development and support backward compatibility. Drivers will need to update to at least this version to continue to be supported. General: * Added VREvent_TrackedDeviceRoleChanged, which is sent when right/left handedness of a controller changes. Settings: * Added RemoveSection, which removes an entire section from the settings. Render Models: * Changed render model and texture loading to be asynchronous. LoadRenderModel has become LoadRenderModel_Async and LoadTexture has become LoadTexture_Async. Check the EVRRenderModelError returned by these functions to determine if the requested resource is loaded asynchronously. * LoadTextureD3D11 has become LoadTextureD3D11_Async which loads a texture into a D3D11 resource asynchronously. * Added VRComponentProperty_IsScrolled, which can be returned for render model components that are currently scrolling. * Added RenderModel_ControllerMode_State_t to GetComponentState. This allows the caller to specify whether the component is scrolled and is used for devices sending scroll events to overlays. Pass NULL if you don't care about this. Driver Interface: * Removed TrackedDeviceDriverInfo_t. The information that used to be in this struct is now provided via properties. Added Prop_DeviceClass_Int32 for the one member of the struct that didn't already have a matching property. * IServerDriverHost:: TrackedDeviceAdded now takes a serial number string. The driver will be called back to get specifics via properties. * Prop_SerialNumber_String and Prop_DeviceClass_Int32 are now required for every tracked device driver. * Added deviceIsConnected to DriverPose_t. When a connection to a device is lost the driver should send another pose with this bool set to false. * Removed ITrackedDeviceServerDriver::GetId. This information is retrieved via Prop_SerialNumber_String now. * Functions that aren't universal to all tracked devices have been moved onto driver components. These are retrieved with the GetComponent function. * Display-related functions have moved to IVRDisplayComponent. This includes: * GetWindowBounds * IsDisplayOnDesktop * IsDisplayRealDisplay * GetRecommendedRenderTargetSize * GetEyeOutputViewport * GetProjectionRaw * ComputeDistortion * CreateSwapTextureSet * DestroySwapTextureSet * DestroyAllSwapTextureSets * SubmitLayer * Present * Controller-related functions have been moved to IVRControllerComponent. This includes: * GetControllerState * TriggerHapticPulse * Camera-related functions have moved onto IVRCameraComponent, but this interface is still in flux, so you should avoid implementing it in your driver. * IServerDriverHost lost the TrackedDeviceInfoUpdated function. If property values change, the driver should call TrackedDevicePropertiesChanged instead. * GetSettings on IServerDriverHost and IClientDriverHost now take an interface string. Pass the version of IVRSettings that your driver was compiled against. * Interface versions were added to a few other places to support backward compatibility. [git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 3299073]
1 parent c955710 commit c174baf

25 files changed

+1281
-232
lines changed

bin/linux64/libopenvr_api.so

68.3 KB
Binary file not shown.

bin/linux64/libopenvr_api.so.dbg

268 KB
Binary file not shown.

bin/osx32/libopenvr_api.dylib

1.42 KB
Binary file not shown.
Binary file not shown.

bin/win32/openvr_api.dll

-2 KB
Binary file not shown.

bin/win32/openvr_api.pdb

24 KB
Binary file not shown.

bin/win64/openvr_api.dll

-11 KB
Binary file not shown.

bin/win64/openvr_api.pdb

-16 KB
Binary file not shown.

headers/openvr.h

+59-30
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ enum ETrackedDeviceProperty
224224
Prop_DeviceProvidesBatteryStatus_Bool = 1026,
225225
Prop_DeviceCanPowerOff_Bool = 1027,
226226
Prop_Firmware_ProgrammingTarget_String = 1028,
227+
Prop_DeviceClass_Int32 = 1029,
228+
Prop_HasCamera_Bool = 1030,
227229

228230
// Properties that are unique to TrackedDeviceClass_HMD
229231
Prop_ReportsTimeSinceVSync_Bool = 2000,
@@ -256,6 +258,9 @@ enum ETrackedDeviceProperty
256258
Prop_CameraFirmwareVersion_Uint64 = 2027,
257259
Prop_CameraFirmwareDescription_String = 2028,
258260
Prop_DisplayFPGAVersion_Uint64 = 2029,
261+
Prop_DisplayBootloaderVersion_Uint64 = 2030,
262+
Prop_DisplayHardwareVersion_Uint64 = 2031,
263+
Prop_AudioFirmwareVersion_Uint64 = 2032,
259264

260265
// Properties that are unique to TrackedDeviceClass_Controller
261266
Prop_AttachedDeviceId_String = 3000,
@@ -348,6 +353,7 @@ enum EVREventType
348353
VREvent_IpdChanged = 105,
349354
VREvent_EnterStandbyMode = 106,
350355
VREvent_LeaveStandbyMode = 107,
356+
VREvent_TrackedDeviceRoleChanged = 108,
351357

352358
VREvent_ButtonPress = 200, // data is controller
353359
VREvent_ButtonUnpress = 201, // data is controller
@@ -399,6 +405,7 @@ enum EVREventType
399405
VREvent_ChaperoneSettingsHaveChanged = 803,
400406

401407
VREvent_BackgroundSettingHasChanged = 850,
408+
VREvent_CameraSettingsHaveChanged = 851,
402409

403410
VREvent_StatusUpdate = 900,
404411

@@ -1352,7 +1359,8 @@ namespace vr
13521359
public:
13531360
virtual const char *GetSettingsErrorNameFromEnum( EVRSettingsError eError ) = 0;
13541361

1355-
virtual void Sync( EVRSettingsError *peError = nullptr ) = 0;
1362+
// Returns true if file sync occurred (force or settings dirty)
1363+
virtual bool Sync( bool bForce = false, EVRSettingsError *peError = nullptr ) = 0;
13561364

13571365
virtual bool GetBool( const char *pchSection, const char *pchSettingsKey, bool bDefaultValue, EVRSettingsError *peError = nullptr ) = 0;
13581366
virtual void SetBool( const char *pchSection, const char *pchSettingsKey, bool bValue, EVRSettingsError *peError = nullptr ) = 0;
@@ -1362,6 +1370,7 @@ namespace vr
13621370
virtual void SetFloat( const char *pchSection, const char *pchSettingsKey, float flValue, EVRSettingsError *peError = nullptr ) = 0;
13631371
virtual void GetString( const char *pchSection, const char *pchSettingsKey, char *pchValue, uint32_t unValueLen, const char *pchDefaultValue, EVRSettingsError *peError = nullptr ) = 0;
13641372
virtual void SetString( const char *pchSection, const char *pchSettingsKey, const char *pchValue, EVRSettingsError *peError = nullptr ) = 0;
1373+
virtual void RemoveSection( const char *pchSection, EVRSettingsError *peError = nullptr ) = 0;
13651374
};
13661375

13671376
//-----------------------------------------------------------------------------
@@ -1385,7 +1394,9 @@ namespace vr
13851394
static const char * const k_pch_SteamVR_PowerOffOnExit_Bool = "powerOffOnExit";
13861395
static const char * const k_pch_SteamVR_StandbyAppRunningTimeout_Float = "standbyAppRunningTimeout";
13871396
static const char * const k_pch_SteamVR_StandbyNoAppTimeout_Float = "standbyNoAppTimeout";
1388-
1397+
static const char * const k_pch_SteamVR_AutomaticDirectModeEnabled_Bool = "automaticDirectModeEnabled";
1398+
static const char * const k_pch_SteamVR_RequestDirectModeEnabled_Bool = "requestDirectModeEnabled";
1399+
static const char * const k_pch_SteamVR_RequestDirectModeDisabled_Bool = "requestDirectModeDisabled";
13891400

13901401
//-----------------------------------------------------------------------------
13911402
// lighthouse keys
@@ -1410,7 +1421,6 @@ namespace vr
14101421

14111422
static const char * const k_pch_Null_Section = "driver_null";
14121423
static const char * const k_pch_Null_EnableNullDriver_Bool = "enable";
1413-
static const char * const k_pch_Null_Id_String = "id";
14141424
static const char * const k_pch_Null_SerialNumber_String = "serialNumber";
14151425
static const char * const k_pch_Null_ModelNumber_String = "modelNumber";
14161426
static const char * const k_pch_Null_WindowX_Int32 = "windowX";
@@ -1446,6 +1456,10 @@ namespace vr
14461456
static const char * const k_pch_Perf_AllowTimingStore_Bool = "allowTimingStore";
14471457
static const char * const k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit";
14481458

1459+
//-----------------------------------------------------------------------------
1460+
// camera keys
1461+
static const char * const k_pch_Camera_Section = "camera";
1462+
14491463
//-----------------------------------------------------------------------------
14501464

14511465
static const char * const IVRSettings_Version = "IVRSettings_001";
@@ -1482,7 +1496,7 @@ enum ChaperoneCalibrationState
14821496
ChaperoneCalibrationState_Warning_SeatedBoundsInvalid = 103, // Seated bounds haven't been calibrated for the current tracking center
14831497

14841498
// Errors
1485-
ChaperoneCalibrationState_Error = 200,
1499+
ChaperoneCalibrationState_Error = 200, // The UniverseID is invalid
14861500
ChaperoneCalibrationState_Error_BaseStationUninitalized = 201, // Tracking center hasn't be calibrated for at least one of the base stations
14871501
ChaperoneCalibrationState_Error_BaseStationConflict = 202, // Tracking center is calibrated, but base stations disagree on the tracking space
14881502
ChaperoneCalibrationState_Error_PlayAreaInvalid = 203, // Play Area hasn't been calibrated for the current tracking center
@@ -2246,6 +2260,21 @@ static const char * const k_pch_Controller_Component_Status = "status"; // 1:1
22462260
#pragma pack( push, 8 )
22472261
#endif
22482262

2263+
/** Errors that can occur with the VR compositor */
2264+
enum EVRRenderModelError
2265+
{
2266+
VRRenderModelError_None = 0,
2267+
VRRenderModelError_Loading = 100,
2268+
VRRenderModelError_NotSupported = 200,
2269+
VRRenderModelError_InvalidArg = 300,
2270+
VRRenderModelError_InvalidModel = 301,
2271+
VRRenderModelError_NoShapes = 302,
2272+
VRRenderModelError_MultipleShapes = 303,
2273+
VRRenderModelError_TooManyIndices = 304,
2274+
VRRenderModelError_MultipleTextures = 305,
2275+
VRRenderModelError_InvalidTexture = 400,
2276+
};
2277+
22492278
typedef uint32_t VRComponentProperties;
22502279

22512280
enum EVRComponentProperty
@@ -2254,18 +2283,18 @@ enum EVRComponentProperty
22542283
VRComponentProperty_IsVisible = (1 << 1),
22552284
VRComponentProperty_IsTouched = (1 << 2),
22562285
VRComponentProperty_IsPressed = (1 << 3),
2286+
VRComponentProperty_IsScrolled = (1 << 4),
22572287
};
22582288

2259-
/** Describes state information about a render-model component, including transforms and other dynamic properties
2260-
*/
2289+
/** Describes state information about a render-model component, including transforms and other dynamic properties */
22612290
struct RenderModel_ComponentState_t
22622291
{
22632292
HmdMatrix34_t mTrackingToComponentRenderModel; // Transform required when drawing the component render model
22642293
HmdMatrix34_t mTrackingToComponentLocal; // Transform available for attaching to a local component coordinate system (-Z out from surface )
22652294
VRComponentProperties uProperties;
22662295
};
22672296

2268-
/** a single vertex in a render model */
2297+
/** A single vertex in a render model */
22692298
struct RenderModel_Vertex_t
22702299
{
22712300
HmdVector3_t vPosition; // position in meters in device space
@@ -2281,8 +2310,7 @@ struct RenderModel_TextureMap_t
22812310
};
22822311

22832312
/** Session unique texture identifier. Rendermodels which share the same texture will have the same id.
2284-
IDs <0 denote the texture is not present
2285-
*/
2313+
IDs <0 denote the texture is not present */
22862314

22872315
typedef int32_t TextureID_t;
22882316

@@ -2295,41 +2323,45 @@ struct RenderModel_t
22952323
TextureID_t diffuseTextureId; // Session unique texture identifier. Rendermodels which share the same texture will have the same id. <0 == texture not present
22962324
};
22972325

2326+
struct RenderModel_ControllerMode_State_t
2327+
{
2328+
bool bScrollWheelVisible; // is this controller currently set to be in a scroll wheel mode
2329+
};
2330+
22982331
#pragma pack( pop )
22992332

23002333
class IVRRenderModels
23012334
{
23022335
public:
23032336

2304-
23052337
/** Loads and returns a render model for use in the application. pchRenderModelName should be a render model name
23062338
* from the Prop_RenderModelName_String property or an absolute path name to a render model on disk.
23072339
*
23082340
* The resulting render model is valid until VR_Shutdown() is called or until FreeRenderModel() is called. When the
23092341
* application is finished with the render model it should call FreeRenderModel() to free the memory associated
23102342
* with the model.
23112343
*
2312-
* The method returns false if the model could not be loaded.
2313-
*
2314-
* The API expects that this function will be called at startup or when tracked devices are connected and disconnected.
2315-
* If it is called every frame it will hurt performance.
2316-
*/
2317-
virtual bool LoadRenderModel( const char *pchRenderModelName, RenderModel_t **ppRenderModel ) = 0;
2344+
* The method returns VRRenderModelError_Loading while the render model is still being loaded.
2345+
* The method returns VRRenderModelError_None once loaded successfully, otherwise will return an error. */
2346+
virtual EVRRenderModelError LoadRenderModel_Async( const char *pchRenderModelName, RenderModel_t **ppRenderModel ) = 0;
23182347

23192348
/** Frees a previously returned render model
2320-
* It is safe to call this on a null ptr.
2321-
**/
2349+
* It is safe to call this on a null ptr. */
23222350
virtual void FreeRenderModel( RenderModel_t *pRenderModel ) = 0;
23232351

2324-
/** Loads and returns a texture for use in the application.
2325-
*/
2326-
virtual bool LoadTexture( TextureID_t textureId, RenderModel_TextureMap_t **ppTexture ) = 0;
2352+
/** Loads and returns a texture for use in the application. */
2353+
virtual EVRRenderModelError LoadTexture_Async( TextureID_t textureId, RenderModel_TextureMap_t **ppTexture ) = 0;
23272354

23282355
/** Frees a previously returned texture
2329-
* It is safe to call this on a null ptr.
2330-
*/
2356+
* It is safe to call this on a null ptr. */
23312357
virtual void FreeTexture( RenderModel_TextureMap_t *pTexture ) = 0;
23322358

2359+
/** Creates a D3D11 texture and loads data into it. */
2360+
virtual EVRRenderModelError LoadTextureD3D11_Async( TextureID_t textureId, void *pD3D11Device, void **ppD3D11Texture2D ) = 0;
2361+
2362+
/** Use this to free textures created with LoadTextureD3D11_Async instead of calling Release on them. */
2363+
virtual void FreeTextureD3D11( void *pD3D11Texture2D ) = 0;
2364+
23332365
/** Use this to get the names of available render models. Index does not correlate to a tracked device index, but
23342366
* is only used for iterating over all available render models. If the index is out of range, this function will return 0.
23352367
* Otherwise, it will return the size of the buffer required for the name. */
@@ -2339,15 +2371,13 @@ class IVRRenderModels
23392371
virtual uint32_t GetRenderModelCount() = 0;
23402372

23412373

2342-
23432374
/** Returns the number of components of the specified render model.
23442375
* Components are useful when client application wish to draw, label, or otherwise interact with components of tracked objects.
23452376
* Examples controller components:
23462377
* renderable things such as triggers, buttons
23472378
* non-renderable things which include coordinate systems such as 'tip', 'base', a neutral controller agnostic hand-pose
23482379
* If all controller components are enumerated and rendered, it will be equivalent to drawing the traditional render model
2349-
* Returns 0 if components not supported, >0 otherwise
2350-
*/
2380+
* Returns 0 if components not supported, >0 otherwise */
23512381
virtual uint32_t GetComponentCount( const char *pchRenderModelName ) = 0;
23522382

23532383
/** Use this to get the names of available components. Index does not correlate to a tracked device index, but
@@ -2373,15 +2403,14 @@ class IVRRenderModels
23732403
*
23742404
* If the pchRenderModelName or pchComponentName is invalid, this will return false (and transforms will be set to identity).
23752405
* Otherwise, return true
2376-
* Note: For dynamic objects, visibility may be dynamic. (I.e., true/false will be returned based on controller state ) */
2377-
virtual bool GetComponentState( const char *pchRenderModelName, const char *pchComponentName, const vr::VRControllerState_t *pControllerState, RenderModel_ComponentState_t *pComponentState ) = 0;
2406+
* Note: For dynamic objects, visibility may be dynamic. (I.e., true/false will be returned based on controller state and controller mode state ) */
2407+
virtual bool GetComponentState( const char *pchRenderModelName, const char *pchComponentName, const vr::VRControllerState_t *pControllerState, const RenderModel_ControllerMode_State_t *pState, RenderModel_ComponentState_t *pComponentState ) = 0;
23782408

23792409
/** Returns true if the render model has a component with the specified name */
23802410
virtual bool RenderModelHasComponent( const char *pchRenderModelName, const char *pchComponentName ) = 0;
2381-
23822411
};
23832412

2384-
static const char * const IVRRenderModels_Version = "IVRRenderModels_002";
2413+
static const char * const IVRRenderModels_Version = "IVRRenderModels_004";
23852414

23862415
}
23872416

0 commit comments

Comments
 (0)