Plasma Engine  2.0
Loading...
Searching...
No Matches
OpenXRRemoting.h
1#pragma once
2
3#ifdef BUILDSYSTEM_ENABLE_OPENXR_REMOTING_SUPPORT
4# include <OpenXRPlugin/Basics.h>
5# include <OpenXRPlugin/OpenXRIncludes.h>
6
7# include <Foundation/Configuration/Singleton.h>
8# include <GameEngine/XR/XRRemotingInterface.h>
9
10
11class plOpenXR;
12
13class plOpenXRRemoting : public plXRRemotingInterface
14{
15 PL_DECLARE_SINGLETON_OF_INTERFACE(plOpenXRRemoting, plXRRemotingInterface);
16
17public:
18 plOpenXRRemoting(plOpenXR* pOpenXR);
19 ~plOpenXRRemoting();
20
21 virtual plResult Initialize() override;
22 virtual plResult Deinitialize() override;
23 virtual bool IsInitialized() const override;
24
25 virtual plResult Connect(const char* szRemoteHostName, uint16_t remotePort, bool bEnableAudio, int iMaxBitrateKbps) override;
26 virtual plResult Disconnect() override;
29
30private:
31 friend class plOpenXR;
32
33 void HandleEvent(const XrEventDataBuffer& event);
34
35private:
36 bool m_bInitialized = false;
37 plString m_sPreviousRuntime;
38 plOpenXR* m_pOpenXR = nullptr;
40};
41#endif
Definition Event.h:177
Definition OpenXRSingleton.h:25
XR Remoting singleton interface. Allows for streaming the XR application to a remote device.
Definition XRRemotingInterface.h:71
virtual plResult Initialize()=0
Initializes the XR Remoting system. Needs to be done before plXRInterface is initialized.
virtual plResult Disconnect()=0
Disconnects from the remote device.
virtual plResult Deinitialize()=0
Shuts down XR Remoting. This will fail if XR actors still exists or if plXRInterface is still initial...
virtual plEnum< plXRRemotingConnectionState > GetConnectionState() const =0
Get the current connection state to the remote device.
virtual bool IsInitialized() const =0
Returns whether XR Remoting is initialized.
virtual plResult Connect(const char *szRemoteHostName, uint16_t remotePort=8265, bool bEnableAudio=true, int iMaxBitrateKbps=20000)=0
Tries to connect to the remote device.
virtual plXRRemotingConnectionEvent & GetConnectionEvent()=0
Returns the connection event to subscribe to connection changes.
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54