Skip to content

Commit

Permalink
* Added new function VR_IsRuntimeInstalled() to openvr.h. It returns …
Browse files Browse the repository at this point in the history
…true if the VR runtime directory was found.

* Added EVREventType::EVREventType_VREvent_StatusUpdate to notify subscribers of the event that the OpenVR overall system entered a new status state. Possible states are defined by VRStatusState_t and stored in VREvent_status_t
* Added EVREventType::VREvent_ChaperoneUniverseHasChanged to notify when the universe ID of the chaperone system changed. This message is usually sent once, when the ID changes from 0 to the actual universe ID.

[git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 2912031]
  • Loading branch information
jeremyselan committed Aug 6, 2015
1 parent 59db933 commit 088a60b
Show file tree
Hide file tree
Showing 21 changed files with 152 additions and 2 deletions.
Binary file modified bin/linux32/libopenvr_api.so
Binary file not shown.
Binary file modified bin/linux32/libopenvr_api.so.dbg
Binary file not shown.
Binary file modified bin/linux64/libopenvr_api.so
Binary file not shown.
Binary file modified bin/linux64/libopenvr_api.so.dbg
Binary file not shown.
Binary file modified bin/osx32/libopenvr_api.dylib
Binary file not shown.
Binary file not shown.
Binary file modified bin/win32/openvr_api.dll
Binary file not shown.
Binary file modified bin/win32/openvr_api.pdb
Binary file not shown.
Binary file modified bin/win64/openvr_api.dll
Binary file not shown.
Binary file modified bin/win64/openvr_api.pdb
Binary file not shown.
43 changes: 42 additions & 1 deletion headers/openvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ struct VRTextureBounds_t
float uMax, vMax;
};

/** Status of the overall system */
enum VRStatusState_t
{
State_OK = 0,
State_Error = 1,
State_Warning = 2,
State_Undefined = 3,
State_NotSet = 4,
};


/** The types of events that could be posted (and what the parameters mean for each event type) */
enum EVREventType
{
Expand Down Expand Up @@ -288,6 +299,9 @@ enum EVREventType
VREvent_ProcessQuit = 701, // data is process

VREvent_ChaperoneDataHasChanged = 800,
VREvent_ChaperoneUniverseHasChanged = 801,

VREvent_StatusUpdate = 900,
};


Expand Down Expand Up @@ -359,6 +373,12 @@ struct VREvent_Overlay_t
};


/** Used for a few events about overlays */
struct VREvent_Status_t
{
VRStatusState_t statusState;
};

/** Not actually used for any events. It is just used to reserve
* space in the union for future event types */
struct VREvent_Reserved_t
Expand All @@ -376,6 +396,7 @@ typedef union
VREvent_Process_t process;
VREvent_Notification_t notification;
VREvent_Overlay_t overlay;
VREvent_Status_t status;
} VREvent_Data_t;

/** An event posted by the server to all running applications */
Expand Down Expand Up @@ -493,6 +514,8 @@ enum VROverlayError


/** error codes returned by Vr_Init */

// Please add adequate error description to https://developer.valvesoftware.com/w/index.php?title=Category:SteamVRHelp
enum HmdError
{
HmdError_None = 0,
Expand All @@ -512,6 +535,7 @@ enum HmdError
HmdError_Init_NoConfigPath = 111,
HmdError_Init_NoLogPath = 112,
HmdError_Init_PathRegistryNotWritable = 113,
HmdError_Init_AppInfoInitFailed = 114,

HmdError_Driver_Failed = 200,
HmdError_Driver_Unknown = 201,
Expand Down Expand Up @@ -1051,11 +1075,13 @@ struct NotificationBitmap
enum NotificationError_t
{
k_ENotificationError_OK = 0,
k_ENotificationError_Fail = 1
k_ENotificationError_Fail = 1,
k_eNotificationError_InvalidParam = 2,
};

static const uint32_t k_unNotificationTypeMaxSize = 16;
static const uint32_t k_unNotificationTextMaxSize = 128;
static const uint32_t k_unNotificationCatagoryMaxSize = 32;

/** The types of events that could be posted (and what the parameters mean for each event type) */
/*enum NotificationEventType
Expand Down Expand Up @@ -1151,6 +1177,10 @@ namespace vr
// The following only take effect when rendered using the high quality render path (see SetHighQualityOverlay).
VROverlayFlags_Curved = 1,
VROverlayFlags_RGSS4X = 2,

// Set this flag on a dashboard overlay to prevent a tab from showing up for that overlay
VROverlayFlags_NoDashboardTab = 3,

};

struct VROverlayIntersectionParams_t
Expand Down Expand Up @@ -1491,6 +1521,14 @@ class IVRControlPanel
* ending with the process submitting the request. Returns false if the request could not be sent. */
virtual bool QuitProcess( uint32_t pidProcessToQuit ) = 0;

/** Starts a process and returns the PID or 0 if the process failed to start. */
virtual uint32_t StartVRProcess( const char *pchExecutable, const char **pchArguments, uint32_t unArgumentCount, const char *pchWorkingDirectory) = 0;

/** Sets the master process for OpenVR. When the master process exits VRServer will send quit messages to every other process
* to start the shutdown process */
virtual void SetMasterProcessToThis() = 0;


};

static const char * const IVRControlPanel_Version = "IVRControlPanel_001";
Expand Down Expand Up @@ -1522,6 +1560,9 @@ namespace vr
*/
VR_INTERFACE bool VR_CALLTYPE VR_IsHmdPresent();

/** Returns true if the OpenVR runtime is installed. */
VR_INTERFACE bool VR_CALLTYPE VR_IsRuntimeInstalled();

/** Returns the string version of an HMD error. This function may be called outside of VR_Init()/VR_Shutdown(). */
VR_INTERFACE const char *VR_CALLTYPE VR_GetStringForHmdError( vr::HmdError error );

Expand Down
36 changes: 36 additions & 0 deletions headers/openvr_api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ class VRNativeEntrypoints
internal static extern IntPtr VR_IVRControlPanel_GetCurrentCompositorInterface(IntPtr instancePtr, string pchInterfaceVersion);
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRControlPanel_QuitProcess")]
internal static extern bool VR_IVRControlPanel_QuitProcess(IntPtr instancePtr, uint pidProcessToQuit);
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRControlPanel_StartVRProcess")]
internal static extern uint VR_IVRControlPanel_StartVRProcess(IntPtr instancePtr, string pchExecutable, string pchArguments, uint unArgumentCount, string pchWorkingDirectory);
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRControlPanel_SetMasterProcessToThis")]
internal static extern void VR_IVRControlPanel_SetMasterProcessToThis(IntPtr instancePtr);
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRNotifications_GetErrorString")]
internal static extern uint VR_IVRNotifications_GetErrorString(IntPtr instancePtr, NotificationError_t error, System.Text.StringBuilder pchBuffer, uint unBufferSize);
[DllImportAttribute("openvr_api", EntryPoint = "VR_IVRNotifications_CreateNotification")]
Expand Down Expand Up @@ -476,6 +480,8 @@ public abstract class IVRControlPanel
public abstract void SetIPD(float fIPD);
public abstract IVRCompositor GetCurrentCompositorInterface(string pchInterfaceVersion);
public abstract bool QuitProcess(uint pidProcessToQuit);
public abstract uint StartVRProcess(string pchExecutable,string pchArguments,uint unArgumentCount,string pchWorkingDirectory);
public abstract void SetMasterProcessToThis();
}


Expand Down Expand Up @@ -1386,6 +1392,18 @@ public override bool QuitProcess(uint pidProcessToQuit)
bool result = VRNativeEntrypoints.VR_IVRControlPanel_QuitProcess(m_pVRControlPanel,pidProcessToQuit);
return result;
}
public override uint StartVRProcess(string pchExecutable,string pchArguments,uint unArgumentCount,string pchWorkingDirectory)
{
CheckIfUsable();
pchArguments = "";
uint result = VRNativeEntrypoints.VR_IVRControlPanel_StartVRProcess(m_pVRControlPanel,pchExecutable,pchArguments,unArgumentCount,pchWorkingDirectory);
return result;
}
public override void SetMasterProcessToThis()
{
CheckIfUsable();
VRNativeEntrypoints.VR_IVRControlPanel_SetMasterProcessToThis(m_pVRControlPanel);
}
}


Expand Down Expand Up @@ -1704,6 +1722,14 @@ public enum TrackedPropertyError
TrackedProp_ValueNotProvidedByDevice = 7,
TrackedProp_StringExceedsMaximumLength = 8,
}
public enum VRStatusState_t
{
State_OK = 0,
State_Error = 1,
State_Warning = 2,
State_Undefined = 3,
State_NotSet = 4,
}
public enum EVREventType
{
VREvent_None = 0,
Expand Down Expand Up @@ -1736,6 +1762,8 @@ public enum EVREventType
VREvent_Quit = 700,
VREvent_ProcessQuit = 701,
VREvent_ChaperoneDataHasChanged = 800,
VREvent_ChaperoneUniverseHasChanged = 801,
VREvent_StatusUpdate = 900,
}
public enum EVRButtonId
{
Expand Down Expand Up @@ -1807,6 +1835,7 @@ public enum HmdError
Init_NoConfigPath = 111,
Init_NoLogPath = 112,
Init_PathRegistryNotWritable = 113,
Init_AppInfoInitFailed = 114,
Driver_Failed = 200,
Driver_Unknown = 201,
Driver_HmdUnknown = 202,
Expand Down Expand Up @@ -1860,11 +1889,13 @@ public enum VROverlayFlags
None = 0,
Curved = 1,
RGSS4X = 2,
NoDashboardTab = 3,
}
public enum NotificationError_t
{
k_ENotificationError_OK = 0,
k_ENotificationError_Fail = 1,
k_eNotificationError_InvalidParam = 2,
}
public enum CameraImageResult
{
Expand Down Expand Up @@ -1991,6 +2022,10 @@ public enum CameraImageResult
{
public ulong overlayHandle;
}
[StructLayout(LayoutKind.Sequential)] public struct VREvent_Status_t
{
public VRStatusState_t statusState;
}
[StructLayout(LayoutKind.Sequential)] public struct VREvent_Reserved_t
{
public ulong reserved0;
Expand Down Expand Up @@ -2156,6 +2191,7 @@ public static string GetStringForHmdError(HmdError error)
public const string IVRControlPanel_Version = "IVRControlPanel_001";
public const uint k_unNotificationTypeMaxSize = 16;
public const uint k_unNotificationTextMaxSize = 128;
public const uint k_unNotificationCatagoryMaxSize = 32;
public const string IVRNotifications_Version = "IVRNotifications_001";
public const string IVRCameraAccess_Version = "IVRCameraAccess_001";
public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_001";
Expand Down
35 changes: 34 additions & 1 deletion headers/openvr_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@
,{"name": "TrackedProp_ValueNotProvidedByDevice","value": "7"}
,{"name": "TrackedProp_StringExceedsMaximumLength","value": "8"}
]}
, {"enumname": "vr::VRStatusState_t","values": [
{"name": "State_OK","value": "0"}
,{"name": "State_Error","value": "1"}
,{"name": "State_Warning","value": "2"}
,{"name": "State_Undefined","value": "3"}
,{"name": "State_NotSet","value": "4"}
]}
, {"enumname": "vr::EVREventType","values": [
{"name": "VREvent_None","value": "0"}
,{"name": "VREvent_TrackedDeviceActivated","value": "100"}
Expand Down Expand Up @@ -111,6 +118,8 @@
,{"name": "VREvent_Quit","value": "700"}
,{"name": "VREvent_ProcessQuit","value": "701"}
,{"name": "VREvent_ChaperoneDataHasChanged","value": "800"}
,{"name": "VREvent_ChaperoneUniverseHasChanged","value": "801"}
,{"name": "VREvent_StatusUpdate","value": "900"}
]}
, {"enumname": "vr::EVRButtonId","values": [
{"name": "k_EButton_System","value": "0"}
Expand Down Expand Up @@ -176,6 +185,7 @@
,{"name": "HmdError_Init_NoConfigPath","value": "111"}
,{"name": "HmdError_Init_NoLogPath","value": "112"}
,{"name": "HmdError_Init_PathRegistryNotWritable","value": "113"}
,{"name": "HmdError_Init_AppInfoInitFailed","value": "114"}
,{"name": "HmdError_Driver_Failed","value": "200"}
,{"name": "HmdError_Driver_Unknown","value": "201"}
,{"name": "HmdError_Driver_HmdUnknown","value": "202"}
Expand Down Expand Up @@ -224,10 +234,12 @@
{"name": "VROverlayFlags_None","value": "0"}
,{"name": "VROverlayFlags_Curved","value": "1"}
,{"name": "VROverlayFlags_RGSS4X","value": "2"}
,{"name": "VROverlayFlags_NoDashboardTab","value": "3"}
]}
, {"enumname": "vr::NotificationError_t","values": [
{"name": "k_ENotificationError_OK","value": "0"}
,{"name": "k_ENotificationError_Fail","value": "1"}
,{"name": "k_eNotificationError_InvalidParam","value": "2"}
]}
, {"enumname": "vr::CameraImageResult","values": [
{"name": "CameraImageResult_OK","value": "0"}
Expand Down Expand Up @@ -274,6 +286,8 @@
"constname": "k_unNotificationTypeMaxSize","consttype": "const uint32_t", "constval": "16"}
,{
"constname": "k_unNotificationTextMaxSize","consttype": "const uint32_t", "constval": "128"}
,{
"constname": "k_unNotificationCatagoryMaxSize","consttype": "const uint32_t", "constval": "32"}
,{
"constname": "IVRNotifications_Version","consttype": "const char *const", "constval": "IVRNotifications_001"}
,{
Expand Down Expand Up @@ -343,6 +357,8 @@
{ "fieldname": "oldPid", "fieldtype": "uint32_t"}]}
,{"struct": "vr::VREvent_Overlay_t","fields": [
{ "fieldname": "overlayHandle", "fieldtype": "uint64_t"}]}
,{"struct": "vr::VREvent_Status_t","fields": [
{ "fieldname": "statusState", "fieldtype": "enum vr::VRStatusState_t"}]}
,{"struct": "vr::VREvent_Reserved_t","fields": [
{ "fieldname": "reserved0", "fieldtype": "uint64_t"},
{ "fieldname": "reserved1", "fieldtype": "uint64_t"}]}
Expand All @@ -352,7 +368,8 @@
{ "fieldname": "mouse", "fieldtype": "struct vr::VREvent_Mouse_t"},
{ "fieldname": "process", "fieldtype": "struct vr::VREvent_Process_t"},
{ "fieldname": "notification", "fieldtype": "struct vr::VREvent_Notification_t"},
{ "fieldname": "overlay", "fieldtype": "struct vr::VREvent_Overlay_t"}]}
{ "fieldname": "overlay", "fieldtype": "struct vr::VREvent_Overlay_t"},
{ "fieldname": "status", "fieldtype": "struct vr::VREvent_Status_t"}]}
,{"struct": "vr::VREvent_t","fields": [
{ "fieldname": "eventType", "fieldtype": "enum vr::EVREventType"},
{ "fieldname": "trackedDeviceIndex", "fieldtype": "TrackedDeviceIndex_t"},
Expand Down Expand Up @@ -1483,6 +1500,22 @@
{ "paramname": "pidProcessToQuit" ,"paramtype": "uint32_t"}
]
}
,{
"classname": "vr::IVRControlPanel",
"methodname": "StartVRProcess",
"returntype": "uint32_t",
"params": [
{ "paramname": "pchExecutable" ,"paramtype": "const char *"},
{ "paramname": "pchArguments" ,"paramtype": "const char **"},
{ "paramname": "unArgumentCount" ,"paramtype": "uint32_t"},
{ "paramname": "pchWorkingDirectory" ,"paramtype": "const char *"}
]
}
,{
"classname": "vr::IVRControlPanel",
"methodname": "SetMasterProcessToThis",
"returntype": "void"
}
,{
"classname": "vr::IVRNotifications",
"methodname": "GetErrorString",
Expand Down
16 changes: 16 additions & 0 deletions headers/openvr_capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ char * IVRRenderModels_Version = "IVRRenderModels_001";
char * IVRControlPanel_Version = "IVRControlPanel_001";
unsigned int k_unNotificationTypeMaxSize = 16;
unsigned int k_unNotificationTextMaxSize = 128;
unsigned int k_unNotificationCatagoryMaxSize = 32;
char * IVRNotifications_Version = "IVRNotifications_001";
char * IVRCameraAccess_Version = "IVRCameraAccess_001";
char * IVRChaperoneSetup_Version = "IVRChaperoneSetup_001";
Expand Down Expand Up @@ -176,6 +177,14 @@ typedef enum TrackedPropertyError
TrackedPropertyError_TrackedProp_ValueNotProvidedByDevice = 7,
TrackedPropertyError_TrackedProp_StringExceedsMaximumLength = 8,
};
typedef enum VRStatusState_t
{
VRStatusState_t_State_OK = 0,
VRStatusState_t_State_Error = 1,
VRStatusState_t_State_Warning = 2,
VRStatusState_t_State_Undefined = 3,
VRStatusState_t_State_NotSet = 4,
};
typedef enum EVREventType
{
EVREventType_VREvent_None = 0,
Expand Down Expand Up @@ -208,6 +217,8 @@ typedef enum EVREventType
EVREventType_VREvent_Quit = 700,
EVREventType_VREvent_ProcessQuit = 701,
EVREventType_VREvent_ChaperoneDataHasChanged = 800,
EVREventType_VREvent_ChaperoneUniverseHasChanged = 801,
EVREventType_VREvent_StatusUpdate = 900,
};
typedef enum EVRButtonId
{
Expand Down Expand Up @@ -279,6 +290,7 @@ typedef enum HmdError
HmdError_Init_NoConfigPath = 111,
HmdError_Init_NoLogPath = 112,
HmdError_Init_PathRegistryNotWritable = 113,
HmdError_Init_AppInfoInitFailed = 114,
HmdError_Driver_Failed = 200,
HmdError_Driver_Unknown = 201,
HmdError_Driver_HmdUnknown = 202,
Expand Down Expand Up @@ -332,11 +344,13 @@ typedef enum VROverlayFlags
VROverlayFlags_None = 0,
VROverlayFlags_Curved = 1,
VROverlayFlags_RGSS4X = 2,
VROverlayFlags_NoDashboardTab = 3,
};
typedef enum NotificationError_t
{
NotificationError_t_k_ENotificationError_OK = 0,
NotificationError_t_k_ENotificationError_Fail = 1,
NotificationError_t_k_eNotificationError_InvalidParam = 2,
};
typedef enum CameraImageResult
{
Expand Down Expand Up @@ -646,6 +660,8 @@ S_API float VR_IVRControlPanel_GetIPD(intptr_t instancePtr);
S_API void VR_IVRControlPanel_SetIPD(intptr_t instancePtr, float fIPD);
S_API class IVRCompositor * VR_IVRControlPanel_GetCurrentCompositorInterface(intptr_t instancePtr, const char * pchInterfaceVersion);
S_API bool VR_IVRControlPanel_QuitProcess(intptr_t instancePtr, uint32_t pidProcessToQuit);
S_API uint32_t VR_IVRControlPanel_StartVRProcess(intptr_t instancePtr, const char * pchExecutable, const char ** pchArguments, uint32_t unArgumentCount, const char * pchWorkingDirectory);
S_API void VR_IVRControlPanel_SetMasterProcessToThis(intptr_t instancePtr);
S_API uint32_t VR_IVRNotifications_GetErrorString(intptr_t instancePtr, NotificationError_t error, char * pchBuffer, uint32_t unBufferSize);
S_API NotificationError_t VR_IVRNotifications_CreateNotification(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, uint64_t ulUserValue, char * strType, char * strText, char * strCategory, struct NotificationBitmap * photo, VRNotificationId * notificationId);
S_API NotificationError_t VR_IVRNotifications_DismissNotification(intptr_t instancePtr, VRNotificationId notificationId);
Expand Down
Loading

0 comments on commit 088a60b

Please sign in to comment.