forked from Detegr/openRBRVR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.cpp
36 lines (31 loc) · 779 Bytes
/
API.cpp
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
#pragma once
#include "IPlugin.h"
#include "VR.hpp"
#include "openRBRVR.hpp"
extern Config gCfg;
static openRBRVR* gPlugin;
extern "C" __declspec(dllexport) IPlugin* RBR_CreatePlugin(IRBRGame* game)
{
if (!gPlugin) {
gPlugin = new openRBRVR(game);
}
return gPlugin;
}
enum ApiOperations : uint64_t {
API_VERSION = 0,
RECENTER_VR_VIEW = 0b1,
TOGGLE_DEBUG_INFO = 0b10,
};
extern "C" __declspec(dllexport) int32_t openRBRVR_Exec(ApiOperations ops, uint64_t value)
{
if (ops == API_VERSION) {
return 1;
}
if (ops & RECENTER_VR_VIEW) {
vr::VRChaperone()->ResetZeroPose(vr::ETrackingUniverseOrigin::TrackingUniverseSeated);
}
if (ops & TOGGLE_DEBUG_INFO) {
gCfg.debug = !gCfg.debug;
}
return 0;
}