Monado OpenXR Runtime
Loading...
Searching...
No Matches
XRTVRNotifications_001.hpp
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Implementation of the IVRNotifications interface version 001.
6 *
7 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
8 * @ingroup openvr_interfaces
9 */
10
11#pragma once
12
14
15#include "openvr_interfaces_unified.h"
16#include "openvr_forward_macros.h"
17
19
20
21namespace xrt::state_trackers::openvr {
22
23using namespace vr;
24
25class XRTVRNotifications_001 : public XRTVRNotifications_002, public vr::IVRNotifications_001
26{
27public:
28 // @todo Remove when clang-format is updated in CI
29 // clang-format off
31 // clang-format on
32
33 void *
34 getFnTable()
35 {
36 // No FnTable available for IVRNotifications_001.
37 return nullptr;
38 }
39
40 ForwardDeclareBase_IVRNotifications(XRTVRNotifications_002);
41
42 uint32_t
43 GetErrorString(NotificationError_t error, VR_OUT_STRING() char *pchBuffer, uint32_t unBufferSize) override
44 {
45 openvr_logger logger;
46 OPENVR_LOGGER_INIT(logger);
47
48 OPENVR_LOG_UNIMPLEMENTED_RET(logger, "GetErrorString(error=?, pchBuffer=%p, unBufferSize=%llu) -> 0", 0,
49 static_cast<const void *>(pchBuffer),
50 static_cast<unsigned long long>(unBufferSize));
51 }
52
53 NotificationError_t
54 CreateNotification(VROverlayHandle_t ulOverlayHandle,
55 uint64_t ulUserValue,
56 const char *strType,
57 const char *strText,
58 const char *strCategory,
59 const NotificationBitmap *photo,
60 vr::VRNotificationId *notificationId) override
61 {
62 openvr_logger logger;
63 OPENVR_LOGGER_INIT(logger);
64
66 logger,
67 "CreateNotification(ulOverlayHandle=%llu, ulUserValue=%llu, strType=%s, "
68 "strText=%s, strCategory=%s, photo=%p, notificationId=%p) -> k_ENotificationError_OK",
69 NotificationError_t::k_ENotificationError_OK, static_cast<unsigned long long>(ulOverlayHandle),
70 static_cast<unsigned long long>(ulUserValue), strType, strText, strCategory,
71 static_cast<const void *>(photo), static_cast<const void *>(notificationId));
72 }
73
74 NotificationError_t
75 DismissNotification(vr::VRNotificationId notificationId) override
76 {
77 openvr_logger logger;
78 OPENVR_LOGGER_INIT(logger);
79
81 logger, "DismissNotification(notificationId=%llu) -> k_ENotificationError_OK",
82 NotificationError_t::k_ENotificationError_OK, static_cast<unsigned long long>(notificationId));
83 }
84};
85
86}; // namespace xrt::state_trackers::openvr
Implementation of the latest IVRNotifications_002 interface version.
Definition XRTVRClientCore.hpp:152
Definition XRTVRNotifications_001.hpp:26
Definition XRTVRNotifications.hpp:24
Definitions missing from C++ header, present in C.
Definition blockqueue.hpp:15
Logging functions.
#define OPENVR_LOG_UNIMPLEMENTED_RET(logger, fmt, ret,...)
Specialized macro for logging an unimplemented function and returning a value.
Definition openvr_logger.hpp:57
Definition openvr_logger.hpp:30