| 8042 | } |
| 8043 | |
| 8044 | public class OpenVR |
| 8045 | { |
| 8046 | |
| 8047 | public static uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType) |
| 8048 | { |
| 8049 | return OpenVRInterop.InitInternal(ref peError, eApplicationType); |
| 8050 | } |
| 8051 | |
| 8052 | public static uint InitInternal2(ref EVRInitError peError, EVRApplicationType eApplicationType, string pchStartupInfo) |
| 8053 | { |
| 8054 | return OpenVRInterop.InitInternal2(ref peError, eApplicationType, pchStartupInfo); |
| 8055 | } |
| 8056 | |
| 8057 | public static void ShutdownInternal() |
| 8058 | { |
| 8059 | OpenVRInterop.ShutdownInternal(); |
| 8060 | } |
| 8061 | |
| 8062 | public static bool IsHmdPresent() |
| 8063 | { |
| 8064 | return OpenVRInterop.IsHmdPresent(); |
| 8065 | } |
| 8066 | |
| 8067 | public static bool IsRuntimeInstalled() |
| 8068 | { |
| 8069 | return OpenVRInterop.IsRuntimeInstalled(); |
| 8070 | } |
| 8071 | |
| 8072 | public static string RuntimePath() |
| 8073 | { |
| 8074 | try |
| 8075 | { |
| 8076 | uint pathSize = 512; |
| 8077 | uint requiredPathSize = 512; |
| 8078 | System.Text.StringBuilder path = new System.Text.StringBuilder((int)pathSize); |
| 8079 | bool success = OpenVRInterop.GetRuntimePath(path, pathSize, ref requiredPathSize); |
| 8080 | if (success == false) |
| 8081 | { |
| 8082 | return null; |
| 8083 | } |
| 8084 | |
| 8085 | return path.ToString(); |
| 8086 | } catch |
| 8087 | { |
| 8088 | return OpenVRInterop.RuntimePath(); //this api is deprecated but here to support older unity versions |
| 8089 | } |
| 8090 | } |
| 8091 | |
| 8092 | public static string GetStringForHmdError(EVRInitError error) |
| 8093 | { |
| 8094 | return Marshal.PtrToStringAnsi(OpenVRInterop.GetStringForHmdError(error)); |
| 8095 | } |
| 8096 | |
| 8097 | public static IntPtr GetGenericInterface(string pchInterfaceVersion, ref EVRInitError peError) |
| 8098 | { |
| 8099 | return OpenVRInterop.GetGenericInterface(pchInterfaceVersion, ref peError); |
| 8100 | } |
| 8101 |
nothing calls this directly
no test coverage detected