diff --git a/assets/openvr_api.dll b/assets/openvr_api.dll index 6b0c8fe..2df5818 100644 Binary files a/assets/openvr_api.dll and b/assets/openvr_api.dll differ diff --git a/src/Shared/lib/x64/openvr_api.lib b/src/Shared/lib/x64/openvr_api.lib index 3b95d6b..e4cc9b9 100644 Binary files a/src/Shared/lib/x64/openvr_api.lib and b/src/Shared/lib/x64/openvr_api.lib differ diff --git a/src/Shared/lib/x86/openvr_api.lib b/src/Shared/lib/x86/openvr_api.lib index b61a5a0..3a9a3c3 100644 Binary files a/src/Shared/lib/x86/openvr_api.lib and b/src/Shared/lib/x86/openvr_api.lib differ diff --git a/src/Shared/openvr.h b/src/Shared/openvr.h index e3f7c16..df73184 100644 --- a/src/Shared/openvr.h +++ b/src/Shared/openvr.h @@ -12,38 +12,24 @@ // version.h + namespace vr { static const uint32_t k_nSteamVRVersionMajor = 1; - static const uint32_t k_nSteamVRVersionMinor = 12; - static const uint32_t k_nSteamVRVersionBuild = 5; + static const uint32_t k_nSteamVRVersionMinor = 23; + static const uint32_t k_nSteamVRVersionBuild = 7; } // namespace vr -// vrtypes.h -#ifndef _INCLUDE_VRTYPES_H -#define _INCLUDE_VRTYPES_H +// public_vrtypes.h -// Forward declarations to avoid requiring vulkan.h -struct VkDevice_T; -struct VkPhysicalDevice_T; -struct VkInstance_T; -struct VkQueue_T; - -// Forward declarations to avoid requiring d3d12.h -struct ID3D12Resource; -struct ID3D12CommandQueue; +#ifndef _INCLUDE_CORE_VRTYPES_PUBLIC_H +#define _INCLUDE_CORE_VRTYPES_PUBLIC_H namespace vr { #pragma pack( push, 8 ) -/** A handle for a spatial anchor. This handle is only valid during the session it was created in. -* Anchors that live beyond one session should be saved by their string descriptors. */ -typedef uint32_t SpatialAnchorHandle_t; - -typedef void* glSharedTextureHandle_t; -typedef int32_t glInt_t; -typedef uint32_t glUInt_t; +typedef uint32_t PropertyTypeTag_t; // right-handed system // +y is up @@ -111,8 +97,49 @@ struct HmdRect2_t HmdVector2_t vBottomRight; }; -/** Used to return the post-distortion UVs for each color channel. -* UVs range from 0 to 1 with 0,0 in the upper left corner of the +/** Holds the transform for a single bone */ +struct VRBoneTransform_t +{ + HmdVector4_t position; + HmdQuaternionf_t orientation; +}; + +#pragma pack( pop ) + +} // namespace vr + +#endif + +// vrtypes.h + +#ifndef _INCLUDE_VRTYPES_H +#define _INCLUDE_VRTYPES_H + +// Forward declarations to avoid requiring vulkan.h +struct VkDevice_T; +struct VkPhysicalDevice_T; +struct VkInstance_T; +struct VkQueue_T; + +// Forward declarations to avoid requiring d3d12.h +struct ID3D12Resource; +struct ID3D12CommandQueue; + +namespace vr +{ +#pragma pack( push, 8 ) + +/** A handle for a spatial anchor. This handle is only valid during the session it was created in. +* Anchors that live beyond one session should be saved by their string descriptors. */ +typedef uint32_t SpatialAnchorHandle_t; + +typedef void* glSharedTextureHandle_t; +typedef int32_t glInt_t; +typedef uint32_t glUInt_t; + + +/** Used to return the post-distortion UVs for each color channel. +* UVs range from 0 to 1 with 0,0 in the upper left corner of the * source render target. The 0,0 to 1,1 range covers a single eye. */ struct DistortionCoordinates_t { @@ -135,7 +162,7 @@ enum ETextureType TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef, deprecated in favor of TextureType_Metal on supported platforms TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure - TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets. + TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets. // this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it TextureType_Metal = 6, // Handle is a MTLTexture conforming to the MTLSharedTexture protocol. Textures submitted to IVRCompositor::Submit which // are of type MTLTextureType2DArray assume layer 0 is the left eye texture (vr::EVREye::Eye_left), layer 1 is the right @@ -362,14 +389,16 @@ enum ETrackedDeviceProperty Prop_ManufacturerSerialNumber_String = 1049, Prop_ComputedSerialNumber_String = 1050, Prop_EstimatedDeviceFirstUseTime_Int32 = 1051, + Prop_DevicePowerUsage_Float = 1052, + Prop_IgnoreMotionForStandby_Bool = 1053, // Properties that are unique to TrackedDeviceClass_HMD Prop_ReportsTimeSinceVSync_Bool = 2000, Prop_SecondsFromVsyncToPhotons_Float = 2001, Prop_DisplayFrequency_Float = 2002, Prop_UserIpdMeters_Float = 2003, - Prop_CurrentUniverseId_Uint64 = 2004, - Prop_PreviousUniverseId_Uint64 = 2005, + Prop_CurrentUniverseId_Uint64 = 2004, + Prop_PreviousUniverseId_Uint64 = 2005, Prop_DisplayFirmwareVersion_Uint64 = 2006, Prop_IsOnDesktop_Bool = 2007, Prop_DisplayMCType_Int32 = 2008, @@ -441,7 +470,7 @@ enum ETrackedDeviceProperty Prop_DriverProvidedChaperoneVisibility_Bool = 2076, Prop_HmdColumnCorrectionSettingPrefix_String = 2077, Prop_CameraSupportsCompatibilityModes_Bool = 2078, - + Prop_SupportsRoomViewDepthProjection_Bool = 2079, Prop_DisplayAvailableFrameRates_Float_Array = 2080, // populated by compositor from actual EDID list when available from GPU driver Prop_DisplaySupportsMultipleFramerates_Bool = 2081, // if this is true but Prop_DisplayAvailableFrameRates_Float_Array is empty, explain to user Prop_DisplayColorMultLeft_Vector3 = 2082, @@ -450,11 +479,19 @@ enum ETrackedDeviceProperty Prop_DisplaySupportsAnalogGain_Bool = 2085, Prop_DisplayMinAnalogGain_Float = 2086, Prop_DisplayMaxAnalogGain_Float = 2087, - + Prop_CameraExposureTime_Float = 2088, + Prop_CameraGlobalGain_Float = 2089, // Prop_DashboardLayoutPathName_String = 2090, // DELETED Prop_DashboardScale_Float = 2091, + Prop_PeerButtonInfo_String = 2092, + Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, + Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, + Prop_Hmd_SupportsMicMonitoring_Bool = 2103, + Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = 2104, + Prop_SupportsRoomViewDirect_Bool = 2105, + Prop_SupportsAppThrottling_Bool = 2106, // Driver requested mura correction properties Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, @@ -469,7 +506,8 @@ enum ETrackedDeviceProperty Prop_Audio_DefaultPlaybackDeviceId_String = 2300, Prop_Audio_DefaultRecordingDeviceId_String = 2301, - Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, + Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302, + Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -528,7 +566,7 @@ enum ETrackedDeviceProperty // Vendors are free to expose private debug data in this reserved region Prop_VendorSpecific_Reserved_Start = 10000, Prop_VendorSpecific_Reserved_End = 10999, - + Prop_TrackedDeviceProperty_Max = 1000000, }; @@ -637,10 +675,18 @@ enum EVRSubmitFlags // Set to indicate that pTexture->handle is a contains VRVulkanTextureArrayData_t Submit_VulkanTextureWithArrayData = 0x40, + + // If the texture pointer passed in is an OpenGL Array texture, set this flag + Submit_GlArrayTexture = 0x80, + + // Do not use + Submit_Reserved2 = 0x08000, + Submit_Reserved3 = 0x10000, + }; /** Data required for passing Vulkan textures to IVRCompositor::Submit. -* Be sure to call OpenVR_Shutdown before destroying these resources. +* Be sure to call OpenVR_Shutdown before destroying these resources. * Please see https://github.com/ValveSoftware/openvr/wiki/Vulkan for Vulkan-specific documentation */ struct VRVulkanTextureData_t { @@ -654,7 +700,7 @@ struct VRVulkanTextureData_t }; /** Data required for passing Vulkan texture arrays to IVRCompositor::Submit. -* Be sure to call OpenVR_Shutdown before destroying these resources. +* Be sure to call OpenVR_Shutdown before destroying these resources. * Please see https://github.com/ValveSoftware/openvr/wiki/Vulkan for Vulkan-specific documentation */ struct VRVulkanTextureArrayData_t : public VRVulkanTextureData_t { @@ -717,7 +763,7 @@ enum EVREventType // VREvent_DualAnalog_Move = 254, // No longer sent // VREvent_DualAnalog_ModeSwitch1 = 255, // No longer sent // VREvent_DualAnalog_ModeSwitch2 = 256, // No longer sent - VREvent_Modal_Cancel = 257, // Sent to overlays with the + VREvent_Modal_Cancel = 257, // Sent to overlays with the VREvent_MouseMove = 300, // data is mouse VREvent_MouseButtonDown = 301, // data is mouse @@ -727,7 +773,7 @@ enum EVREventType VREvent_ScrollDiscrete = 305, // data is scroll VREvent_TouchPadMove = 306, // data is mouse VREvent_OverlayFocusChanged = 307, // data is overlay, global event - VREvent_ReloadOverlays = 308, + VREvent_ReloadOverlays = 308, VREvent_ScrollSmooth = 309, // data is scroll VREvent_LockMousePosition = 310, VREvent_UnlockMousePosition = 311, @@ -784,6 +830,13 @@ enum EVREventType VREvent_RoomViewHidden = 527, // Sent by compositor whenever room-view is disabled VREvent_ShowUI = 528, // data is showUi VREvent_ShowDevTools = 529, // data is showDevTools + VREvent_DesktopViewUpdating = 530, + VREvent_DesktopViewReady = 531, + + VREvent_StartDashboard = 532, + VREvent_ElevatePrism = 533, + + VREvent_OverlayClosed = 534, VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, @@ -796,6 +849,7 @@ enum EVREventType VREvent_QuitAcknowledged = 703, // data is process VREvent_DriverRequestedQuit = 704, // The driver has requested that SteamVR shut down VREvent_RestartRequested = 705, // A driver or other component wants the user to restart SteamVR + VREvent_InvalidateSwapTextureSets = 706, VREvent_ChaperoneDataHasChanged = 800, // this will never happen with the new chaperone system VREvent_ChaperoneUniverseHasChanged = 801, @@ -805,6 +859,7 @@ enum EVREventType VREvent_ChaperoneFlushCache = 805, // Sent when the process needs to reload any cached data it retrieved from VRChaperone() VREvent_ChaperoneRoomSetupStarting = 806, // Triggered by CVRChaperoneClient::RoomSetupStarting VREvent_ChaperoneRoomSetupFinished = 807, // Triggered by CVRChaperoneClient::CommitWorkingCopy + VREvent_StandingZeroPoseReset = 808, VREvent_AudioSettingsHaveChanged = 820, @@ -865,6 +920,7 @@ enum EVREventType VREvent_Compositor_OutOfVideoMemory = 1417, VREvent_Compositor_DisplayModeNotSupported = 1418, // k_pch_SteamVR_PreferredRefreshRate VREvent_Compositor_StageOverrideReady = 1419, + VREvent_Compositor_RequestDisconnectReconnect = 1420, VREvent_TrackedCamera_StartVideoStream = 1500, VREvent_TrackedCamera_StopVideoStream = 1501, @@ -878,7 +934,7 @@ enum EVREventType VREvent_MessageOverlay_Closed = 1650, VREvent_MessageOverlayCloseRequested = 1651, - + VREvent_Input_HapticVibration = 1700, // data is hapticVibration VREvent_Input_BindingLoadFailed = 1701, // data is inputBinding VREvent_Input_BindingLoadSuccessful = 1702, // data is inputBinding @@ -911,10 +967,10 @@ enum EVREventType // 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_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 = 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) k_EDeviceActivityLevel_Idle_Timeout = 4, @@ -932,7 +988,7 @@ enum EVRButtonId k_EButton_DPad_Right = 5, k_EButton_DPad_Down = 6, k_EButton_A = 7, - + k_EButton_ProximitySensor = 31, k_EButton_Axis0 = 32, @@ -1031,6 +1087,7 @@ struct VREvent_Overlay_t { uint64_t overlayHandle; uint64_t devicePath; + uint64_t memoryBlockId; }; @@ -1229,9 +1286,9 @@ typedef union } VREvent_Data_t; -#if defined(__linux__) || defined(__APPLE__) -// This structure was originally defined mis-packed on Linux, preserved for -// compatibility. +#if defined(__linux__) || defined(__APPLE__) +// This structure was originally defined mis-packed on Linux, preserved for +// compatibility. #pragma pack( push, 4 ) #endif @@ -1245,7 +1302,7 @@ struct VREvent_t VREvent_Data_t data; }; -#if defined(__linux__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) #pragma pack( pop ) #endif @@ -1314,9 +1371,9 @@ enum EVRSpatialAnchorError VRSpatialAnchorError_UnknownDriver = 13, }; -/** The mesh to draw into the stencil (or depth) buffer to perform +/** The mesh to draw into the stencil (or depth) buffer to perform * early stencil (or depth) kills of pixels that will never appear on the HMD. -* This mesh draws on all the pixels that will be hidden after distortion. +* This mesh draws on all the pixels that will be hidden after distortion. * * If the HMD does not provide a visible area mesh pVertexData will be * NULL and unTriangleCount will be 0. */ @@ -1337,7 +1394,7 @@ enum EHiddenAreaMeshType }; -/** Identifies what kind of axis is on the controller at index n. Read this type +/** Identifies what kind of axis is on the controller at index n. Read this type * with pVRSystem->Get( nControllerDeviceIndex, Prop_Axis0Type_Int32 + n ); */ enum EVRControllerAxisType @@ -1361,16 +1418,16 @@ 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. +#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 { - // If packet num matches that on your prior call, then the controller state hasn't been changed since + // If packet num matches that on your prior call, then the controller state hasn't been changed since // your last call and there is no need to process it uint32_t unPacketNum; @@ -1381,7 +1438,7 @@ struct VRControllerState001_t // Axis data for the controller's analog inputs VRControllerAxis_t rAxis[ k_unControllerStateAxisCount ]; }; -#if defined(__linux__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) #pragma pack( pop ) #endif @@ -1443,14 +1500,15 @@ enum EVROverlayError VROverlayError_TextureAlreadyLocked = 31, VROverlayError_TextureLockCapacityReached = 32, VROverlayError_TextureNotLocked = 33, + VROverlayError_TimedOut = 34, }; -/** enum values to pass in to VR_Init to identify whether the application will +/** enum values to pass in to VR_Init to identify whether the application will * draw a 3D scene. */ enum EVRApplicationType { - VRApplication_Other = 0, // Some other kind of application that isn't covered by the other entries - VRApplication_Scene = 1, // Application will submit 3D frames + VRApplication_Other = 0, // Some other kind of application that isn't covered by the other entries + VRApplication_Scene = 1, // Application will submit 3D frames VRApplication_Overlay = 2, // Application only interacts with overlays VRApplication_Background = 3, // Application should not start SteamVR if it's not already running, and should not // keep it running if everything else quits. @@ -1460,11 +1518,35 @@ enum EVRApplicationType VRApplication_SteamWatchdog = 6,// Reserved for Steam VRApplication_Bootstrapper = 7, // reserved for vrstartup VRApplication_WebHelper = 8, // reserved for vrwebhelper + VRApplication_OpenXRInstance = 9, // reserved for openxr (created instance, but not session yet) + VRApplication_OpenXRScene = 10, // reserved for openxr (started session) + VRApplication_OpenXROverlay = 11, // reserved for openxr (started overlay session) + VRApplication_Prism = 12, // reserved for the vrprismhost process + VRApplication_RoomView = 13, // reserved for the RoomView process VRApplication_Max }; +/** returns true if the specified application type is one of the +* OpenXR types */ +inline bool IsOpenXRAppType( EVRApplicationType eType ) +{ + return eType == VRApplication_OpenXRInstance + || eType == VRApplication_OpenXRScene + || eType == VRApplication_OpenXROverlay; +} + + +/** returns true if the specified application type submits eye buffers */ +inline bool BAppTypeSubmitsEyeBuffers( EVRApplicationType eType ) +{ + return eType == VRApplication_Scene + || eType == VRApplication_OpenXRScene + || eType == VRApplication_RoomView; +} + + /** error codes for firmware */ enum EVRFirmwareError { @@ -1500,17 +1582,17 @@ enum EVRSkeletalMotionRange enum EVRSkeletalTrackingLevel { // body part location can't be directly determined by the device. Any skeletal pose provided by - // the device is estimated by assuming the position required to active buttons, triggers, joysticks, - // or other input sensors. + // the device is estimated by assuming the position required to active buttons, triggers, joysticks, + // or other input sensors. // E.g. Vive Controller, Gamepad VRSkeletalTracking_Estimated = 0, - // body part location can be measured directly but with fewer degrees of freedom than the actual body - // part. Certain body part positions may be unmeasured by the device and estimated from other input data. + // body part location can be measured directly but with fewer degrees of freedom than the actual body + // part. Certain body part positions may be unmeasured by the device and estimated from other input data. // E.g. Index Controllers, gloves that only measure finger curl VRSkeletalTracking_Partial = 1, - // Body part location can be measured directly throughout the entire range of motion of the body part. + // Body part location can be measured directly throughout the entire range of motion of the body part. // E.g. Mocap suit for the full body, gloves that measure rotation of each finger segment VRSkeletalTracking_Full = 2, @@ -1519,14 +1601,6 @@ enum EVRSkeletalTrackingLevel }; - -/** Holds the transform for a single bone */ -struct VRBoneTransform_t -{ - HmdVector4_t position; - HmdQuaternionf_t orientation; -}; - /** Type used for referring to bones by their index */ typedef int32_t BoneIndex_t; const BoneIndex_t k_unInvalidBoneIndex = -1; @@ -1557,8 +1631,8 @@ enum EVRInitError VRInitError_Init_AppInfoInitFailed = 114, VRInitError_Init_Retry = 115, // Used internally to cause retries to vrserver VRInitError_Init_InitCanceledByUser = 116, // The calling application should silently exit. The user canceled app startup - VRInitError_Init_AnotherAppLaunching = 117, - VRInitError_Init_SettingsInitFailed = 118, + VRInitError_Init_AnotherAppLaunching = 117, + VRInitError_Init_SettingsInitFailed = 118, VRInitError_Init_ShuttingDown = 119, VRInitError_Init_TooManyObjects = 120, VRInitError_Init_NoServerForBackgroundApp = 121, @@ -1569,7 +1643,7 @@ enum EVRInitError VRInitError_Init_HmdNotFoundPresenceFailed = 126, VRInitError_Init_VRMonitorNotFound = 127, VRInitError_Init_VRMonitorStartupFailed = 128, - VRInitError_Init_LowPowerWatchdogNotSupported = 129, + VRInitError_Init_LowPowerWatchdogNotSupported = 129, VRInitError_Init_InvalidApplicationType = 130, VRInitError_Init_NotAvailableToWatchdogApps = 131, VRInitError_Init_WatchdogDisabledInSettings = 132, @@ -1587,6 +1661,27 @@ enum EVRInitError VRInitError_Init_FailedForVrMonitor = 144, VRInitError_Init_PropertyManagerInitFailed = 145, VRInitError_Init_WebServerFailed = 146, + VRInitError_Init_IllegalTypeTransition = 147, + VRInitError_Init_MismatchedRuntimes = 148, + VRInitError_Init_InvalidProcessId = 149, + VRInitError_Init_VRServiceStartupFailed = 150, + VRInitError_Init_PrismNeedsNewDrivers = 151, + VRInitError_Init_PrismStartupTimedOut = 152, + VRInitError_Init_CouldNotStartPrism = 153, + VRInitError_Init_PrismClientInitFailed = 154, + VRInitError_Init_PrismClientStartFailed = 155, + VRInitError_Init_PrismExitedUnexpectedly = 156, + VRInitError_Init_BadLuid = 157, + VRInitError_Init_NoServerForAppContainer = 158, + VRInitError_Init_DuplicateBootstrapper = 159, + VRInitError_Init_VRDashboardServicePending = 160, + VRInitError_Init_VRDashboardServiceTimeout = 161, + VRInitError_Init_VRDashboardServiceStopped = 162, + VRInitError_Init_VRDashboardAlreadyStarted = 163, + VRInitError_Init_VRDashboardCopyFailed = 164, + VRInitError_Init_VRDashboardTokenFailure = 165, + VRInitError_Init_VRDashboardEnvironmentFailure = 166, + VRInitError_Init_VRDashboardPathFailure = 167, VRInitError_Driver_Failed = 200, VRInitError_Driver_Unknown = 201, @@ -1602,6 +1697,9 @@ enum EVRInitError VRInitError_Driver_HmdDriverIdOutOfBounds = 211, VRInitError_Driver_HmdDisplayMirrored = 212, VRInitError_Driver_HmdDisplayNotFoundLaptop = 213, + VRInitError_Driver_PeerDriverNotInstalled = 214, + VRInitError_Driver_WirelessHmdNotConnected = 215, + // Never make error 259 because we return it from main and it would conflict with STILL_ACTIVE VRInitError_IPC_ServerInitFailed = 300, @@ -1707,9 +1805,15 @@ enum EVRInitError VRInitError_Compositor_CreateOverlayInvalidCall = 488, VRInitError_Compositor_CreateOverlayAlreadyInitialized = 489, VRInitError_Compositor_FailedToCreateMailbox = 490, - + VRInitError_Compositor_WindowInterfaceIsNull = 491, + VRInitError_Compositor_SystemLayerCreateInstance = 492, + VRInitError_Compositor_SystemLayerCreateSession = 493, + VRInitError_Compositor_CreateInverseDistortUVs = 494, + VRInitError_Compositor_CreateBackbufferDepth = 495, + VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = 1000, VRInitError_VendorSpecific_WindowsNotInDevMode = 1001, + VRInitError_VendorSpecific_OculusLinkNotEnabled = 1002, VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101, VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102, @@ -1725,6 +1829,7 @@ enum EVRInitError VRInitError_VendorSpecific_HmdFound_UserDataError = 1112, VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113, VRInitError_VendorSpecific_OculusRuntimeBadInstall = 1114, + VRInitError_VendorSpecific_HmdFound_UnexpectedConfiguration_1 = 1115, VRInitError_Steam_SteamInstallationNotFound = 2000, @@ -1752,7 +1857,7 @@ enum EVRTrackedCameraError { VRTrackedCameraError_None = 0, VRTrackedCameraError_OperationFailed = 100, - VRTrackedCameraError_InvalidHandle = 101, + VRTrackedCameraError_InvalidHandle = 101, VRTrackedCameraError_InvalidFrameHeaderVersion = 102, VRTrackedCameraError_OutOfHandles = 103, VRTrackedCameraError_IPCFailure = 104, @@ -1776,7 +1881,7 @@ enum EVRTrackedCameraFrameLayout EVRTrackedCameraFrameLayout_VerticalLayout = 0x0010, // Stereo frames are Top/Bottom (left/right) EVRTrackedCameraFrameLayout_HorizontalLayout = 0x0020, // Stereo frames are Left/Right }; - + enum EVRTrackedCameraFrameType { VRTrackedCameraFrameType_Distorted = 0, // This is the camera video frame size in pixels, still distorted. @@ -1809,7 +1914,7 @@ struct CameraVideoStreamFrameHeader_t uint32_t nFrameSequence; TrackedDevicePose_t trackedDevicePose; - + uint64_t ulFrameExposureTime; // mid-point of the exposure of the image in host system ticks }; @@ -1830,18 +1935,18 @@ const uint32_t VRCompositor_ReprojectionAsync = 0x04; // This flag indicates the const uint32_t VRCompositor_ReprojectionMotion = 0x08; // This flag indicates whether or not motion smoothing was triggered for this frame -const uint32_t VRCompositor_PredictionMask = 0x30; // The runtime may predict more than one frame (up to four) ahead if +const uint32_t VRCompositor_PredictionMask = 0xF0; // The runtime may predict more than one frame (up to four) ahead if // it detects the application is taking too long to render. These two // bits will contain the count of additional frames (normally zero). // Use the VR_COMPOSITOR_ADDITIONAL_PREDICTED_FRAMES macro to read from // the latest frame timing entry. -const uint32_t VRCompositor_ThrottleMask = 0xC0; // Number of frames the compositor is throttling the application. +const uint32_t VRCompositor_ThrottleMask = 0xF00; // Number of frames the compositor is throttling the application. // Use the VR_COMPOSITOR_NUMBER_OF_THROTTLED_FRAMES macro to read from // the latest frame timing entry. #define VR_COMPOSITOR_ADDITIONAL_PREDICTED_FRAMES( timing ) ( ( ( timing ).m_nReprojectionFlags & vr::VRCompositor_PredictionMask ) >> 4 ) -#define VR_COMPOSITOR_NUMBER_OF_THROTTLED_FRAMES( timing ) ( ( ( timing ).m_nReprojectionFlags & vr::VRCompositor_ThrottleMask ) >> 6 ) +#define VR_COMPOSITOR_NUMBER_OF_THROTTLED_FRAMES( timing ) ( ( ( timing ).m_nReprojectionFlags & vr::VRCompositor_ThrottleMask ) >> 8 ) /** Provides a single frame's timing information to the app */ struct Compositor_FrameTiming @@ -1933,7 +2038,7 @@ enum Imu_OffScaleFlags OffScale_GyroY = 0x10, OffScale_GyroZ = 0x20, }; - + struct ImuSample_t { double fSampleTime; @@ -1962,7 +2067,7 @@ struct ImuSample_t #ifdef VR_API_EXPORT #define VR_INTERFACE extern "C" __attribute__((visibility("default"))) #else - #define VR_INTERFACE extern "C" + #define VR_INTERFACE extern "C" #endif #else @@ -1973,15 +2078,14 @@ struct ImuSample_t #if defined( _WIN32 ) #define VR_CALLTYPE __cdecl #else - #define VR_CALLTYPE + #define VR_CALLTYPE #endif } // namespace vr - #endif // _INCLUDE_VRTYPES_H - // vrannotation.h + #ifdef API_GEN # define VR_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) #else @@ -2001,6 +2105,7 @@ struct ImuSample_t #define VR_OUT_STRING_COUNT(COUNTER) VR_CLANG_ATTR( "out_string_count:" #COUNTER ";" ) // ivrsystem.h + namespace vr { @@ -2023,20 +2128,20 @@ class IVRSystem * application is doing something fancy like infinite Z */ virtual void GetProjectionRaw( EVREye eEye, float *pfLeft, float *pfRight, float *pfTop, float *pfBottom ) = 0; - /** Gets the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in + /** Gets the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in * the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. * Returns true for success. Otherwise, returns false, and distortion coordinates are not suitable. */ virtual bool ComputeDistortion( EVREye eEye, float fU, float fV, DistortionCoordinates_t *pDistortionCoordinates ) = 0; /** Returns the transform from eye space to the head space. Eye space is the per-eye flavor of head - * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. - * Normally View and Eye^-1 will be multiplied together and treated as View in your application. + * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. + * Normally View and Eye^-1 will be multiplied together and treated as View in your application. */ virtual HmdMatrix34_t GetEyeToHeadTransform( EVREye eEye ) = 0; - /** Returns the number of elapsed seconds since the last recorded vsync event. This + /** Returns the number of elapsed seconds since the last recorded vsync event. This * will come from a vsync timer event in the timer if possible or from the application-reported - * time if that is not available. If no vsync times are available the function will + * time if that is not available. If no vsync times are available the function will * return zero for vsync time and frame counter and return false from the method. */ virtual bool GetTimeSinceLastVsync( float *pfSecondsSinceLastVsync, uint64_t *pulFrameCounter ) = 0; @@ -2047,11 +2152,11 @@ class IVRSystem virtual int32_t GetD3D9AdapterIndex() = 0; /** [D3D10/11 Only] - * Returns the adapter index that the user should pass into EnumAdapters to create the device + * Returns the adapter index that the user should pass into EnumAdapters to create the device * and swap chain in DX10 and DX11. If an error occurs the index will be set to -1. */ virtual void GetDXGIOutputInfo( int32_t *pnAdapterIndex ) = 0; - + /** * Returns platform- and texture-type specific adapter identification so that applications and the * compositor are creating textures and swap chains on the same GPU. If an error occurs the device @@ -2090,41 +2195,30 @@ class IVRSystem // Tracking Methods // ------------------------------------ - /** The pose that the tracker thinks that the HMD will be in at the specified number of seconds into the + /** The pose that the tracker thinks that the HMD will be in at the specified number of seconds into the * future. Pass 0 to get the state at the instant the method is called. Most of the time the application should * calculate the time until the photons will be emitted from the display and pass that time into the method. * - * This is roughly analogous to the inverse of the view matrix in most applications, though + * This is roughly analogous to the inverse of the view matrix in most applications, though * many games will need to do some additional rotation or translation on top of the rotation * and translation provided by the head pose. * * For devices where bPoseIsValid is true the application can use the pose to position the device - * in question. The provided array can be any size up to k_unMaxTrackedDeviceCount. + * in question. The provided array can be any size up to k_unMaxTrackedDeviceCount. * * Seated experiences should call this method with TrackingUniverseSeated and receive poses relative - * to the seated zero pose. Standing experiences should call this method with TrackingUniverseStanding - * and receive poses relative to the Chaperone Play Area. TrackingUniverseRawAndUncalibrated should + * to the seated zero pose. Standing experiences should call this method with TrackingUniverseStanding + * and receive poses relative to the Chaperone Play Area. TrackingUniverseRawAndUncalibrated should * probably not be used unless the application is the Chaperone calibration tool itself, but will provide * poses relative to the hardware-specific coordinate system in the driver. */ virtual void GetDeviceToAbsoluteTrackingPose( ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, VR_ARRAY_COUNT(unTrackedDevicePoseArrayCount) TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount ) = 0; - /** Sets the zero pose for the seated tracker coordinate system to the current position and yaw of the HMD. After - * ResetSeatedZeroPose all GetDeviceToAbsoluteTrackingPose calls that pass TrackingUniverseSeated as the origin - * will be relative to this new zero pose. The new zero coordinate system will not change the fact that the Y axis - * is up in the real world, so the next pose returned from GetDeviceToAbsoluteTrackingPose after a call to - * ResetSeatedZeroPose may not be exactly an identity matrix. - * - * NOTE: This function overrides the user's previously saved seated zero pose and should only be called as the result of a user action. - * Users are also able to set their seated zero pose via the OpenVR Dashboard. - **/ - virtual void ResetSeatedZeroPose() = 0; - - /** Returns the transform from the seated zero pose to the standing absolute tracking system. This allows + /** Returns the transform from the seated zero pose to the standing absolute tracking system. This allows * applications to represent the seated origin to used or transform object positions from one coordinate - * system to the other. + * system to the other. * - * The seated origin may or may not be inside the Play Area or Collision Bounds returned by IVRChaperone. Its position + * The seated origin may or may not be inside the Play Area or Collision Bounds returned by IVRChaperone. Its position * depends on what the user has set from the Dashboard settings and previous calls to ResetSeatedZeroPose. */ virtual HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose() = 0; @@ -2157,10 +2251,10 @@ class IVRSystem /** Returns the device class of a tracked device. If there has not been a device connected in this slot * since the application started this function will return TrackedDevice_Invalid. For previous detected - * devices the function will return the previously observed device class. + * devices the function will return the previously observed device class. * * To determine which devices exist on the system, just loop from 0 to k_unMaxTrackedDeviceCount and check - * the device class. Every device with something other than TrackedDevice_Invalid is associated with an + * the device class. Every device with something other than TrackedDevice_Invalid is associated with an * actual tracked device. */ virtual ETrackedDeviceClass GetTrackedDeviceClass( vr::TrackedDeviceIndex_t unDeviceIndex ) = 0; @@ -2181,18 +2275,18 @@ class IVRSystem /** Returns a matrix property. If the device index is not valid or the property is not a matrix type, this function will return identity. */ virtual HmdMatrix34_t GetMatrix34TrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) = 0; - + /** Returns an array of one type of property. If the device index is not valid or the property is not a single value or an array of the specified type, * this function will return 0. Otherwise it returns the number of bytes necessary to hold the array of properties. If unBufferSize is * greater than the returned size and pBuffer is non-NULL, pBuffer is filled with the contents of array of properties. */ virtual uint32_t GetArrayTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, PropertyTypeTag_t propType, void *pBuffer, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L ) = 0; - /** Returns a string property. If the device index is not valid or the property is not a string type this function will + /** Returns a string property. If the device index is not valid or the property is not a string type this function will * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing * null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */ virtual uint32_t GetStringTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L ) = 0; - /** returns a string that corresponds with the specified property error. The string will be the name + /** returns a string that corresponds with the specified property error. The string will be the name * of the error enum value for all valid error codes */ virtual const char *GetPropErrorNameFromEnum( ETrackedPropertyError error ) = 0; @@ -2205,8 +2299,8 @@ class IVRSystem virtual bool PollNextEvent( VREvent_t *pEvent, uint32_t uncbVREvent ) = 0; /** 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. Fills in the pose of the associated tracked device in the provided pose struct. - * This pose will always be older than the call to this function and should not be used to render the device. + * this method returns false. Fills in the pose of the associated tracked device in the provided pose struct. + * This pose will always be older than the call to this function and should not be used to render the device. uncbVREvent should be the size in bytes of the VREvent_t struct */ virtual bool PollNextEventWithPose( ETrackingUniverseOrigin eOrigin, VREvent_t *pEvent, uint32_t uncbVREvent, vr::TrackedDevicePose_t *pTrackedDevicePose ) = 0; @@ -2219,7 +2313,7 @@ class IVRSystem /** Returns the hidden area mesh for the current HMD. The pixels covered by this mesh will never be seen by the user after the lens distortion is * applied based on visibility to the panels. If this HMD does not have a hidden area mesh, the vertex data and count will be NULL and 0 respectively. - * This mesh is meant to be rendered into the stencil buffer (or into the depth buffer setting nearz) before rendering each eye's view. + * This mesh is meant to be rendered into the stencil buffer (or into the depth buffer setting nearz) before rendering each eye's view. * This will improve performance by letting the GPU early-reject pixels the user will never see before running the pixel shader. * NOTE: Render this mesh with backface culling disabled since the winding order of the vertices can be different per-HMD or per-eye. * Setting the bInverse argument to true will produce the visible area mesh that is commonly used in place of full-screen quads. The visible area mesh covers all of the pixels the hidden area mesh does not cover. @@ -2235,7 +2329,7 @@ class IVRSystem * is invalid. This function is deprecated in favor of the new IVRInput system. */ virtual bool GetControllerState( vr::TrackedDeviceIndex_t unControllerDeviceIndex, vr::VRControllerState_t *pControllerState, uint32_t unControllerStateSize ) = 0; - /** fills the supplied struct with the current state of the controller and the provided pose with the pose of + /** fills the supplied struct with the current state of the controller and the provided pose with the pose of * the controller when the controller state was updated most recently. Use this form if you need a precise controller * pose as input to your application when the user presses or releases a button. This function is deprecated in favor of the new IVRInput system. */ virtual bool GetControllerStateWithPose( ETrackingUniverseOrigin eOrigin, vr::TrackedDeviceIndex_t unControllerDeviceIndex, vr::VRControllerState_t *pControllerState, uint32_t unControllerStateSize, TrackedDevicePose_t *pTrackedDevicePose ) = 0; @@ -2250,7 +2344,7 @@ class IVRSystem /** returns the name of an EVRControllerAxisType enum value. This function is deprecated in favor of the new IVRInput system. */ virtual const char *GetControllerAxisTypeNameFromEnum( EVRControllerAxisType eAxisType ) = 0; - /** Returns true if this application is receiving input from the system. This would return false if + /** Returns true if this application is receiving input from the system. This would return false if * system-related functionality is consuming the input stream. */ virtual bool IsInputAvailable() = 0; @@ -2269,11 +2363,11 @@ class IVRSystem // ------------------------------------ // Firmware methods // ------------------------------------ - - /** Performs the actual firmware update if applicable. - * The following events will be sent, if VRFirmwareError_None was returned: VREvent_FirmwareUpdateStarted, VREvent_FirmwareUpdateFinished + + /** Performs the actual firmware update if applicable. + * The following events will be sent, if VRFirmwareError_None was returned: VREvent_FirmwareUpdateStarted, VREvent_FirmwareUpdateFinished * Use the properties Prop_Firmware_UpdateAvailable_Bool, Prop_Firmware_ManualUpdate_Bool, and Prop_Firmware_ManualUpdateURL_String - * to figure our whether a firmware update is available, and to figure out whether its a manual update + * to figure our whether a firmware update is available, and to figure out whether its a manual update * Prop_Firmware_ManualUpdateURL_String should point to an URL describing the manual update process */ virtual vr::EVRFirmwareError PerformFirmwareUpdate( vr::TrackedDeviceIndex_t unDeviceIndex ) = 0; @@ -2289,7 +2383,7 @@ class IVRSystem // App container sandbox methods // ------------------------------------- - /** Retrieves a null-terminated, semicolon-delimited list of UTF8 file paths that an application + /** Retrieves a null-terminated, semicolon-delimited list of UTF8 file paths that an application * must have read access to when running inside of an app container. Returns the number of bytes * needed to hold the list. */ virtual uint32_t GetAppContainerFilePaths( VR_OUT_STRING() char *pchBuffer, uint32_t unBufferSize ) = 0; @@ -2307,12 +2401,13 @@ class IVRSystem }; -static const char * const IVRSystem_Version = "IVRSystem_021"; +static const char * const IVRSystem_Version = "IVRSystem_022"; } // ivrapplications.h + namespace vr { @@ -2327,13 +2422,13 @@ namespace vr VRApplicationError_InvalidIndex = 103, VRApplicationError_UnknownApplication = 104, // the application could not be found VRApplicationError_IPCFailed = 105, // An IPC failure caused the request to fail - VRApplicationError_ApplicationAlreadyRunning = 106, + VRApplicationError_ApplicationAlreadyRunning = 106, VRApplicationError_InvalidManifest = 107, VRApplicationError_InvalidApplication = 108, VRApplicationError_LaunchFailed = 109, // the process didn't start VRApplicationError_ApplicationAlreadyStarting = 110, // the system was already starting the same application VRApplicationError_LaunchInProgress = 111, // The system was already starting a different application - VRApplicationError_OldApplicationQuitting = 112, + VRApplicationError_OldApplicationQuitting = 112, VRApplicationError_TransitionAborted = 113, VRApplicationError_IsTemplate = 114, // error when you try to call LaunchApplication() on a template type app (use LaunchTemplateApplication) VRApplicationError_SteamVRIsExiting = 115, @@ -2342,6 +2437,8 @@ namespace vr VRApplicationError_PropertyNotSet = 201, // The requested property was not set VRApplicationError_UnknownProperty = 202, VRApplicationError_InvalidParameter = 203, + + VRApplicationError_NotImplemented = 300, // Fcn is not implemented in current interface }; /** The maximum length of an application key */ @@ -2399,7 +2496,7 @@ namespace vr // --------------- Application management --------------- // - /** Adds an application manifest to the list to load when building the list of installed applications. + /** Adds an application manifest to the list to load when building the list of installed applications. * Temporary manifests are not automatically loaded */ virtual EVRApplicationError AddApplicationManifest( const char *pchApplicationManifestFullPath, bool bTemporary = false ) = 0; @@ -2412,12 +2509,12 @@ namespace vr /** Returns the number of applications available in the list */ virtual uint32_t GetApplicationCount() = 0; - /** Returns the key of the specified application. The index is at least 0 and is less than the return - * value of GetApplicationCount(). The buffer should be at least k_unMaxApplicationKeyLength in order to + /** Returns the key of the specified application. The index is at least 0 and is less than the return + * value of GetApplicationCount(). The buffer should be at least k_unMaxApplicationKeyLength in order to * fit the key. */ virtual EVRApplicationError GetApplicationKeyByIndex( uint32_t unApplicationIndex, VR_OUT_STRING() char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; - /** Returns the key of the application for the specified Process Id. The buffer should be at least + /** Returns the key of the application for the specified Process Id. The buffer should be at least * k_unMaxApplicationKeyLength in order to fit the key. */ virtual EVRApplicationError GetApplicationKeyByProcessId( uint32_t unProcessId, VR_OUT_STRING() char *pchAppKeyBuffer, uint32_t unAppKeyBufferLen ) = 0; @@ -2433,7 +2530,7 @@ namespace vr /** launches the application currently associated with this mime type and passes it the option args, typically the filename or object name of the item being launched */ virtual vr::EVRApplicationError LaunchApplicationFromMimeType( const char *pchMimeType, const char *pchArgs ) = 0; - /** Launches the dashboard overlay application if it is not already running. This call is only valid for + /** Launches the dashboard overlay application if it is not already running. This call is only valid for * dashboard overlay applications. */ virtual EVRApplicationError LaunchDashboardOverlay( const char *pchAppKey ) = 0; @@ -2441,8 +2538,8 @@ namespace vr virtual bool CancelApplicationLaunch( const char *pchAppKey ) = 0; /** Identifies a running application. OpenVR can't always tell which process started in response - * to a URL. This function allows a URL handler (or the process itself) to identify the app key - * for the now running application. Passing a process ID of 0 identifies the calling process. + * to a URL. This function allows a URL handler (or the process itself) to identify the app key + * for the now running application. Passing a process ID of 0 identifies the calling process. * The application must be one that's known to the system via a call to AddApplicationManifest. */ virtual EVRApplicationError IdentifyApplication( uint32_t unProcessId, const char *pchAppKey ) = 0; @@ -2507,9 +2604,9 @@ namespace vr virtual const char *GetSceneApplicationStateNameFromEnum( EVRSceneApplicationState state ) = 0; /** Starts a subprocess within the calling application. This - * suppresses all application transition UI and automatically identifies the new executable - * as part of the same application. On success the calling process should exit immediately. - * If working directory is NULL or "" the directory portion of the binary path will be + * suppresses all application transition UI and automatically identifies the new executable + * as part of the same application. On success the calling process should exit immediately. + * If working directory is NULL or "" the directory portion of the binary path will be * the working directory. */ virtual EVRApplicationError LaunchInternalProcess( const char *pchBinaryPath, const char *pchArguments, const char *pchWorkingDirectory ) = 0; @@ -2524,6 +2621,7 @@ namespace vr } // namespace vr // ivrsettings.h + #include namespace vr @@ -2569,14 +2667,14 @@ namespace vr { IVRSettings *m_pSettings; public: - CVRSettingHelper( IVRSettings *pSettings ) - { - m_pSettings = pSettings; + CVRSettingHelper( IVRSettings *pSettings ) + { + m_pSettings = pSettings; } - const char *GetSettingsErrorNameFromEnum( EVRSettingsError eError ) - { - return m_pSettings->GetSettingsErrorNameFromEnum( eError ); + const char *GetSettingsErrorNameFromEnum( EVRSettingsError eError ) + { + return m_pSettings->GetSettingsErrorNameFromEnum( eError ); } void SetBool( const char *pchSection, const char *pchSettingsKey, bool bValue, EVRSettingsError *peError = nullptr ) @@ -2662,6 +2760,7 @@ namespace vr static const char * const k_pch_SteamVR_PlayAreaColor_String = "playAreaColor"; static const char * const k_pch_SteamVR_TrackingLossColor_String = "trackingLossColor"; static const char * const k_pch_SteamVR_ShowStage_Bool = "showStage"; + static const char * const k_pch_SteamVR_DrawTrackingReferences_Bool = "drawTrackingReferences"; static const char * const k_pch_SteamVR_ActivateMultipleDrivers_Bool = "activateMultipleDrivers"; static const char * const k_pch_SteamVR_UsingSpeakers_Bool = "usingSpeakers"; static const char * const k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = "speakersForwardYawOffsetDegrees"; @@ -2672,6 +2771,10 @@ namespace vr static const char * const k_pch_SteamVR_MaxRecommendedResolution_Int32 = "maxRecommendedResolution"; static const char * const k_pch_SteamVR_MotionSmoothing_Bool = "motionSmoothing"; static const char * const k_pch_SteamVR_MotionSmoothingOverride_Int32 = "motionSmoothingOverride"; + static const char * const k_pch_SteamVR_FramesToThrottle_Int32 = "framesToThrottle"; + static const char * const k_pch_SteamVR_AdditionalFramesToPredict_Int32 = "additionalFramesToPredict"; + static const char * const k_pch_SteamVR_WorldScale_Float = "worldScale"; + static const char * const k_pch_SteamVR_FovScale_Int32 = "fovScale"; static const char * const k_pch_SteamVR_DisableAsyncReprojection_Bool = "disableAsync"; static const char * const k_pch_SteamVR_ForceFadeOnBadTracking_Bool = "forceFadeOnBadTracking"; static const char * const k_pch_SteamVR_DefaultMirrorView_Int32 = "mirrorView"; @@ -2714,6 +2817,9 @@ namespace vr static const char * const k_pch_SteamVR_OverlayRenderQuality = "overlayRenderQuality_2"; static const char * const k_pch_SteamVR_BlockOculusSDKOnOpenVRLaunchOption_Bool = "blockOculusSDKOnOpenVRLaunchOption"; static const char * const k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool = "blockOculusSDKOnAllLaunches"; + static const char * const k_pch_SteamVR_HDCPLegacyCompatibility_Bool = "hdcp14legacyCompatibility"; + static const char * const k_pch_SteamVR_DisplayPortTrainingMode_Int = "displayPortTrainingMode"; + static const char * const k_pch_SteamVR_UsePrism_Bool = "usePrism"; //----------------------------------------------------------------------------- // direct mode keys @@ -2809,15 +2915,15 @@ namespace vr // camera keys static const char * const k_pch_Camera_Section = "camera"; static const char * const k_pch_Camera_EnableCamera_Bool = "enableCamera"; - static const char * const k_pch_Camera_EnableCameraInDashboard_Bool = "enableCameraInDashboard"; + static const char * const k_pch_Camera_ShowOnController_Bool = "showOnController"; static const char * const k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds"; - static const char * const k_pch_Camera_EnableCameraForRoomView_Bool = "enableCameraForRoomView"; + static const char * const k_pch_Camera_RoomView_Int32 = "roomView"; static const char * const k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR"; static const char * const k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG"; static const char * const k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; static const char * const k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; static const char * const k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; - static const char * const k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; + static const char * const k_pch_Camera_RoomViewStyle_Int32 = "roomViewStyle"; //----------------------------------------------------------------------------- // audio keys @@ -2838,6 +2944,8 @@ namespace vr static const char * const k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume"; static const char * const k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; static const char * const k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; + static const char * const k_pch_audio_DualSpeakerAndJackOutput_Bool = "dualSpeakerAndJackOutput"; + static const char * const k_pch_audio_MuteMicMonitor_Bool = "muteMicMonitor"; //----------------------------------------------------------------------------- // power management keys @@ -2857,6 +2965,8 @@ namespace vr static const char * const k_pch_Dashboard_Position = "position"; static const char * const k_pch_Dashboard_DesktopScale = "desktopScale"; static const char * const k_pch_Dashboard_DashboardScale = "dashboardScale"; + static const char * const k_pch_Dashboard_UseStandaloneSystemLayer = "standaloneSystemLayer"; + static const char * const k_pch_Dashboard_StickyDashboard = "stickyDashboard"; //----------------------------------------------------------------------------- // model skin keys @@ -2926,6 +3036,7 @@ namespace vr } // namespace vr // ivrchaperone.h + namespace vr { @@ -2962,7 +3073,7 @@ class IVRChaperone /** Get the current state of Chaperone calibration. This state can change at any time during a session due to physical base station changes. **/ virtual ChaperoneCalibrationState GetCalibrationState() = 0; - /** Returns the width and depth of the Play Area (formerly named Soft Bounds) in X and Z. + /** Returns the width and depth of the Play Area (formerly named Soft Bounds) in X and Z. * Tracking space center (0,0,0) is the center of the Play Area. **/ virtual bool GetPlayAreaSize( float *pSizeX, float *pSizeZ ) = 0; @@ -2988,15 +3099,27 @@ class IVRChaperone /** Force the bounds to show, mostly for utilities **/ virtual void ForceBoundsVisible( bool bForce ) = 0; + + /** Sets the zero pose for the given tracker coordinate system to the current position and yaw of the HMD. After + * ResetZeroPose all GetDeviceToAbsoluteTrackingPose calls as the origin will be relative to this new zero pose. + * The new zero coordinate system will not change the fact that the Y axis is up in the real world, so the next + * pose returned from GetDeviceToAbsoluteTrackingPose after a call to ResetZeroPose may not be exactly an + * identity matrix. + * + * NOTE: This function overrides the user's previously saved zero pose and should only be called as the result of a user action. + * Users are also able to set their zero pose via the OpenVR Dashboard. + **/ + virtual void ResetZeroPose( ETrackingUniverseOrigin eTrackingUniverseOrigin ) = 0; }; -static const char * const IVRChaperone_Version = "IVRChaperone_003"; +static const char * const IVRChaperone_Version = "IVRChaperone_004"; #pragma pack( pop ) } // ivrchaperonesetup.h + namespace vr { @@ -3011,9 +3134,9 @@ enum EChaperoneImportFlags EChaperoneImport_BoundsOnly = 0x0001, }; -/** Manages the working copy of the chaperone info. By default this will be the same as the -* live copy. Any changes made with this interface will stay in the working copy until -* CommitWorkingCopy() is called, at which point the working copy and the live copy will be +/** Manages the working copy of the chaperone info. By default this will be the same as the +* live copy. Any changes made with this interface will stay in the working copy until +* CommitWorkingCopy() is called, at which point the working copy and the live copy will be * the same again. */ class IVRChaperoneSetup { @@ -3039,11 +3162,11 @@ class IVRChaperoneSetup * Height of every corner is 0Y (on the floor). **/ virtual bool GetWorkingPlayAreaRect( HmdQuad_t *rect ) = 0; - /** Returns the number of Quads if the buffer points to null. Otherwise it returns Quads + /** Returns the number of Quads if the buffer points to null. Otherwise it returns Quads * into the buffer up to the max specified from the working copy. */ virtual bool GetWorkingCollisionBoundsInfo( VR_OUT_ARRAY_COUNT(punQuadsCount) HmdQuad_t *pQuadsBuffer, uint32_t* punQuadsCount ) = 0; - /** Returns the number of Quads if the buffer points to null. Otherwise it returns Quads + /** Returns the number of Quads if the buffer points to null. Otherwise it returns Quads * into the buffer up to the max specified. */ virtual bool GetLiveCollisionBoundsInfo( VR_OUT_ARRAY_COUNT(punQuadsCount) HmdQuad_t *pQuadsBuffer, uint32_t* punQuadsCount ) = 0; @@ -3095,6 +3218,7 @@ static const char * const IVRChaperoneSetup_Version = "IVRChaperoneSetup_006"; } // ivrcompositor.h + namespace vr { @@ -3251,7 +3375,7 @@ class IVRCompositor */ virtual EVRCompositorError Submit( EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t* pBounds = 0, EVRSubmitFlags nSubmitFlags = Submit_Default ) = 0; - /** Clears the frame that was sent with the last call to Submit. This will cause the + /** Clears the frame that was sent with the last call to Submit. This will cause the * compositor to show the grid until Submit is called again. */ virtual void ClearLastSubmittedFrame() = 0; @@ -3278,7 +3402,7 @@ class IVRCompositor virtual void GetCumulativeStats( Compositor_CumulativeStats *pStats, uint32_t nStatsSizeInBytes ) = 0; /** Fades the view on the HMD to the specified color. The fade will take fSeconds, and the color values are between - * 0.0 and 1.0. This color is faded on top of the scene based on the alpha parameter. Removing the fade color instantly + * 0.0 and 1.0. This color is faded on top of the scene based on the alpha parameter. Removing the fade color instantly * would be FadeToColor( 0.0, 0.0, 0.0, 0.0, 0.0 ). Values are in un-premultiplied alpha space. */ virtual void FadeToColor( float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground = false ) = 0; @@ -3286,7 +3410,7 @@ class IVRCompositor virtual HmdColor_t GetCurrentFadeColor( bool bBackground = false ) = 0; /** Fading the Grid in or out in fSeconds */ - virtual void FadeGrid( float fSeconds, bool bFadeIn ) = 0; + virtual void FadeGrid( float fSeconds, bool bFadeGridIn ) = 0; /** Get current alpha value of grid. */ virtual float GetCurrentGridAlpha() = 0; @@ -3306,10 +3430,10 @@ class IVRCompositor /** Pushes the compositor window to the back. This is useful for allowing other applications to draw directly to the HMD. */ virtual void CompositorGoToBack() = 0; - /** Tells the compositor process to clean up and exit. You do not need to call this function at shutdown. Under normal - * circumstances the compositor will manage its own life cycle based on what applications are running. */ + /** DEPRECATED: Tells the compositor process to clean up and exit. You do not need to call this function at shutdown. + * Under normal circumstances the compositor will manage its own life cycle based on what applications are running. */ virtual void CompositorQuit() = 0; - + /** Return whether the compositor is fullscreen */ virtual bool IsFullscreen() = 0; @@ -3377,9 +3501,9 @@ class IVRCompositor * * More accurate GPU timestamp for the start of the frame is achieved by the application calling * SubmitExplicitTimingData immediately before its first submission to the Vulkan/D3D12 queue. - * This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11, - * WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the - * application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for + * This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11, + * WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the + * application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for * Vulkan/D3D12 as it is for D3D11, resulting in a more accurate GPU time measurement for the frame. * * Avoiding WaitGetPoses accessing the Vulkan queue can be achieved using SetExplicitTimingMode as well. If this is desired, @@ -3429,13 +3553,14 @@ class IVRCompositor virtual EVRCompositorError GetPosesForFrame( uint32_t unPosePredictionID, VR_ARRAY_COUNT( unPoseArrayCount ) TrackedDevicePose_t* pPoseArray, uint32_t unPoseArrayCount ) = 0; }; -static const char * const IVRCompositor_Version = "IVRCompositor_026"; +static const char * const IVRCompositor_Version = "IVRCompositor_027"; } // namespace vr // ivrheadsetview.h + namespace vr { enum HeadsetViewMode_t @@ -3493,6 +3618,7 @@ namespace vr // ivrnotifications.h + namespace vr { @@ -3519,7 +3645,7 @@ struct NotificationBitmap_t /** Be aware that the notification type is used as 'priority' to pick the next notification */ enum EVRNotificationType { - /** Transient notifications are automatically hidden after a period of time set by the user. + /** Transient notifications are automatically hidden after a period of time set by the user. * They are used for things like information and chat messages that do not require user interaction. */ EVRNotificationType_Transient = 0, @@ -3559,8 +3685,7 @@ typedef uint32_t VRNotificationId; #pragma pack( pop ) -/** Allows notification sources to interact with the VR system - This current interface is not yet implemented. Do not use yet. */ +/** Allows notification sources to interact with the VR system. */ class IVRNotifications { public: @@ -3582,6 +3707,7 @@ static const char * const IVRNotifications_Version = "IVRNotifications_002"; // ivroverlay.h + namespace vr { @@ -3617,6 +3743,7 @@ namespace vr VROverlayTransform_DashboardTab = 5, VROverlayTransform_DashboardThumb = 6, VROverlayTransform_Mountable = 7, + VROverlayTransform_Projection = 8, }; /** Overlay control settings */ @@ -3625,18 +3752,18 @@ namespace vr // Set this flag on a dashboard overlay to prevent a tab from showing up for that overlay VROverlayFlags_NoDashboardTab = 1 << 3, - // When this is set the overlay will receive VREvent_ScrollDiscrete events like a mouse wheel. + // When this is set the overlay will receive VREvent_ScrollDiscrete events like a mouse wheel. // Requires mouse input mode. VROverlayFlags_SendVRDiscreteScrollEvents = 1 << 6, // Indicates that the overlay would like to receive VROverlayFlags_SendVRTouchpadEvents = 1 << 7, - // If set this will render a vertical scroll wheel on the primary controller, + // If set this will render a vertical scroll wheel on the primary controller, // only needed if not using VROverlayFlags_SendVRScrollEvents but you still want to represent a scroll wheel VROverlayFlags_ShowTouchPadScrollWheel = 1 << 8, - // If this is set ownership and render access to the overlay are transferred + // If this is set ownership and render access to the overlay are transferred // to the new scene process on a call to IVRApplications::LaunchInternalProcess VROverlayFlags_TransferOwnershipToInternalProcess = 1 << 9, @@ -3675,6 +3802,9 @@ namespace vr // If this is set, alpha composition assumes the texture is pre-multiplied VROverlayFlags_IsPremultiplied = 1 << 21, + + // If this is set, the alpha values of the overlay texture will be ignored + VROverlayFlags_IgnoreTextureAlpha = 1 << 22, }; enum VRMessageOverlayResponse @@ -3758,6 +3888,15 @@ namespace vr KeyboardFlag_Modal = 2 << 0, // makes the keyboard take all focus and dismiss when clicking off the panel }; + /** Defines the project used in an overlay that is using SetOverlayTransformProjection */ + struct VROverlayProjection_t + { + /** Tangent of the sides of the frustum */ + float fLeft; + float fRight; + float fTop; + float fBottom; + }; class IVROverlay { @@ -3788,11 +3927,11 @@ namespace vr /** 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 + /** 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; - /** returns a string that corresponds with the specified overlay error. The string will be the name + /** returns a string that corresponds with the specified overlay error. The string will be the name * of the error enum value for all valid error codes */ virtual const char *GetOverlayErrorNameFromEnum( EVROverlayError error ) = 0; @@ -3839,7 +3978,7 @@ namespace vr * Overlays owned by the scene application * Overlays owned by some other application * - * Within a category overlays are rendered lowest sort order to highest sort order. Overlays with the same + * Within a category overlays are rendered lowest sort order to highest sort order. Overlays with the same * sort order are rendered back to front base on distance from the HMD. * * Sort order defaults to 0. */ @@ -3861,6 +4000,12 @@ namespace vr /** Returns the curvature of the overlay as a percentage from (0..1] where 1 is a fully closed cylinder. */ virtual EVROverlayError GetOverlayCurvature( VROverlayHandle_t ulOverlayHandle, float *pfCurvature ) = 0; + /** Sets the pitch angle (in radians) of the overlay before curvature is applied -- to form a fan or disk. */ + virtual EVROverlayError SetOverlayPreCurvePitch( VROverlayHandle_t ulOverlayHandle, float fRadians ) = 0; + + /** Returns the overlay's set pre-curve pitch angle (in radians). */ + virtual EVROverlayError GetOverlayPreCurvePitch( VROverlayHandle_t ulOverlayHandle, float *pfRadians ) = 0; + /** Sets the colorspace the overlay texture's data is in. Defaults to 'auto'. * If the texture needs to be resolved, you should call SetOverlayTexture with the appropriate colorspace instead. */ virtual EVROverlayError SetOverlayTextureColorSpace( VROverlayHandle_t ulOverlayHandle, EColorSpace eTextureColorSpace ) = 0; @@ -3898,7 +4043,7 @@ namespace vr /** 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; @@ -3909,6 +4054,11 @@ namespace vr /** Gets cursor hotspot/transform for the specified overlay */ virtual vr::EVROverlayError GetOverlayTransformCursor( VROverlayHandle_t ulOverlayHandle, HmdVector2_t *pvHotspot ) = 0; + /** Sets the overlay as a projection overlay */ + virtual vr::EVROverlayError SetOverlayTransformProjection( VROverlayHandle_t ulOverlayHandle, + ETrackingUniverseOrigin eTrackingOrigin, const HmdMatrix34_t* pmatTrackingOriginToOverlayTransform, + const VROverlayProjection_t *pProjection, vr::EVREye eEye ) = 0; + /** Shows the VR overlay. For dashboard overlays, only the Dashboard Manager is allowed to call this. */ virtual EVROverlayError ShowOverlay( VROverlayHandle_t ulOverlayHandle ) = 0; @@ -3921,11 +4071,16 @@ namespace vr /** Get the transform in 3d space associated with a specific 2d point in the overlay's coordinate space (where 0,0 is the lower left). -Z points out of the overlay */ virtual EVROverlayError GetTransformForOverlayCoordinates( VROverlayHandle_t ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, HmdMatrix34_t *pmatTransform ) = 0; + /** This function will block until the top of each frame, and can therefore be used to synchronize with the runtime's update rate. + * Note: In non-async mode, some signals may be dropped due to scene app performance, so passing a timeout of 1000/refresh rate + * may be useful depending on the overlay app's desired behavior. */ + virtual EVROverlayError WaitFrameSync( uint32_t nTimeoutMs ) = 0; + // --------------------------------------------- // Overlay input methods // --------------------------------------------- - /** Returns true and fills the event with the next event on the overlay's event queue, if there is one. + /** Returns true and fills the event with the next event on the overlay's event 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 PollNextOverlayEvent( VROverlayHandle_t ulOverlayHandle, VREvent_t *pEvent, uint32_t uncbVREvent ) = 0; @@ -3947,7 +4102,7 @@ namespace vr * specified settings. Returns false if there is no intersection. */ virtual bool ComputeOverlayIntersection( VROverlayHandle_t ulOverlayHandle, const VROverlayIntersectionParams_t *pParams, VROverlayIntersectionResults_t *pResults ) = 0; - /** Returns true if the specified overlay is the hover target. An overlay is the hover target when it is the last overlay "moused over" + /** Returns true if the specified overlay is the hover target. An overlay is the hover target when it is the last overlay "moused over" * by the virtual mouse pointer */ virtual bool IsHoverTargetOverlay( VROverlayHandle_t ulOverlayHandle ) = 0; @@ -3982,7 +4137,7 @@ namespace vr /** Use this to tell the overlay system to release the texture set for this overlay. */ virtual EVROverlayError ClearOverlayTexture( VROverlayHandle_t ulOverlayHandle ) = 0; - /** Separate interface for providing the data as a stream of bytes, but there is an upper bound on data + /** Separate interface for providing the data as a stream of bytes, but there is an upper bound on data * that can be sent. This function can only be called by the overlay's renderer process. */ virtual EVROverlayError SetOverlayRaw( VROverlayHandle_t ulOverlayHandle, void *pvBuffer, uint32_t unWidth, uint32_t unHeight, uint32_t unBytesPerPixel ) = 0; @@ -4038,16 +4193,16 @@ namespace vr // --------------------------------------------- // Keyboard methods // --------------------------------------------- - - /** Show the virtual keyboard to accept input. In most cases, you should pass KeyboardFlag_Modal to enable modal overlay + + /** Show the virtual keyboard to accept input. In most cases, you should pass KeyboardFlag_Modal to enable modal overlay * behavior on the keyboard itself. See EKeyboardFlags for more. */ - virtual EVROverlayError ShowKeyboard( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, uint32_t unFlags, + virtual EVROverlayError ShowKeyboard( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, uint32_t unFlags, const char *pchDescription, uint32_t unCharMax, const char *pchExistingText, uint64_t uUserValue ) = 0; - /** Show the virtual keyboard to accept input for an overlay. In most cases, you should pass KeyboardFlag_Modal to enable modal + /** Show the virtual keyboard to accept input for an overlay. In most cases, you should pass KeyboardFlag_Modal to enable modal * overlay behavior on the keyboard itself. See EKeyboardFlags for more. */ virtual EVROverlayError ShowKeyboardForOverlay( VROverlayHandle_t ulOverlayHandle, EGamepadTextInputMode eInputMode, - EGamepadTextInputLineMode eLineInputMode, uint32_t unFlags, const char *pchDescription, uint32_t unCharMax, + EGamepadTextInputLineMode eLineInputMode, uint32_t unFlags, const char *pchDescription, uint32_t unCharMax, const char *pchExistingText, uint64_t uUserValue ) = 0; /** Get the text that was entered into the text input **/ @@ -4073,11 +4228,12 @@ namespace vr virtual void CloseMessageOverlay() = 0; }; - static const char * const IVROverlay_Version = "IVROverlay_024"; + static const char * const IVROverlay_Version = "IVROverlay_026"; } // namespace vr // ivroverlayview.h + namespace vr { struct VROverlayView_t @@ -4155,6 +4311,7 @@ namespace vr } // ivrrendermodels.h + namespace vr { @@ -4191,7 +4348,8 @@ enum EVRRenderModelTextureFormat VRRenderModelTextureFormat_BC2, VRRenderModelTextureFormat_BC4, VRRenderModelTextureFormat_BC7, - VRRenderModelTextureFormat_BC7_SRGB + VRRenderModelTextureFormat_BC7_SRGB, + VRRenderModelTextureFormat_RGBA16_FLOAT, }; /** A single vertex in a render model */ @@ -4203,9 +4361,9 @@ 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. +#if defined(__linux__) || defined(__APPLE__) +// This structure was originally defined mis-packed on Linux, preserved for +// compatibility. #pragma pack( push, 4 ) #endif @@ -4214,8 +4372,9 @@ struct RenderModel_TextureMap_t uint16_t unWidth, unHeight; // width and height of the texture map in pixels const uint8_t *rubTextureMapData; // Map texture data. EVRRenderModelTextureFormat format; // Refer to EVRRenderModelTextureFormat + uint16_t unMipLevels; }; -#if defined(__linux__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) #pragma pack( pop ) #endif @@ -4226,9 +4385,9 @@ 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. +#if defined(__linux__) || defined(__APPLE__) +// This structure was originally defined mis-packed on Linux, preserved for +// compatibility. #pragma pack( push, 4 ) #endif @@ -4240,7 +4399,7 @@ 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__) +#if defined(__linux__) || defined(__APPLE__) #pragma pack( pop ) #endif @@ -4257,9 +4416,9 @@ class IVRRenderModels public: /** Loads and returns a render model for use in the application. pchRenderModelName should be a render model name - * from the Prop_RenderModelName_String property or an absolute path name to a render model on disk. + * from the Prop_RenderModelName_String property or an absolute path name to a render model on disk. * - * The resulting render model is valid until VR_Shutdown() is called or until FreeRenderModel() is called. When the + * The resulting render model is valid until VR_Shutdown() is called or until FreeRenderModel() is called. When the * application is finished with the render model it should call FreeRenderModel() to free the memory associated * with the model. * @@ -4355,6 +4514,7 @@ static const char * const IVRRenderModels_Version = "IVRRenderModels_006"; // ivrextendeddisplay.h + namespace vr { @@ -4384,6 +4544,7 @@ namespace vr // ivrtrackedcamera.h + namespace vr { @@ -4412,19 +4573,19 @@ class IVRTrackedCamera /** Copies the image frame into a caller's provided buffer. The image data is currently provided as RGBA data, 4 bytes per pixel. * A caller can provide null for the framebuffer or frameheader if not desired. Requesting the frame header first, followed by the frame buffer allows - * the caller to determine if the frame as advanced per the frame header sequence. + * the caller to determine if the frame as advanced per the frame header sequence. * If there is no frame available yet, due to initial camera spinup or re-activation, the error will be VRTrackedCameraError_NoFrameAvailable. * Ideally a caller should be polling at ~16ms intervals */ virtual vr::EVRTrackedCameraError GetVideoStreamFrameBuffer( vr::TrackedCameraHandle_t hTrackedCamera, vr::EVRTrackedCameraFrameType eFrameType, void *pFrameBuffer, uint32_t nFrameBufferSize, vr::CameraVideoStreamFrameHeader_t *pFrameHeader, uint32_t nFrameHeaderSize ) = 0; /** Gets size of the image frame. */ - virtual vr::EVRTrackedCameraError GetVideoStreamTextureSize( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, vr::VRTextureBounds_t *pTextureBounds, uint32_t *pnWidth, uint32_t *pnHeight ) = 0; + virtual vr::EVRTrackedCameraError GetVideoStreamTextureSize( vr::TrackedDeviceIndex_t nDeviceIndex, vr::EVRTrackedCameraFrameType eFrameType, vr::VRTextureBounds_t *pTextureBounds, uint32_t *pnWidth, uint32_t *pnHeight ) = 0; /** Access a shared D3D11 texture for the specified tracked camera stream. * 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. * Instead, use GetVideoStreamTextureSize() with VRTrackedCameraFrameType_Undistorted to determine the proper interior subregion bounds along with GetVideoStreamTextureD3D11() with * VRTrackedCameraFrameType_MaximumUndistorted to provide the texture. The VRTrackedCameraFrameType_MaximumUndistorted will yield an image where the invalid regions are decoded - * 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 + * 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 * guarantees a rectangle where all pixels are valid. */ virtual vr::EVRTrackedCameraError GetVideoStreamTextureD3D11( vr::TrackedCameraHandle_t hTrackedCamera, vr::EVRTrackedCameraFrameType eFrameType, void *pD3D11DeviceOrResource, void **ppD3D11ShaderResourceView, vr::CameraVideoStreamFrameHeader_t *pFrameHeader, uint32_t nFrameHeaderSize ) = 0; @@ -4441,6 +4602,7 @@ static const char * const IVRTrackedCamera_Version = "IVRTrackedCamera_006"; // ivrscreenshots.h + namespace vr { @@ -4476,7 +4638,7 @@ class IVRScreenshots * VRScreenshotType_StereoPanorama: above/below with left eye * panorama being the above image. Image is typically square * with the panorama being 2x horizontal. - * + * * Note that the VR dashboard will call this function when * the user presses the screenshot binding (currently System * Button + Trigger). If Steam is running, the destination @@ -4548,6 +4710,7 @@ static const char * const IVRScreenshots_Version = "IVRScreenshots_001"; // ivrresources.h + namespace vr { @@ -4564,7 +4727,7 @@ class IVRResources virtual uint32_t LoadSharedResource( const char *pchResourceName, char *pchBuffer, uint32_t unBufferLen ) = 0; /** Provides the full path to the specified resource. Resource names can include named directories for - * drivers and other things, and this resolves all of those and returns the actual physical path. + * drivers and other things, and this resolves all of those and returns the actual physical path. * pchResourceTypeDirectory is the subdirectory of resources to look in. */ virtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, VR_OUT_STRING() char *pchPathBuffer, uint32_t unBufferLen ) = 0; }; @@ -4573,7 +4736,9 @@ static const char * const IVRResources_Version = "IVRResources_001"; } + // ivrdrivermanager.h + namespace vr { @@ -4597,23 +4762,24 @@ static const char * const IVRDriverManager_Version = "IVRDriverManager_001"; // ivrinput.h + namespace vr { // Maximum number of characters in an action name, including the trailing null - static const uint32_t k_unMaxActionNameLength = 64; + static const uint32_t k_unMaxActionNameLength = 64; // Maximum number of characters in an action set name, including the trailing null static const uint32_t k_unMaxActionSetNameLength = 64; // Maximum number of origins for an action - static const uint32_t k_unMaxActionOriginCount = 16; + static const uint32_t k_unMaxActionOriginCount = 16; // Maximum number of characters in a bone name, including the trailing null - static const uint32_t k_unMaxBoneNameLength = 32; + static const uint32_t k_unMaxBoneNameLength = 32; enum EVRSkeletalTransformSpace { - VRSkeletalTransformSpace_Model = 0, + VRSkeletalTransformSpace_Model = 0, VRSkeletalTransformSpace_Parent = 1 }; @@ -4647,11 +4813,11 @@ namespace vr enum EVRSummaryType { // The skeletal summary data will match the animated bone transforms for the action. - VRSummaryType_FromAnimation = 0, - - // The skeletal summary data will include unprocessed data directly from the device when available. + VRSummaryType_FromAnimation = 0, + + // The skeletal summary data will include unprocessed data directly from the device when available. // This data is generally less latent than the data that is computed from the animations. - VRSummaryType_FromDevice = 1, + VRSummaryType_FromDevice = 1, }; enum EVRInputFilterCancelType @@ -4682,7 +4848,7 @@ namespace vr /** Deltas since the previous call to UpdateActionState() */ float deltaX, deltaY, deltaZ; - + /** Time relative to now when this event happened. Will be negative to indicate a past time. */ float fUpdateTime; }; @@ -4746,12 +4912,12 @@ namespace vr // These constants are part of the experimental support in SteamVR for overlay // apps selectively overriding input in the base scene application. This may be // useful for overlay applications that need to use part or all of a controller - // without taking away all input to the game. This system must be enabled by the - // "Experimental overlay input overrides" setting in the developer section of + // without taking away all input to the game. This system must be enabled by the + // "Experimental overlay input overrides" setting in the developer section of // SteamVR settings. // // To use this system, set the nPriority field of an action set to any number in - // this range. + // this range. static const int32_t k_nActionSetOverlayGlobalPriorityMin = 0x01000000; static const int32_t k_nActionSetOverlayGlobalPriorityMax = 0x01FFFFFF; @@ -4766,8 +4932,8 @@ namespace vr * activate for all devices, set this to k_ulInvalidInputValueHandle. */ VRInputValueHandle_t ulRestrictedToDevice; - /** The action set to activate for all devices other than ulRestrictedDevice. If - * ulRestrictedToDevice is set to k_ulInvalidInputValueHandle, this parameter is + /** The action set to activate for all devices other than ulRestrictedDevice. If + * ulRestrictedToDevice is set to k_ulInvalidInputValueHandle, this parameter is * ignored. */ VRActionSetHandle_t ulSecondaryActionSet; @@ -4776,9 +4942,9 @@ namespace vr /** The priority of this action set relative to other action sets. Any inputs * bound to a source (e.g. trackpad, joystick, trigger) will disable bindings in - * other active action sets with a smaller priority. + * other active action sets with a smaller priority. * - * Overlay applications (i.e. ApplicationType_Overlay) may set their action set priority + * Overlay applications (i.e. ApplicationType_Overlay) may set their action set priority * to a value between k_nActionSetOverlayGlobalPriorityMin and k_nActionSetOverlayGlobalPriorityMax * to cause any inputs bound to a source used by that action set to be disabled in scene applications. * @@ -4791,11 +4957,11 @@ namespace vr struct VRSkeletalSummaryData_t { /** The amount that each finger is 'curled' inwards towards the palm. In the case of the thumb, - * this represents how much the thumb is wrapped around the fist. + * this represents how much the thumb is wrapped around the fist. * 0 means straight, 1 means fully curled */ float flFingerCurl[ VRFinger_Count ]; - /** The amount that each pair of adjacent fingers are separated. + /** The amount that each pair of adjacent fingers are separated. * 0 means the digits are touching, 1 means they are fully separated. */ float flFingerSplay[ VRFingerSplay_Count ]; @@ -4810,7 +4976,7 @@ namespace vr /** Sets the path to the action manifest JSON file that is used by this application. If this information * was set on the Steam partner site, calls to this function are ignored. If the Steam partner site - * setting and the path provided by this call are different, VRInputError_MismatchedActionManifest is returned. + * setting and the path provided by this call are different, VRInputError_MismatchedActionManifest is returned. * This call must be made before the first call to UpdateActionState or IVRSystem::PollNextEvent. */ virtual EVRInputError SetActionManifestPath( const char *pchActionManifestPath ) = 0; @@ -4827,7 +4993,7 @@ namespace vr // --------------- Reading action state ------------------- // - /** Reads the current state into all actions. After this call, the results of Get*Action calls + /** Reads the current state into all actions. After this call, the results of Get*Action calls * will be the same until the next call to UpdateActionState. */ virtual EVRInputError UpdateActionState( VR_ARRAY_COUNT( unSetCount ) VRActiveActionSet_t *pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount ) = 0; @@ -4901,7 +5067,7 @@ namespace vr /** Retrieve origin handles for an action */ virtual EVRInputError GetActionOrigins( VRActionSetHandle_t actionSetHandle, VRActionHandle_t digitalActionHandle, VR_ARRAY_COUNT( originOutCount ) VRInputValueHandle_t *originsOut, uint32_t originOutCount ) = 0; - /** Retrieves the name of the origin in the current language. unStringSectionsToInclude is a bitfield of values in EVRInputStringBits that allows the + /** Retrieves the name of the origin in the current language. unStringSectionsToInclude is a bitfield of values in EVRInputStringBits that allows the application to specify which parts of the origin's information it wants a string for. */ virtual EVRInputError GetOriginLocalizedName( VRInputValueHandle_t origin, VR_OUT_STRING() char *pchNameArray, uint32_t unNameArraySize, int32_t unStringSectionsToInclude ) = 0; @@ -4933,7 +5099,7 @@ namespace vr * If no set is provided it will open to the root of the app binding page. */ virtual EVRInputError OpenBindingUI( const char* pchAppKey, VRActionSetHandle_t ulActionSetHandle, VRInputValueHandle_t ulDeviceHandle, bool bShowOnDesktop ) = 0; - /** Returns the variant set in the current bindings. If the binding doesn't include a variant setting, this function + /** Returns the variant set in the current bindings. If the binding doesn't include a variant setting, this function * will return an empty string */ virtual EVRInputError GetBindingVariant( vr::VRInputValueHandle_t ulDevicePath, VR_OUT_STRING() char *pchVariantArray, uint32_t unVariantArraySize ) = 0; @@ -4945,12 +5111,13 @@ namespace vr } // namespace vr // ivriobuffer.h + namespace vr { typedef uint64_t IOBufferHandle_t; static const uint64_t k_ulInvalidIOBufferHandle = 0; - + enum EIOBufferError { IOBuffer_Success = 0, @@ -4977,16 +5144,16 @@ static const uint64_t k_ulInvalidIOBufferHandle = 0; public: /** opens an existing or creates a new IOBuffer of unSize bytes */ virtual vr::EIOBufferError Open( const char *pchPath, vr::EIOBufferMode mode, uint32_t unElementSize, uint32_t unElements, vr::IOBufferHandle_t *pulBuffer ) = 0; - + /** closes a previously opened or created buffer */ virtual vr::EIOBufferError Close( vr::IOBufferHandle_t ulBuffer ) = 0; - + /** reads up to unBytes from buffer into *pDst, returning number of bytes read in *punRead */ virtual vr::EIOBufferError Read( vr::IOBufferHandle_t ulBuffer, void *pDst, uint32_t unBytes, uint32_t *punRead ) = 0; - + /** writes unBytes of data from *pSrc into a buffer. */ virtual vr::EIOBufferError Write( vr::IOBufferHandle_t ulBuffer, void *pSrc, uint32_t unBytes ) = 0; - + /** retrieves the property container of an buffer. */ virtual vr::PropertyContainerHandle_t PropertyContainer( vr::IOBufferHandle_t ulBuffer ) = 0; @@ -4998,6 +5165,7 @@ static const uint64_t k_ulInvalidIOBufferHandle = 0; } // ivrspatialanchors.h + namespace vr { static const SpatialAnchorHandle_t k_ulInvalidSpatialAnchorHandle = 0; @@ -5027,7 +5195,7 @@ namespace vr * This should be called when the user is close to (and ideally looking at/interacting with) the target physical * location. At that moment, the driver will have the most information about how to recover that physical point * in the future, and the quality of the anchor (when the descriptor is re-used) will be highest. - * The caller may decide to apply offsets from this initial pose, but is advised to stay relatively close to the + * The caller may decide to apply offsets from this initial pose, but is advised to stay relatively close to the * original pose location for highest fidelity. */ virtual EVRSpatialAnchorError CreateSpatialAnchorFromPose( TrackedDeviceIndex_t unDeviceIndex, ETrackingUniverseOrigin eOrigin, SpatialAnchorPose_t *pPose, SpatialAnchorHandle_t *pHandleOut ) = 0; @@ -5050,6 +5218,7 @@ namespace vr } // namespace vr // ivrdebug.h + namespace vr { enum EVRDebugError