cmake build support for VR demo (WIN32 only)

update to latest OpenVR 1.05 SDK from https://github.com/ValveSoftware/openvr
add keyboard support to tune default camera VR position
VR revert to double 'distorted' views on Desktop, since the single view isn't showing full scene
This commit is contained in:
Erwin Coumans
2017-01-25 19:17:57 -08:00
parent a230c941f9
commit 94c768bea8
17 changed files with 503 additions and 134 deletions

View File

@@ -111,10 +111,11 @@ enum EVREye
Eye_Right = 1
};
enum EGraphicsAPIConvention
enum ETextureType
{
API_DirectX = 0, // Normalized Z goes from 0 at the viewer to 1 at the far clip plane
API_OpenGL = 1, // Normalized Z goes from 1 at the viewer to -1 at the far clip plane
TextureType_DirectX = 0, // Handle is an ID3D11Texture
TextureType_OpenGL = 1, // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags
TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure
};
enum EColorSpace
@@ -126,8 +127,8 @@ enum EColorSpace
struct Texture_t
{
void* handle; // Native d3d texture pointer or GL texture id.
EGraphicsAPIConvention eType;
void* handle; // See ETextureType definition above
ETextureType eType;
EColorSpace eColorSpace;
};
@@ -161,11 +162,8 @@ enum ETrackedDeviceClass
TrackedDeviceClass_Invalid = 0, // the ID was not valid.
TrackedDeviceClass_HMD = 1, // Head-Mounted Displays
TrackedDeviceClass_Controller = 2, // Tracked controllers
TrackedDeviceClass_GenericTracker = 3, // Generic trackers, similar to controllers
TrackedDeviceClass_TrackingReference = 4, // Camera and base stations that serve as tracking reference points
TrackedDeviceClass_Count, // This isn't a class that will ever be returned. It is used for allocating arrays and such
TrackedDeviceClass_Other = 1000,
};
@@ -198,7 +196,7 @@ enum ETrackingUniverseOrigin
{
TrackingUniverseSeated = 0, // Poses are provided relative to the seated zero pose
TrackingUniverseStanding = 1, // Poses are provided relative to the safe bounds configured by the user
TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. You probably don't want this one.
TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. It has Y up and is unified for devices of the same driver. You usually don't want this one.
};
@@ -206,6 +204,8 @@ enum ETrackingUniverseOrigin
* tracked device. Many fields are only valid for one ETrackedDeviceClass. */
enum ETrackedDeviceProperty
{
Prop_Invalid = 0,
// general properties that apply to all device classes
Prop_TrackingSystemName_String = 1000,
Prop_ModelNumber_String = 1001,
@@ -333,6 +333,7 @@ enum ETrackedPropertyError
TrackedProp_ValueNotProvidedByDevice = 7,
TrackedProp_StringExceedsMaximumLength = 8,
TrackedProp_NotYetAvailable = 9, // The property value isn't known yet, but is expected soon. Call again later.
TrackedProp_PermissionDenied = 10,
};
/** Allows the application to control what part of the provided texture will be used in the
@@ -358,13 +359,13 @@ enum EVRSubmitFlags
// If the texture pointer passed in is actually a renderbuffer (e.g. for MSAA in OpenGL) then set this flag.
Submit_GlRenderBuffer = 0x02,
// Handle is pointer to VulkanData_t
Submit_VulkanTexture = 0x04,
// Do not use
Submit_Reserved = 0x04,
};
/** Data required for passing Vulkan textures to IVRCompositor::Submit.
* Be sure to call OpenVR_Shutdown before destroying these resources. */
struct VulkanData_t
struct VRVulkanTextureData_t
{
uint64_t m_nImage; // VkImage
VkDevice_T *m_pDevice;
@@ -517,6 +518,8 @@ enum EVREventType
VREvent_PerformanceTest_EnableCapture = 1600,
VREvent_PerformanceTest_DisableCapture = 1601,
VREvent_PerformanceTest_FidelityLevel = 1602,
VREvent_MessageOverlay_Closed = 1650,
// Vendors are free to expose private events in this reserved region
VREvent_VendorSpecific_Reserved_Start = 10000,
@@ -703,6 +706,11 @@ struct VREvent_EditingCameraSurface_t
uint32_t nVisualMode;
};
struct VREvent_MessageOverlay_t
{
uint32_t unVRMessageOverlayResponse; // vr::VRMessageOverlayResponse enum
};
/** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */
typedef union
{
@@ -724,6 +732,7 @@ typedef union
VREvent_ScreenshotProgress_t screenshotProgress;
VREvent_ApplicationLaunch_t applicationLaunch;
VREvent_EditingCameraSurface_t cameraSurface;
VREvent_MessageOverlay_t messageOverlay;
} VREvent_Data_t;
/** An event posted by the server to all running applications */
@@ -944,6 +953,8 @@ enum EVRInitError
VRInitError_Init_InvalidApplicationType = 130,
VRInitError_Init_NotAvailableToWatchdogApps = 131,
VRInitError_Init_WatchdogDisabledInSettings = 132,
VRInitError_Init_VRDashboardNotFound = 133,
VRInitError_Init_VRDashboardStartupFailed = 134,
VRInitError_Driver_Failed = 200,
VRInitError_Driver_Unknown = 201,
@@ -1257,7 +1268,6 @@ namespace vr
//-----------------------------------------------------------------------------
// steamvr keys
static const char * const k_pch_SteamVR_Section = "steamvr";
static const char * const k_pch_SteamVR_RequireHmd_String = "requireHmd";
static const char * const k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver";
@@ -1294,27 +1304,26 @@ namespace vr
static const char * const k_pch_SteamVR_ShowMirrorView_Bool = "showMirrorView";
static const char * const k_pch_SteamVR_MirrorViewGeometry_String = "mirrorViewGeometry";
static const char * const k_pch_SteamVR_StartMonitorFromAppLaunch = "startMonitorFromAppLaunch";
static const char * const k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = "startCompositorFromAppLaunch";
static const char * const k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = "startDashboardFromAppLaunch";
static const char * const k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = "startOverlayAppsFromDashboard";
static const char * const k_pch_SteamVR_EnableHomeApp = "enableHomeApp";
static const char * const k_pch_SteamVR_SetInitialDefaultHomeApp = "setInitialDefaultHomeApp";
static const char * const k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBackgroundImageTimeSec";
static const char * const k_pch_SteamVR_RetailDemo_Bool = "retailDemo";
static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset";
//-----------------------------------------------------------------------------
// lighthouse keys
static const char * const k_pch_Lighthouse_Section = "driver_lighthouse";
static const char * const k_pch_Lighthouse_DisableIMU_Bool = "disableimu";
static const char * const k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation";
static const char * const k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug";
static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation";
static const char * const k_pch_Lighthouse_DBHistory_Bool = "dbhistory";
//-----------------------------------------------------------------------------
// null keys
static const char * const k_pch_Null_Section = "driver_null";
static const char * const k_pch_Null_EnableNullDriver_Bool = "enable";
static const char * const k_pch_Null_SerialNumber_String = "serialNumber";