diff --git a/bin/linux32/libopenvr_api.so b/bin/linux32/libopenvr_api.so index fd3da948..24f31b5e 100755 Binary files a/bin/linux32/libopenvr_api.so and b/bin/linux32/libopenvr_api.so differ diff --git a/bin/linux32/libopenvr_api.so.dbg b/bin/linux32/libopenvr_api.so.dbg index f42b3380..0fa458a3 100755 Binary files a/bin/linux32/libopenvr_api.so.dbg and b/bin/linux32/libopenvr_api.so.dbg differ diff --git a/bin/linux64/libopenvr_api.so b/bin/linux64/libopenvr_api.so index dafbdad6..2e4d177d 100755 Binary files a/bin/linux64/libopenvr_api.so and b/bin/linux64/libopenvr_api.so differ diff --git a/bin/linux64/libopenvr_api.so.dbg b/bin/linux64/libopenvr_api.so.dbg index 443d1c90..f79b312f 100755 Binary files a/bin/linux64/libopenvr_api.so.dbg and b/bin/linux64/libopenvr_api.so.dbg differ diff --git a/bin/osx32/libopenvr_api.dylib b/bin/osx32/libopenvr_api.dylib index fad10d0e..b9054cb4 100755 Binary files a/bin/osx32/libopenvr_api.dylib and b/bin/osx32/libopenvr_api.dylib differ diff --git a/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib b/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib index 4ac445f3..fc0bc618 100644 Binary files a/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib and b/bin/osx32/libopenvr_api.dylib.dSYM/Contents/Resources/DWARF/libopenvr_api.dylib differ diff --git a/bin/win32/openvr_api.dll b/bin/win32/openvr_api.dll index 1704b2fb..749c89d3 100644 Binary files a/bin/win32/openvr_api.dll and b/bin/win32/openvr_api.dll differ diff --git a/bin/win32/openvr_api.pdb b/bin/win32/openvr_api.pdb index 2fc6a724..6be082c3 100644 Binary files a/bin/win32/openvr_api.pdb and b/bin/win32/openvr_api.pdb differ diff --git a/bin/win64/openvr_api.dll b/bin/win64/openvr_api.dll index ce64b850..656c9658 100644 Binary files a/bin/win64/openvr_api.dll and b/bin/win64/openvr_api.dll differ diff --git a/bin/win64/openvr_api.pdb b/bin/win64/openvr_api.pdb index b9c79d92..430e6adc 100644 Binary files a/bin/win64/openvr_api.pdb and b/bin/win64/openvr_api.pdb differ diff --git a/headers/openvr.h b/headers/openvr.h index 200f35b2..57a35397 100644 --- a/headers/openvr.h +++ b/headers/openvr.h @@ -277,6 +277,8 @@ enum EVREventType VREvent_DashboardThumbSelected = 504, // Sent to the overlay manager - data is overlay VREvent_DashboardRequested = 505, // Sent to the overlay manager - data is overlay VREvent_ResetDashboard = 506, // Send to the overlay manager + VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID + VREvent_ImageLoaded = 508, // Sent to overlays when a SetOverlayRaw or SetOverlayFromFile call finishes loading VREvent_Notification_Show = 600, VREvent_Notification_Dismissed = 601, @@ -992,6 +994,99 @@ static const char * const IVRCompositor_Version = "IVRCompositor_007"; } // namespace vr +// ivrnotifications.h +namespace vr +{ + +#if defined(__linux__) || defined(__APPLE__) + // The 32-bit version of gcc has the alignment requirement for uint64 and double set to + // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. + // The 64-bit version of gcc has the alignment requirement for these types set to + // 8 meaning that unless we use #pragma pack(4) our structures will get bigger. + // The 64-bit structure packing has to match the 32-bit structure packing for each platform. + #pragma pack( push, 4 ) +#else + #pragma pack( push, 8 ) +#endif + +const char * const NotificationTypeFriendUpdate = "FriendUpdate"; + +// Used for passing graphic data +struct NotificationBitmap +{ + char *bytes; + int32_t width; + int32_t height; + int32_t depth; +}; + +enum NotificationError_t +{ + k_ENotificationError_OK = 0, + k_ENotificationError_Fail = 1 +}; + +static const uint32_t k_unNotificationTypeMaxSize = 16; +static const uint32_t k_unNotificationTextMaxSize = 128; + +/** The types of events that could be posted (and what the parameters mean for each event type) */ +/*enum NotificationEventType +{ + Notification_None = 0, + + Notification_Dismissed = 101, // param1 = Device index + Notification_BeginInteraction = 102, // param1 = Device index + Notification_Scroll = 103, // param1 = Device index + Notification_ClickOn = 104, // param1 = Device index + Notification_ClickOff = 105, // param1 = Device index +};*/ + +/** An event posted by the server to all running applications */ +/*struct NotificationEvent_t +{ + NotificationEventType eventType; + int32_t x; // X coordinate in the notifications bitmap when the click happened + int32_t y; // Y coordinate in the notifications bitmap when the click happened + int32_t scroll_x; // X scrolling amount in the notifications bitmap coords + int32_t scroll_y; // Y scrolling amount in the notifications bitmap coords + uint32_t buttons; // Buttons pressed + + float eventAgeSeconds; +};*/ + +typedef uint32_t VRNotificationId; + +// This struct will be used for the history list of notifications +struct NotificationItem +{ + VRNotificationId notificationId; +}; + + + +#pragma pack( pop ) + +/** Allows notification sources to interact with the VR system + This current interface is not yet implemented. Do not use yet. */ +class IVRNotifications +{ +public: + /** Returns the last error that occurred */ + virtual uint32_t GetErrorString( NotificationError_t error, VR_OUT_STRING() char* pchBuffer, uint32_t unBufferSize ) = 0; + + VR_METHOD_DESC( Create a new notification. ) + virtual NotificationError_t CreateNotification( VROverlayHandle_t ulOverlayHandle, uint64_t ulUserValue, char *strType, char *strText, char *strCategory, NotificationBitmap *photo, /* out */ vr::VRNotificationId *notificationId ) = 0; + + VR_METHOD_DESC(Dismiss the notification) + virtual NotificationError_t DismissNotification( vr::VRNotificationId notificationId ) = 0; + +}; + +static const char * const IVRNotifications_Version = "IVRNotifications_001"; + +} // namespace vr + + // ivroverlay.h namespace vr { @@ -1030,6 +1125,7 @@ namespace vr VROverlayError_ArrayTooSmall = 22, VROverlayError_RequestFailed = 23, VROverlayError_InvalidTexture = 24, + VROverlayError_UnableToLoadFile = 25, }; /** Types of input supported by VR Overlays */ @@ -1100,6 +1196,18 @@ namespace vr * Otherwise it will return k_ulOverlayHandleInvalid. */ virtual vr::VROverlayHandle_t GetHighQualityOverlay() = 0; + /** Fills the provided buffer with the string key of the overlay. Returns the size of buffer required to store the key, including + * the terminating null character. k_unVROverlayMaxKeyLength will be enough bytes to fit the string. */ + virtual uint32_t GetOverlayKey( VROverlayHandle_t ulOverlayHandle, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, VROverlayError *pError = 0L ) = 0; + + /** Fills the provided buffer with the friendly name of the overlay. Returns the size of buffer required to store the key, including + * the terminating null character. k_unVROverlayMaxNameLength will be enough bytes to fit the string. */ + virtual uint32_t GetOverlayName( VROverlayHandle_t ulOverlayHandle, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, VROverlayError *pError = 0L ) = 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 + * will be set and VROverlayError_ArrayTooSmall is returned. */ + virtual VROverlayError 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 * of the error enum value for all valid error codes */ virtual const char *GetOverlayErrorNameFromEnum( VROverlayError error ) = 0; @@ -1244,11 +1352,15 @@ namespace vr /** Sets the dashboard overlay to only appear when the specified process ID has scene focus */ virtual VROverlayError SetDashboardOverlaySceneProcess( VROverlayHandle_t ulOverlayHandle, uint32_t unProcessId ) = 0; - /** Gets the process ID that this system overlay requires to have scene focus */ + /** Gets the process ID that this dashboard overlay requires to have scene focus */ virtual VROverlayError GetDashboardOverlaySceneProcess( VROverlayHandle_t ulOverlayHandle, uint32_t *punProcessId ) = 0; + + /** Shows the dashboard. */ + virtual void ShowDashboard( const char *pchOverlayToShow ) = 0; + }; - static const char * const IVROverlay_Version = "IVROverlay_002"; + static const char * const IVROverlay_Version = "IVROverlay_003"; } // namespace vr // ivrrendermodels.h diff --git a/headers/openvr_api.cs b/headers/openvr_api.cs index fd6b1bcc..8911253f 100644 --- a/headers/openvr_api.cs +++ b/headers/openvr_api.cs @@ -149,6 +149,12 @@ class VRNativeEntrypoints internal static extern VROverlayError VR_IVROverlay_SetHighQualityOverlay(IntPtr instancePtr, ulong ulOverlayHandle); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetHighQualityOverlay")] internal static extern ulong VR_IVROverlay_GetHighQualityOverlay(IntPtr instancePtr); + [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetOverlayKey")] + internal static extern uint VR_IVROverlay_GetOverlayKey(IntPtr instancePtr, ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref VROverlayError pError); + [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetOverlayName")] + internal static extern uint VR_IVROverlay_GetOverlayName(IntPtr instancePtr, ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref VROverlayError pError); + [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetOverlayImageData")] + internal static extern VROverlayError VR_IVROverlay_GetOverlayImageData(IntPtr instancePtr, ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetOverlayErrorNameFromEnum")] internal static extern IntPtr VR_IVROverlay_GetOverlayErrorNameFromEnum(IntPtr instancePtr, VROverlayError error); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_SetOverlayFlag")] @@ -223,6 +229,8 @@ class VRNativeEntrypoints internal static extern VROverlayError VR_IVROverlay_SetDashboardOverlaySceneProcess(IntPtr instancePtr, ulong ulOverlayHandle, uint unProcessId); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_GetDashboardOverlaySceneProcess")] internal static extern VROverlayError VR_IVROverlay_GetDashboardOverlaySceneProcess(IntPtr instancePtr, ulong ulOverlayHandle, ref uint punProcessId); + [DllImportAttribute("openvr_api", EntryPoint = "VR_IVROverlay_ShowDashboard")] + internal static extern void VR_IVROverlay_ShowDashboard(IntPtr instancePtr, string pchOverlayToShow); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVRRenderModels_LoadRenderModel")] internal static extern bool VR_IVRRenderModels_LoadRenderModel(IntPtr instancePtr, string pchRenderModelName, ref RenderModel_t pRenderModel); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVRRenderModels_FreeRenderModel")] @@ -301,10 +309,8 @@ class VRNativeEntrypoints internal static extern void VR_IVRChaperoneSetup_ReloadFromDisk(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_NotificationStart")] - internal static extern NotificationError_t VR_IVRNotifications_NotificationStart(IntPtr instancePtr, ulong ulOverlayHandle, string strType, IntPtr pTexture, ulong ulUserValue, ref uint pNotificationId); - [DllImportAttribute("openvr_api", EntryPoint = "VR_IVRNotifications_UpdateTexture")] - internal static extern NotificationError_t VR_IVRNotifications_UpdateTexture(IntPtr instancePtr, uint notificationId, IntPtr pTexture); + [DllImportAttribute("openvr_api", EntryPoint = "VR_IVRNotifications_CreateNotification")] + internal static extern NotificationError_t VR_IVRNotifications_CreateNotification(IntPtr instancePtr, ulong ulOverlayHandle, ulong ulUserValue, string strType, string strText, string strCategory, ref NotificationBitmap photo, ref uint notificationId); [DllImportAttribute("openvr_api", EntryPoint = "VR_IVRNotifications_DismissNotification")] internal static extern NotificationError_t VR_IVRNotifications_DismissNotification(IntPtr instancePtr, uint notificationId); @@ -402,6 +408,9 @@ public abstract class IVROverlay public abstract VROverlayError DestroyOverlay(ulong ulOverlayHandle); public abstract VROverlayError SetHighQualityOverlay(ulong ulOverlayHandle); public abstract ulong GetHighQualityOverlay(); + public abstract uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref VROverlayError pError); + public abstract uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref VROverlayError pError); + public abstract VROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight); public abstract string GetOverlayErrorNameFromEnum(VROverlayError error); public abstract VROverlayError SetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,bool bEnabled); public abstract VROverlayError GetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,ref bool pbEnabled); @@ -439,6 +448,7 @@ public abstract class IVROverlay public abstract bool IsActiveDashboardOverlay(ulong ulOverlayHandle); public abstract VROverlayError SetDashboardOverlaySceneProcess(ulong ulOverlayHandle,uint unProcessId); public abstract VROverlayError GetDashboardOverlaySceneProcess(ulong ulOverlayHandle,ref uint punProcessId); + public abstract void ShowDashboard(string pchOverlayToShow); } @@ -508,8 +518,7 @@ public abstract class IVRNotifications { public abstract IntPtr GetIntPtr(); public abstract uint GetErrorString(NotificationError_t error,System.Text.StringBuilder pchBuffer,uint unBufferSize); - public abstract NotificationError_t NotificationStart(ulong ulOverlayHandle,string strType,IntPtr pTexture,ulong ulUserValue,ref uint pNotificationId); - public abstract NotificationError_t UpdateTexture(uint notificationId,IntPtr pTexture); + public abstract NotificationError_t CreateNotification(ulong ulOverlayHandle,ulong ulUserValue,string strType,string strText,string strCategory,ref NotificationBitmap photo,ref uint notificationId); public abstract NotificationError_t DismissNotification(uint notificationId); } @@ -991,6 +1000,26 @@ public override ulong GetHighQualityOverlay() ulong result = VRNativeEntrypoints.VR_IVROverlay_GetHighQualityOverlay(m_pVROverlay); return result; } + public override uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref VROverlayError pError) + { + CheckIfUsable(); + uint result = VRNativeEntrypoints.VR_IVROverlay_GetOverlayKey(m_pVROverlay,ulOverlayHandle,pchValue,unBufferSize,ref pError); + return result; + } + public override uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref VROverlayError pError) + { + CheckIfUsable(); + uint result = VRNativeEntrypoints.VR_IVROverlay_GetOverlayName(m_pVROverlay,ulOverlayHandle,pchValue,unBufferSize,ref pError); + return result; + } + public override VROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight) + { + CheckIfUsable(); + punWidth = 0; + punHeight = 0; + VROverlayError result = VRNativeEntrypoints.VR_IVROverlay_GetOverlayImageData(m_pVROverlay,ulOverlayHandle,pvBuffer,unBufferSize,ref punWidth,ref punHeight); + return result; + } public override string GetOverlayErrorNameFromEnum(VROverlayError error) { CheckIfUsable(); @@ -1224,6 +1253,11 @@ public override VROverlayError GetDashboardOverlaySceneProcess(ulong ulOverlayHa VROverlayError result = VRNativeEntrypoints.VR_IVROverlay_GetDashboardOverlaySceneProcess(m_pVROverlay,ulOverlayHandle,ref punProcessId); return result; } + public override void ShowDashboard(string pchOverlayToShow) + { + CheckIfUsable(); + VRNativeEntrypoints.VR_IVROverlay_ShowDashboard(m_pVROverlay,pchOverlayToShow); + } } @@ -1557,17 +1591,11 @@ public override uint GetErrorString(NotificationError_t error,System.Text.String uint result = VRNativeEntrypoints.VR_IVRNotifications_GetErrorString(m_pVRNotifications,error,pchBuffer,unBufferSize); return result; } - public override NotificationError_t NotificationStart(ulong ulOverlayHandle,string strType,IntPtr pTexture,ulong ulUserValue,ref uint pNotificationId) - { - CheckIfUsable(); - pNotificationId = 0; - NotificationError_t result = VRNativeEntrypoints.VR_IVRNotifications_NotificationStart(m_pVRNotifications,ulOverlayHandle,strType,pTexture,ulUserValue,ref pNotificationId); - return result; - } - public override NotificationError_t UpdateTexture(uint notificationId,IntPtr pTexture) + public override NotificationError_t CreateNotification(ulong ulOverlayHandle,ulong ulUserValue,string strType,string strText,string strCategory,ref NotificationBitmap photo,ref uint notificationId) { CheckIfUsable(); - NotificationError_t result = VRNativeEntrypoints.VR_IVRNotifications_UpdateTexture(m_pVRNotifications,notificationId,pTexture); + notificationId = 0; + NotificationError_t result = VRNativeEntrypoints.VR_IVRNotifications_CreateNotification(m_pVRNotifications,ulOverlayHandle,ulUserValue,strType,strText,strCategory,ref photo,ref notificationId); return result; } public override NotificationError_t DismissNotification(uint notificationId) @@ -1700,6 +1728,8 @@ public enum EVREventType VREvent_DashboardThumbSelected = 504, VREvent_DashboardRequested = 505, VREvent_ResetDashboard = 506, + VREvent_RenderToast = 507, + VREvent_ImageLoaded = 508, VREvent_Notification_Show = 600, VREvent_Notification_Dismissed = 601, VREvent_Notification_BeginInteraction = 602, @@ -1812,6 +1842,7 @@ public enum VROverlayError ArrayTooSmall = 22, RequestFailed = 23, InvalidTexture = 24, + UnableToLoadFile = 25, } public enum VROverlayInputMethod { @@ -2120,11 +2151,13 @@ public static string GetStringForHmdError(HmdError error) public const uint k_unVROverlayMaxKeyLength = 128; public const uint k_unVROverlayMaxNameLength = 128; public const uint k_unMaxOverlayCount = 32; - public const string IVROverlay_Version = "IVROverlay_002"; + public const string IVROverlay_Version = "IVROverlay_003"; public const string IVRRenderModels_Version = "IVRRenderModels_001"; public const string IVRControlPanel_Version = "IVRControlPanel_001"; public const string IVRCameraAccess_Version = "IVRCameraAccess_001"; public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_001"; + public const uint k_unNotificationTypeMaxSize = 16; + public const uint k_unNotificationTextMaxSize = 128; public const string IVRNotifications_Version = "IVRNotifications_001"; } diff --git a/headers/openvr_api.json b/headers/openvr_api.json index 7aa189c1..b5932aaa 100644 --- a/headers/openvr_api.json +++ b/headers/openvr_api.json @@ -103,6 +103,8 @@ ,{"name": "VREvent_DashboardThumbSelected","value": "504"} ,{"name": "VREvent_DashboardRequested","value": "505"} ,{"name": "VREvent_ResetDashboard","value": "506"} + ,{"name": "VREvent_RenderToast","value": "507"} + ,{"name": "VREvent_ImageLoaded","value": "508"} ,{"name": "VREvent_Notification_Show","value": "600"} ,{"name": "VREvent_Notification_Dismissed","value": "601"} ,{"name": "VREvent_Notification_BeginInteraction","value": "602"} @@ -207,6 +209,7 @@ ,{"name": "VROverlayError_ArrayTooSmall","value": "22"} ,{"name": "VROverlayError_RequestFailed","value": "23"} ,{"name": "VROverlayError_InvalidTexture","value": "24"} + ,{"name": "VROverlayError_UnableToLoadFile","value": "25"} ]} , {"enumname": "vr::VROverlayInputMethod","values": [ {"name": "VROverlayInputMethod_None","value": "0"} @@ -262,7 +265,7 @@ ,{ "constname": "k_unMaxOverlayCount","consttype": "const uint32_t", "constval": "32"} ,{ - "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_002"} + "constname": "IVROverlay_Version","consttype": "const char *const", "constval": "IVROverlay_003"} ,{ "constname": "IVRRenderModels_Version","consttype": "const char *const", "constval": "IVRRenderModels_001"} ,{ @@ -271,6 +274,10 @@ "constname": "IVRCameraAccess_Version","consttype": "const char *const", "constval": "IVRCameraAccess_001"} ,{ "constname": "IVRChaperoneSetup_Version","consttype": "const char *const", "constval": "IVRChaperoneSetup_001"} +,{ + "constname": "k_unNotificationTypeMaxSize","consttype": "const uint32_t", "constval": "16"} +,{ + "constname": "k_unNotificationTextMaxSize","consttype": "const uint32_t", "constval": "128"} ,{ "constname": "IVRNotifications_Version","consttype": "const char *const", "constval": "IVRNotifications_001"} ], @@ -967,6 +974,40 @@ "methodname": "GetHighQualityOverlay", "returntype": "vr::VROverlayHandle_t" } +,{ + "classname": "vr::IVROverlay", + "methodname": "GetOverlayKey", + "returntype": "uint32_t", + "params": [ +{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, +{ "paramname": "pchValue" ,"out_string": " " ,"paramtype": "char *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32_t"}, +{ "paramname": "pError" ,"paramtype": "vr::VROverlayError *"} + ] +} +,{ + "classname": "vr::IVROverlay", + "methodname": "GetOverlayName", + "returntype": "uint32_t", + "params": [ +{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, +{ "paramname": "pchValue" ,"out_string": " " ,"paramtype": "char *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32_t"}, +{ "paramname": "pError" ,"paramtype": "vr::VROverlayError *"} + ] +} +,{ + "classname": "vr::IVROverlay", + "methodname": "GetOverlayImageData", + "returntype": "vr::VROverlayError", + "params": [ +{ "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, +{ "paramname": "pvBuffer" ,"paramtype": "void *"}, +{ "paramname": "unBufferSize" ,"paramtype": "uint32_t"}, +{ "paramname": "punWidth" ,"paramtype": "uint32_t *"}, +{ "paramname": "punHeight" ,"paramtype": "uint32_t *"} + ] +} ,{ "classname": "vr::IVROverlay", "methodname": "GetOverlayErrorNameFromEnum", @@ -1307,6 +1348,14 @@ { "paramname": "punProcessId" ,"paramtype": "uint32_t *"} ] } +,{ + "classname": "vr::IVROverlay", + "methodname": "ShowDashboard", + "returntype": "void", + "params": [ +{ "paramname": "pchOverlayToShow" ,"paramtype": "const char *"} + ] +} ,{ "classname": "vr::IVRRenderModels", "methodname": "LoadRenderModel", @@ -1633,23 +1682,16 @@ } ,{ "classname": "vr::IVRNotifications", - "methodname": "NotificationStart", "desc": "Find out the status of an asynchronous Notification result handle.", + "methodname": "CreateNotification", "desc": "Create a new notification.", "returntype": "vr::NotificationError_t", "params": [ { "paramname": "ulOverlayHandle" ,"paramtype": "vr::VROverlayHandle_t"}, -{ "paramname": "strType" ,"paramtype": "char *"}, -{ "paramname": "pTexture" ,"paramtype": "void *"}, { "paramname": "ulUserValue" ,"paramtype": "uint64_t"}, -{ "paramname": "pNotificationId" ,"paramtype": "vr::VRNotificationId *"} - ] -} -,{ - "classname": "vr::IVRNotifications", - "methodname": "UpdateTexture", "desc": "Update the texture of the notification", - "returntype": "vr::NotificationError_t", - "params": [ -{ "paramname": "notificationId" ,"paramtype": "vr::VRNotificationId"}, -{ "paramname": "pTexture" ,"paramtype": "void *"} +{ "paramname": "strType" ,"paramtype": "char *"}, +{ "paramname": "strText" ,"paramtype": "char *"}, +{ "paramname": "strCategory" ,"paramtype": "char *"}, +{ "paramname": "photo" ,"paramtype": "struct vr::NotificationBitmap *"}, +{ "paramname": "notificationId" ,"paramtype": "vr::VRNotificationId *"} ] } ,{ diff --git a/headers/openvr_capi.h b/headers/openvr_capi.h index a0dc882f..405202ae 100644 --- a/headers/openvr_capi.h +++ b/headers/openvr_capi.h @@ -40,6 +40,8 @@ typedef uint32_t TrackedDeviceIndex_t; typedef uint32_t VRNotificationId; +typedef uint64_t VROverlayHandle_t; + typedef struct VREvent_Controller_t { unsigned int button; @@ -84,11 +86,13 @@ unsigned long k_ulOverlayHandleInvalid = 0; unsigned int k_unVROverlayMaxKeyLength = 128; unsigned int k_unVROverlayMaxNameLength = 128; unsigned int k_unMaxOverlayCount = 32; -char * IVROverlay_Version = "IVROverlay_002"; +char * IVROverlay_Version = "IVROverlay_003"; char * IVRRenderModels_Version = "IVRRenderModels_001"; char * IVRControlPanel_Version = "IVRControlPanel_001"; char * IVRCameraAccess_Version = "IVRCameraAccess_001"; char * IVRChaperoneSetup_Version = "IVRChaperoneSetup_001"; +unsigned int k_unNotificationTypeMaxSize = 16; +unsigned int k_unNotificationTextMaxSize = 128; char * IVRNotifications_Version = "IVRNotifications_001"; typedef enum Hmd_Eye { @@ -196,6 +200,8 @@ typedef enum EVREventType EVREventType_VREvent_DashboardThumbSelected = 504, EVREventType_VREvent_DashboardRequested = 505, EVREventType_VREvent_ResetDashboard = 506, + EVREventType_VREvent_RenderToast = 507, + EVREventType_VREvent_ImageLoaded = 508, EVREventType_VREvent_Notification_Show = 600, EVREventType_VREvent_Notification_Dismissed = 601, EVREventType_VREvent_Notification_BeginInteraction = 602, @@ -308,6 +314,7 @@ typedef enum VROverlayError VROverlayError_ArrayTooSmall = 22, VROverlayError_RequestFailed = 23, VROverlayError_InvalidTexture = 24, + VROverlayError_UnableToLoadFile = 25, }; typedef enum VROverlayInputMethod { @@ -583,6 +590,9 @@ S_API VROverlayError VR_IVROverlay_CreateOverlay(intptr_t instancePtr, const cha S_API VROverlayError VR_IVROverlay_DestroyOverlay(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle); S_API VROverlayError VR_IVROverlay_SetHighQualityOverlay(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle); S_API VROverlayHandle_t VR_IVROverlay_GetHighQualityOverlay(intptr_t instancePtr); +S_API uint32_t VR_IVROverlay_GetOverlayKey(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, char * pchValue, uint32_t unBufferSize, VROverlayError * pError); +S_API uint32_t VR_IVROverlay_GetOverlayName(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, char * pchValue, uint32_t unBufferSize, VROverlayError * pError); +S_API VROverlayError VR_IVROverlay_GetOverlayImageData(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, void * pvBuffer, uint32_t unBufferSize, uint32_t * punWidth, uint32_t * punHeight); S_API char * VR_IVROverlay_GetOverlayErrorNameFromEnum(intptr_t instancePtr, VROverlayError error); S_API VROverlayError VR_IVROverlay_SetOverlayFlag(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled); S_API VROverlayError VR_IVROverlay_GetOverlayFlag(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, VROverlayFlags eOverlayFlag, bool * pbEnabled); @@ -620,6 +630,7 @@ S_API bool VR_IVROverlay_IsDashboardVisible(intptr_t instancePtr); S_API bool VR_IVROverlay_IsActiveDashboardOverlay(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle); S_API VROverlayError VR_IVROverlay_SetDashboardOverlaySceneProcess(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, uint32_t unProcessId); S_API VROverlayError VR_IVROverlay_GetDashboardOverlaySceneProcess(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, uint32_t * punProcessId); +S_API void VR_IVROverlay_ShowDashboard(intptr_t instancePtr, const char * pchOverlayToShow); S_API bool VR_IVRRenderModels_LoadRenderModel(intptr_t instancePtr, const char * pchRenderModelName, struct RenderModel_t * pRenderModel); S_API void VR_IVRRenderModels_FreeRenderModel(intptr_t instancePtr, struct RenderModel_t * pRenderModel); S_API uint32_t VR_IVRRenderModels_GetRenderModelName(intptr_t instancePtr, uint32_t unRenderModelIndex, char * pchRenderModelName, uint32_t unRenderModelNameLen); @@ -659,8 +670,7 @@ S_API void VR_IVRChaperoneSetup_RemoveWorkingTagPoseByName(intptr_t instancePtr, S_API void VR_IVRChaperoneSetup_RemoveAllWorkingTagPoses(intptr_t instancePtr); S_API void VR_IVRChaperoneSetup_ReloadFromDisk(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_NotificationStart(intptr_t instancePtr, VROverlayHandle_t ulOverlayHandle, char * strType, void * pTexture, uint64_t ulUserValue, VRNotificationId * pNotificationId); -S_API NotificationError_t VR_IVRNotifications_UpdateTexture(intptr_t instancePtr, VRNotificationId notificationId, void * pTexture); +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); // Global entry points diff --git a/headers/openvr_driver.h b/headers/openvr_driver.h index 5f29a8d9..4d35a3bf 100644 --- a/headers/openvr_driver.h +++ b/headers/openvr_driver.h @@ -277,6 +277,8 @@ enum EVREventType VREvent_DashboardThumbSelected = 504, // Sent to the overlay manager - data is overlay VREvent_DashboardRequested = 505, // Sent to the overlay manager - data is overlay VREvent_ResetDashboard = 506, // Send to the overlay manager + VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID + VREvent_ImageLoaded = 508, // Sent to overlays when a SetOverlayRaw or SetOverlayFromFile call finishes loading VREvent_Notification_Show = 600, VREvent_Notification_Dismissed = 601, diff --git a/lib/linux32/libopenvr_api.so b/lib/linux32/libopenvr_api.so index 24cdc01c..0f60028a 100755 Binary files a/lib/linux32/libopenvr_api.so and b/lib/linux32/libopenvr_api.so differ diff --git a/lib/linux64/libopenvr_api.so b/lib/linux64/libopenvr_api.so index 7febc5e4..a9f7b1c5 100755 Binary files a/lib/linux64/libopenvr_api.so and b/lib/linux64/libopenvr_api.so differ diff --git a/lib/osx32/libopenvr_api.dylib b/lib/osx32/libopenvr_api.dylib index fad10d0e..b9054cb4 100755 Binary files a/lib/osx32/libopenvr_api.dylib and b/lib/osx32/libopenvr_api.dylib differ diff --git a/lib/win32/openvr_api.lib b/lib/win32/openvr_api.lib index 24a92378..2185f14b 100644 Binary files a/lib/win32/openvr_api.lib and b/lib/win32/openvr_api.lib differ diff --git a/lib/win64/openvr_api.lib b/lib/win64/openvr_api.lib index 11374e15..9fae2e28 100644 Binary files a/lib/win64/openvr_api.lib and b/lib/win64/openvr_api.lib differ diff --git a/samples/bin/win32/openvr_api.dll b/samples/bin/win32/openvr_api.dll index 1704b2fb..749c89d3 100644 Binary files a/samples/bin/win32/openvr_api.dll and b/samples/bin/win32/openvr_api.dll differ diff --git a/samples/bin/win64/openvr_api.dll b/samples/bin/win64/openvr_api.dll index ce64b850..656c9658 100644 Binary files a/samples/bin/win64/openvr_api.dll and b/samples/bin/win64/openvr_api.dll differ