-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathOpenVRProviderContext.h
51 lines (39 loc) · 1.05 KB
/
OpenVRProviderContext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <cassert>
#include "ProviderInterface/IUnityXRDisplay.h"
struct IUnityXRTrace;
struct IUnityXRDisplayInterface;
struct IUnityXRInputInterface;
class OpenVRDisplayProvider;
class OpenVRInputProvider;
struct OpenVRProviderContext
{
IUnityInterfaces *interfaces;
IUnityXRTrace *trace;
IUnityXRDisplayInterface *display;
OpenVRDisplayProvider *displayProvider;
IUnityXRInputInterface *input;
OpenVRInputProvider *inputProvider;
};
inline OpenVRProviderContext &GetProviderContext( void *data )
{
assert( data != NULL );
return *static_cast< OpenVRProviderContext * >( data );
}
class ProviderImpl
{
public:
ProviderImpl( OpenVRProviderContext &providerContext, UnitySubsystemHandle subsystemHandle )
: m_Context( providerContext )
, m_Handle( subsystemHandle )
{
}
virtual ~ProviderImpl() {}
virtual UnitySubsystemErrorCode Initialize() = 0;
virtual UnitySubsystemErrorCode Start() = 0;
virtual void Stop() = 0;
virtual void Shutdown() = 0;
protected:
OpenVRProviderContext &m_Context;
UnitySubsystemHandle m_Handle;
};