Monado OpenXR Runtime
Loading...
Searching...
No Matches
XRTVRSettings_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 IVRSettings 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#include "XRTVRSettings_002.hpp"
20
21
22namespace xrt::state_trackers::openvr {
23
24using namespace vr;
25
26class XRTVRSettings_001 : public XRTVRSettings_002, public vr::IVRSettings_001
27{
28public:
29 // @todo Remove when clang-format is updated in CI
30 // clang-format off
32 // clang-format on
33
34 FnTable_IVRSettings_001();
35
36 ForwardDeclareBase_IVRSettings(XRTVRSettings_002);
37
38 Forward_IVRSettings_GetSettingsErrorNameFromEnum();
39 Forward_IVRSettings_Sync();
40
41 bool
42 GetBool(const char *pchSection,
43 const char *pchSettingsKey,
44 bool bDefaultValue,
45 EVRSettingsError *peError = nullptr) override
46 {
47 openvr_logger logger;
48 OPENVR_LOGGER_INIT(logger);
49
51 logger, "GetBool(pchSection=%s, pchSettingsKey=%s, bDefaultValue=%d, peError=%p) -> false", false,
52 pchSection, pchSettingsKey, static_cast<int>(bDefaultValue), static_cast<const void *>(peError));
53 }
54
55 Forward_IVRSettings_SetBool();
56
57 int32_t
58 GetInt32(const char *pchSection,
59 const char *pchSettingsKey,
60 int32_t nDefaultValue,
61 EVRSettingsError *peError = nullptr) override
62 {
63 openvr_logger logger;
64 OPENVR_LOGGER_INIT(logger);
65
66 SET_ERROR(peError, EVRSettingsError::VRSettingsError_ReadFailed);
67
69 logger, "GetInt32(pchSection=%s, pchSettingsKey=%s, nDefaultValue=%lld, peError=%p) -> 0", 0,
70 pchSection, pchSettingsKey, static_cast<long long>(nDefaultValue),
71 static_cast<const void *>(peError));
72 }
73
74 Forward_IVRSettings_SetInt32();
75
76 float
77 GetFloat(const char *pchSection,
78 const char *pchSettingsKey,
79 float flDefaultValue,
80 EVRSettingsError *peError = nullptr) override
81 {
82 openvr_logger logger;
83 OPENVR_LOGGER_INIT(logger);
84
85 SET_ERROR(peError, EVRSettingsError::VRSettingsError_ReadFailed);
86
88 logger, "GetFloat(pchSection=%s, pchSettingsKey=%s, flDefaultValue=%f, peError=%p) -> 0.0", 0.0f,
89 pchSection, pchSettingsKey, flDefaultValue, static_cast<const void *>(peError));
90 }
91
92 Forward_IVRSettings_SetFloat();
93
94 void
95 GetString(const char *pchSection,
96 const char *pchSettingsKey,
97 VR_OUT_STRING() char *pchValue,
98 uint32_t unValueLen,
99 const char *pchDefaultValue,
100 EVRSettingsError *peError = nullptr) override
101 {
102 openvr_logger logger;
103 OPENVR_LOGGER_INIT(logger);
104
105 SET_ERROR(peError, EVRSettingsError::VRSettingsError_ReadFailed);
106
108 "GetString(pchSection=%s, pchSettingsKey=%s, pchValue=%p, unValueLen=%llu, "
109 "pchDefaultValue=%s, peError=%p)",
110 pchSection, pchSettingsKey, static_cast<const void *>(pchValue),
111 static_cast<unsigned long long>(unValueLen), pchDefaultValue,
112 static_cast<const void *>(peError));
113 }
114
115 Forward_IVRSettings_SetString();
116 Forward_IVRSettings_RemoveSection();
117 Forward_IVRSettings_RemoveKeyInSection();
118};
119
120}; // namespace xrt::state_trackers::openvr
Implementation of the latest IVRSettings_003 interface version.
Implementation of the IVRSettings interface version 002.
Definition XRTVRClientCore.hpp:152
Definition XRTVRSettings_001.hpp:27
Definition XRTVRSettings_002.hpp:26
Definitions missing from C++ header, present in C.
Definition blockqueue.hpp:15
#define SET_ERROR(error_ptr, ERROR)
Helper macro to set an OpenVR error pointer if it's not null.
Definition openvr_error.hpp:23
Logging functions.
#define OPENVR_LOG_UNIMPLEMENTED(logger, fmt,...)
Specialized macro for logging an unimplemented function.
Definition openvr_logger.hpp:51
#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