Monado OpenXR Runtime
Loading...
Searching...
No Matches
XRTVRClientCore.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 latest IVRClientCore interface version.
6 *
7 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
8 * @ingroup openvr_interfaces
9 */
10
11#pragma once
12
13#include "xrt/xrt_instance.h"
14#include "xrt/xrt_system.h"
15#include "xrt/xrt_session.h"
16#include "xrt/xrt_compositor.h"
17
18#include "openvr_devices.hpp"
19#include "openvr_events.hpp"
20
22
23#include "openvr_interfaces_unified.h"
24#include "IVRClientCore_003.h"
25
26#include <memory>
27
28
29namespace xrt::state_trackers::openvr {
30
31#define SUPPORTED_CORE_INTERFACES(_) _(VRClientCore, _003)
32#define SUPPORTED_INTERFACES(_) \
33 _(VRRenderModels, _006) \
34 _(VRChaperone, _003) \
35 _(VRChaperone, _004) \
36 _(VRChaperoneSetup, _005) \
37 _(VRChaperoneSetup, _006) \
38 _(VRSystem, _021) \
39 _(VRSystem, _020) \
40 _(VRSystem, _019) \
41 _(VRSystem, _023) \
42 _(VRSystem, _026) \
43 _(VRCompositor, _022) \
44 _(VRCompositor, _024) _(VRCompositor, _026) _(VRCompositor, _027) _(VRCompositor, _028) _(VRCompositor, _029)
45
46class XRTVRClientCore_003 : public vr::IVRClientCore_003
47{
48public: // Fields
49 xrt_instance *xinst{nullptr};
50 xrt_app_instance *xainst{nullptr};
51
52 xrt_system *xsys{nullptr};
53 xrt_app_system *xasys{nullptr};
54 xrt_system_devices *xsysd{nullptr};
55 xrt_space_overseer *xso{nullptr};
56 xrt_system_compositor *xsysc{nullptr};
57
58 xrt_session *xs{nullptr};
59 xrt_compositor_native *xcn{nullptr};
60
61 std::shared_ptr<Compositor> compositor{};
62 std::shared_ptr<Devices> devices{};
63 std::shared_ptr<Events> events{};
64
65 vr::EVRApplicationType application_type{};
66
67#define XRTVR_INTERFACE_MEMBER(name, version) std::shared_ptr<vr::I##name##version> name##version{nullptr};
68 SUPPORTED_INTERFACES(XRTVR_INTERFACE_MEMBER)
69#undef XRTVR_INTERFACE_MEMBER
70
71private: // Methods
72 bool
73 isHeadless()
74 {
75 return this->application_type == vr::EVRApplicationType::VRApplication_Background;
76 }
77
78public: // Methods
79 vr::EVRInitError
80 Init(vr::EVRApplicationType eApplicationType, const char *pStartupInfo) override;
81
82 void
83 Cleanup() override;
84
85 vr::EVRInitError
86 IsInterfaceVersionValid(const char *pchInterfaceVersion) override;
87
88 void *
89 GetGenericInterface(const char *pchNameAndVersion, vr::EVRInitError *peError) override;
90
91 bool
92 BIsHmdPresent() override;
93
94 const char *
95 GetEnglishStringForHmdError(vr::EVRInitError eError) override;
96
97 const char *
98 GetIDForVRInitError(vr::EVRInitError eError) override;
99};
100
101}; // namespace xrt::state_trackers::openvr
Definition XRTVRClientCore.hpp:47
Implementation of compositor-related functionality for OpenVR.
Implementation of a dynamic OpenVR devices array using the xrt_system_devices interface.
Implementation of OpenVR event handling and related functionality.
This interface acts as a way to store per-application policy for xrt_instance.
Definition xrt_app_policy.h:36
This interface acts as a way to store per-application policy for xrt_system.
Definition xrt_app_policy.h:142
Main compositor server interface.
Definition xrt_compositor.h:2218
This interface acts as a root object for Monado.
Definition xrt_instance.h:124
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition xrt_session.h:264
Object that oversees and manages spaces, one created for each XR system.
Definition xrt_space.h:97
The system compositor handles composition for a system.
Definition xrt_compositor.h:2479
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition xrt_system.h:216
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition xrt_system.h:65
Header declaring XRT graphics interfaces.
Header for xrt_instance object.
Header for session object.
Header for system objects.