forked from LibreVR/Revive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
REV_Common.h
47 lines (36 loc) · 1.04 KB
/
REV_Common.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
#pragma once
#include "OVR_CAPI.h"
#include "openvr.h"
// Common structures
struct ovrTextureSwapChainData
{
int length, index;
ovrTextureSwapChainDesc desc;
vr::Texture_t current;
vr::Texture_t texture[2];
};
struct ovrMirrorTextureData
{
ovrMirrorTextureDesc desc;
vr::Texture_t texture;
};
struct ovrHmdStruct
{
// Controller states
bool ThumbStick[ovrHand_Count];
bool MenuWasPressed[ovrHand_Count];
float ThumbStickRange;
// Mirror window
ovrTextureSwapChain ColorTexture[ovrEye_Count];
// Device poses
vr::TrackedDevicePose_t poses[vr::k_unMaxTrackedDeviceCount];
vr::TrackedDevicePose_t gamePoses[vr::k_unMaxTrackedDeviceCount];
// OpenVR Interfaces
vr::IVRCompositor* compositor;
vr::IVRSettings* settings;
vr::IVROverlay* overlay;
};
// Common functions
bool REV_IsTouchConnected(vr::TrackedDeviceIndex_t hands[ovrHand_Count]);
unsigned int REV_TrackedDevicePoseToOVRStatusFlags(vr::TrackedDevicePose_t pose);
vr::VRTextureBounds_t REV_ViewportToTextureBounds(ovrRecti viewport, ovrTextureSwapChain swapChain, unsigned int flags);