Monado OpenXR Runtime
Loading...
Searching...
No Matches
XRTVRCompositor_005.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 IVRCompositor interface version 005.
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
20
21
22namespace xrt::state_trackers::openvr {
23
24using namespace vr;
25
26// @note: We want to base this off 006, but we can't because Submit has the same signature with only differing return
27// types. C++ moment that I cannot find a workaround to.
28class XRTVRCompositor_005 : public XRTVRCompositor_007, public vr::IVRCompositor_005
29{
30public:
31 // @todo Remove when clang-format is updated in CI
32 // clang-format off
34 // clang-format on
35
36 void *
37 getFnTable()
38 {
39 // No FnTable available for IVRCompositor_005.
40 return nullptr;
41 }
42
43 ForwardDeclareBase_IVRCompositor(XRTVRCompositor_007);
44
45 Forward_IVRCompositor_GetLastError();
46 Forward_IVRCompositor_SetVSync();
47 Forward_IVRCompositor_GetVSync();
48 Forward_IVRCompositor_SetGamma();
49 Forward_IVRCompositor_GetGamma();
50
51 void
52 SetGraphicsDevice(Compositor_DeviceType eType, void *pDevice) override
53 {
54 openvr_logger logger;
55 OPENVR_LOGGER_INIT(logger);
56
57 OPENVR_LOG_UNIMPLEMENTED(logger, "SetGraphicsDevice(eType=%d, pDevice=%p)", static_cast<int>(eType),
58 static_cast<const void *>(pDevice));
59 }
60
61 void
62 WaitGetPoses(VR_ARRAY_COUNT(unPoseArrayCount) TrackedDevicePose_t *pPoseArray,
63 uint32_t unPoseArrayCount) override
64 {
65 // @todo This needs to save the error to be passed back by GetLastError
66 (void)ForwardBase_IVRCompositor::WaitGetPoses(pPoseArray, unPoseArrayCount, nullptr, 0);
67 }
68
69 void
70 Submit(Hmd_Eye eEye, void *pTexture, Compositor_TextureBounds *pBounds) override
71 {
72 openvr_logger logger;
73 OPENVR_LOGGER_INIT(logger);
74
75 // @todo Track what graphics API they choose in @ref SetGraphicsDevice and use that to submit for the
76 // right texture type. For now we don't really care about IVRCompositor_005 until some apps hits
77 // it.
78
79 OPENVR_LOG_UNIMPLEMENTED(logger, "Submit(eEye=%d, pTexture=%p, pBounds=%p)", static_cast<int>(eEye),
80 static_cast<const void *>(pTexture), static_cast<const void *>(pBounds));
81 }
82
83 Forward_IVRCompositor_ClearLastSubmittedFrame();
84
85 void
86 GetOverlayDefaults(Compositor_OverlaySettings *pSettings) override
87 {
88 openvr_logger logger;
89 OPENVR_LOGGER_INIT(logger);
90
91 // Zero out for now
92 U_ZERO(pSettings);
93
94 OPENVR_LOG_UNIMPLEMENTED(logger, "GetOverlayDefaults(pSettings=%p)",
95 static_cast<const void *>(pSettings));
96 }
97
98 void
99 SetOverlay(void *pTexture, Compositor_OverlaySettings *pSettings) override
100 {
101 openvr_logger logger;
102 OPENVR_LOGGER_INIT(logger);
103
104 OPENVR_LOG_UNIMPLEMENTED(logger, "SetOverlay(pTexture=%p, pSettings=%p)",
105 static_cast<const void *>(pTexture), static_cast<const void *>(pSettings));
106 }
107
108 void
109 SetOverlayRaw(void *buffer,
110 uint32_t width,
111 uint32_t height,
112 uint32_t depth,
113 Compositor_OverlaySettings *pSettings) override
114 {
115 openvr_logger logger;
116 OPENVR_LOGGER_INIT(logger);
117
119 "SetOverlayRaw(buffer=%p, width=%llu, height=%llu, depth=%llu, pSettings=%p)",
120 static_cast<const void *>(buffer), static_cast<unsigned long long>(width),
121 static_cast<unsigned long long>(height),
122 static_cast<unsigned long long>(depth), static_cast<const void *>(pSettings));
123 }
124
125 void
126 SetOverlayFromFile(const char *pchFilePath, Compositor_OverlaySettings *pSettings) override
127 {
128 openvr_logger logger;
129 OPENVR_LOGGER_INIT(logger);
130
131 OPENVR_LOG_UNIMPLEMENTED(logger, "SetOverlayFromFile(pchFilePath=%s, pSettings=%p)", pchFilePath,
132 static_cast<const void *>(pSettings));
133 }
134
135 void
136 ClearOverlay() override
137 {
138 openvr_logger logger;
139 OPENVR_LOGGER_INIT(logger);
140
141 OPENVR_LOG_UNIMPLEMENTED(logger, "ClearOverlay()");
142 }
143
144 Forward_IVRCompositor_GetFrameTiming();
145 Forward_IVRCompositor_FadeToColor();
146 Forward_IVRCompositor_FadeGrid_026();
147 Forward_IVRCompositor_CompositorBringToFront();
148 Forward_IVRCompositor_CompositorGoToBack();
149 Forward_IVRCompositor_CompositorQuit();
150 Forward_IVRCompositor_IsFullscreen();
151
152 bool
153 ComputeOverlayIntersection(const Compositor_OverlaySettings *pSettings,
154 float fAspectRatio,
155 vr::TrackingUniverseOrigin eOrigin,
156 vr::HmdVector3_t vSource,
157 vr::HmdVector3_t vDirection,
158 vr::HmdVector2_t *pvecIntersectionUV,
159 vr::HmdVector3_t *pvecIntersectionTrackingSpace) override
160 {
161 openvr_logger logger;
162 OPENVR_LOGGER_INIT(logger);
163
165 logger,
166 "ComputeOverlayIntersection(pSettings=%p, fAspectRatio=%f, eOrigin=%d, vSource=?, vDirection=?, "
167 "pvecIntersectionUV=%p, pvecIntersectionTrackingSpace=%p) -> false",
168 false, static_cast<const void *>(pSettings), fAspectRatio, static_cast<int>(eOrigin),
169 static_cast<const void *>(pvecIntersectionUV),
170 static_cast<const void *>(pvecIntersectionTrackingSpace));
171 }
172
173 Forward_IVRCompositor_SetTrackingSpace_008();
174 Forward_IVRCompositor_GetTrackingSpace_008();
175};
176
177}; // namespace xrt::state_trackers::openvr
Implementation of the latest IVRCompositor interface version.
Implementation of the IVRCompositor interface version 007.
Definition XRTVRClientCore.hpp:152
Definition XRTVRCompositor_005.hpp:29
Definition XRTVRCompositor_007.hpp:27
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition u_misc.h:68
Definitions missing from C++ header, present in C.
Definition blockqueue.hpp:15
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