forked from LibreVR/Revive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
REV_Error.h
53 lines (50 loc) · 2.86 KB
/
REV_Error.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
52
53
#pragma once
#include "OVR_CAPI.h"
#include "openvr.h"
ovrResult REV_InitErrorToOvrError(vr::EVRInitError error)
{
switch (error)
{
case vr::VRInitError_None: return ovrSuccess;
case vr::VRInitError_Unknown: return ovrError_Initialize;
case vr::VRInitError_Init_InstallationNotFound: return ovrError_LibLoad;
case vr::VRInitError_Init_InstallationCorrupt: return ovrError_LibLoad;
case vr::VRInitError_Init_VRClientDLLNotFound: return ovrError_LibLoad;
case vr::VRInitError_Init_FileNotFound: return ovrError_LibLoad;
case vr::VRInitError_Init_FactoryNotFound: return ovrError_ServiceConnection;
case vr::VRInitError_Init_InterfaceNotFound: return ovrError_ServiceConnection;
case vr::VRInitError_Init_InvalidInterface: return ovrError_MismatchedAdapters;
case vr::VRInitError_Init_UserConfigDirectoryInvalid: return ovrError_Initialize;
case vr::VRInitError_Init_HmdNotFound: return ovrError_NoHmd;
case vr::VRInitError_Init_NotInitialized: return ovrError_Initialize;
case vr::VRInitError_Init_PathRegistryNotFound: return ovrError_Initialize;
case vr::VRInitError_Init_NoConfigPath: return ovrError_Initialize;
case vr::VRInitError_Init_NoLogPath: return ovrError_Initialize;
case vr::VRInitError_Init_PathRegistryNotWritable: return ovrError_Initialize;
case vr::VRInitError_Init_AppInfoInitFailed: return ovrError_ServerStart;
//case vr::VRInitError_Init_Retry: return ovrError_Reinitialization; // Internal
case vr::VRInitError_Init_InitCanceledByUser: return ovrError_Initialize;
case vr::VRInitError_Init_AnotherAppLaunching: return ovrError_ServerStart;
case vr::VRInitError_Init_SettingsInitFailed: return ovrError_Initialize;
case vr::VRInitError_Init_ShuttingDown: return ovrError_ServerStart;
case vr::VRInitError_Init_TooManyObjects: return ovrError_Initialize;
case vr::VRInitError_Init_NoServerForBackgroundApp: return ovrError_ServerStart;
case vr::VRInitError_Init_NotSupportedWithCompositor: return ovrError_Initialize;
case vr::VRInitError_Init_NotAvailableToUtilityApps: return ovrError_Initialize;
}
}
ovrResult REV_CompositorErrorToOvrError(vr::EVRCompositorError error)
{
switch (error)
{
case vr::VRCompositorError_None: return ovrSuccess;
case vr::VRCompositorError_IncompatibleVersion: return ovrError_ServiceError;
case vr::VRCompositorError_DoNotHaveFocus: return ovrSuccess_NotVisible;
case vr::VRCompositorError_InvalidTexture: return ovrError_TextureSwapChainInvalid;
case vr::VRCompositorError_IsNotSceneApplication: return ovrError_InvalidSession;
case vr::VRCompositorError_TextureIsOnWrongDevice: return ovrError_TextureSwapChainInvalid;
case vr::VRCompositorError_TextureUsesUnsupportedFormat: return ovrError_TextureSwapChainInvalid;
case vr::VRCompositorError_SharedTexturesNotSupported: return ovrError_TextureSwapChainInvalid;
case vr::VRCompositorError_IndexOutOfRange: return ovrError_InvalidParameter;
}
}