IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
openvr_api.cs
1 //======= Copyright (c) Valve Corporation, All rights reserved. ===============
2 //
3 // Purpose: This file contains C#/managed code bindings for the OpenVR interfaces
4 // This file is auto-generated, do not edit it.
5 //
6 //=============================================================================
7 
8 using System;
9 using System.Runtime.InteropServices;
10 using Valve.VR;
11 
12 namespace Valve.VR
13 {
14 
15 [StructLayout(LayoutKind.Sequential)]
16 public struct IVRSystem
17 {
18  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
19  internal delegate void _GetRecommendedRenderTargetSize(ref uint pnWidth, ref uint pnHeight);
20  [MarshalAs(UnmanagedType.FunctionPtr)]
21  internal _GetRecommendedRenderTargetSize GetRecommendedRenderTargetSize;
22 
23  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
24  internal delegate HmdMatrix44_t _GetProjectionMatrix(EVREye eEye, float fNearZ, float fFarZ);
25  [MarshalAs(UnmanagedType.FunctionPtr)]
26  internal _GetProjectionMatrix GetProjectionMatrix;
27 
28  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
29  internal delegate void _GetProjectionRaw(EVREye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
30  [MarshalAs(UnmanagedType.FunctionPtr)]
31  internal _GetProjectionRaw GetProjectionRaw;
32 
33  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
34  internal delegate bool _ComputeDistortion(EVREye eEye, float fU, float fV, ref DistortionCoordinates_t pDistortionCoordinates);
35  [MarshalAs(UnmanagedType.FunctionPtr)]
36  internal _ComputeDistortion ComputeDistortion;
37 
38  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
39  internal delegate HmdMatrix34_t _GetEyeToHeadTransform(EVREye eEye);
40  [MarshalAs(UnmanagedType.FunctionPtr)]
41  internal _GetEyeToHeadTransform GetEyeToHeadTransform;
42 
43  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
44  internal delegate bool _GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync, ref ulong pulFrameCounter);
45  [MarshalAs(UnmanagedType.FunctionPtr)]
46  internal _GetTimeSinceLastVsync GetTimeSinceLastVsync;
47 
48  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
49  internal delegate int _GetD3D9AdapterIndex();
50  [MarshalAs(UnmanagedType.FunctionPtr)]
51  internal _GetD3D9AdapterIndex GetD3D9AdapterIndex;
52 
53  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
54  internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex);
55  [MarshalAs(UnmanagedType.FunctionPtr)]
56  internal _GetDXGIOutputInfo GetDXGIOutputInfo;
57 
58  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
59  internal delegate void _GetOutputDevice(ref ulong pnDevice, ETextureType textureType, IntPtr pInstance);
60  [MarshalAs(UnmanagedType.FunctionPtr)]
61  internal _GetOutputDevice GetOutputDevice;
62 
63  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
64  internal delegate bool _IsDisplayOnDesktop();
65  [MarshalAs(UnmanagedType.FunctionPtr)]
66  internal _IsDisplayOnDesktop IsDisplayOnDesktop;
67 
68  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
69  internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop);
70  [MarshalAs(UnmanagedType.FunctionPtr)]
71  internal _SetDisplayVisibility SetDisplayVisibility;
72 
73  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
74  internal delegate void _GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, [In, Out] TrackedDevicePose_t[] pTrackedDevicePoseArray, uint unTrackedDevicePoseArrayCount);
75  [MarshalAs(UnmanagedType.FunctionPtr)]
76  internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose;
77 
78  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79  internal delegate void _ResetSeatedZeroPose();
80  [MarshalAs(UnmanagedType.FunctionPtr)]
81  internal _ResetSeatedZeroPose ResetSeatedZeroPose;
82 
83  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84  internal delegate HmdMatrix34_t _GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
85  [MarshalAs(UnmanagedType.FunctionPtr)]
86  internal _GetSeatedZeroPoseToStandingAbsoluteTrackingPose GetSeatedZeroPoseToStandingAbsoluteTrackingPose;
87 
88  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89  internal delegate HmdMatrix34_t _GetRawZeroPoseToStandingAbsoluteTrackingPose();
90  [MarshalAs(UnmanagedType.FunctionPtr)]
91  internal _GetRawZeroPoseToStandingAbsoluteTrackingPose GetRawZeroPoseToStandingAbsoluteTrackingPose;
92 
93  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
94  internal delegate uint _GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass, [In, Out] uint[] punTrackedDeviceIndexArray, uint unTrackedDeviceIndexArrayCount, uint unRelativeToTrackedDeviceIndex);
95  [MarshalAs(UnmanagedType.FunctionPtr)]
96  internal _GetSortedTrackedDeviceIndicesOfClass GetSortedTrackedDeviceIndicesOfClass;
97 
98  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
99  internal delegate EDeviceActivityLevel _GetTrackedDeviceActivityLevel(uint unDeviceId);
100  [MarshalAs(UnmanagedType.FunctionPtr)]
101  internal _GetTrackedDeviceActivityLevel GetTrackedDeviceActivityLevel;
102 
103  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
104  internal delegate void _ApplyTransform(ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pTrackedDevicePose, ref HmdMatrix34_t pTransform);
105  [MarshalAs(UnmanagedType.FunctionPtr)]
106  internal _ApplyTransform ApplyTransform;
107 
108  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109  internal delegate uint _GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType);
110  [MarshalAs(UnmanagedType.FunctionPtr)]
111  internal _GetTrackedDeviceIndexForControllerRole GetTrackedDeviceIndexForControllerRole;
112 
113  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
114  internal delegate ETrackedControllerRole _GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex);
115  [MarshalAs(UnmanagedType.FunctionPtr)]
116  internal _GetControllerRoleForTrackedDeviceIndex GetControllerRoleForTrackedDeviceIndex;
117 
118  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
119  internal delegate ETrackedDeviceClass _GetTrackedDeviceClass(uint unDeviceIndex);
120  [MarshalAs(UnmanagedType.FunctionPtr)]
121  internal _GetTrackedDeviceClass GetTrackedDeviceClass;
122 
123  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124  internal delegate bool _IsTrackedDeviceConnected(uint unDeviceIndex);
125  [MarshalAs(UnmanagedType.FunctionPtr)]
126  internal _IsTrackedDeviceConnected IsTrackedDeviceConnected;
127 
128  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
129  internal delegate bool _GetBoolTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
130  [MarshalAs(UnmanagedType.FunctionPtr)]
131  internal _GetBoolTrackedDeviceProperty GetBoolTrackedDeviceProperty;
132 
133  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
134  internal delegate float _GetFloatTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
135  [MarshalAs(UnmanagedType.FunctionPtr)]
136  internal _GetFloatTrackedDeviceProperty GetFloatTrackedDeviceProperty;
137 
138  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
139  internal delegate int _GetInt32TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
140  [MarshalAs(UnmanagedType.FunctionPtr)]
141  internal _GetInt32TrackedDeviceProperty GetInt32TrackedDeviceProperty;
142 
143  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
144  internal delegate ulong _GetUint64TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
145  [MarshalAs(UnmanagedType.FunctionPtr)]
146  internal _GetUint64TrackedDeviceProperty GetUint64TrackedDeviceProperty;
147 
148  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
149  internal delegate HmdMatrix34_t _GetMatrix34TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
150  [MarshalAs(UnmanagedType.FunctionPtr)]
151  internal _GetMatrix34TrackedDeviceProperty GetMatrix34TrackedDeviceProperty;
152 
153  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
154  internal delegate uint _GetArrayTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, uint propType, IntPtr pBuffer, uint unBufferSize, ref ETrackedPropertyError pError);
155  [MarshalAs(UnmanagedType.FunctionPtr)]
156  internal _GetArrayTrackedDeviceProperty GetArrayTrackedDeviceProperty;
157 
158  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
159  internal delegate uint _GetStringTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, System.Text.StringBuilder pchValue, uint unBufferSize, ref ETrackedPropertyError pError);
160  [MarshalAs(UnmanagedType.FunctionPtr)]
161  internal _GetStringTrackedDeviceProperty GetStringTrackedDeviceProperty;
162 
163  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
164  internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);
165  [MarshalAs(UnmanagedType.FunctionPtr)]
166  internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;
167 
168  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
169  internal delegate bool _PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent);
170  [MarshalAs(UnmanagedType.FunctionPtr)]
171  internal _PollNextEvent PollNextEvent;
172 
173  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
174  internal delegate bool _PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose);
175  [MarshalAs(UnmanagedType.FunctionPtr)]
176  internal _PollNextEventWithPose PollNextEventWithPose;
177 
178  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
179  internal delegate IntPtr _GetEventTypeNameFromEnum(EVREventType eType);
180  [MarshalAs(UnmanagedType.FunctionPtr)]
181  internal _GetEventTypeNameFromEnum GetEventTypeNameFromEnum;
182 
183  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
184  internal delegate HiddenAreaMesh_t _GetHiddenAreaMesh(EVREye eEye, EHiddenAreaMeshType type);
185  [MarshalAs(UnmanagedType.FunctionPtr)]
186  internal _GetHiddenAreaMesh GetHiddenAreaMesh;
187 
188  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
189  internal delegate bool _GetControllerState(uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize);
190  [MarshalAs(UnmanagedType.FunctionPtr)]
191  internal _GetControllerState GetControllerState;
192 
193  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
194  internal delegate bool _GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin, uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize, ref TrackedDevicePose_t pTrackedDevicePose);
195  [MarshalAs(UnmanagedType.FunctionPtr)]
196  internal _GetControllerStateWithPose GetControllerStateWithPose;
197 
198  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
199  internal delegate void _TriggerHapticPulse(uint unControllerDeviceIndex, uint unAxisId, char usDurationMicroSec);
200  [MarshalAs(UnmanagedType.FunctionPtr)]
201  internal _TriggerHapticPulse TriggerHapticPulse;
202 
203  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
204  internal delegate IntPtr _GetButtonIdNameFromEnum(EVRButtonId eButtonId);
205  [MarshalAs(UnmanagedType.FunctionPtr)]
206  internal _GetButtonIdNameFromEnum GetButtonIdNameFromEnum;
207 
208  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
209  internal delegate IntPtr _GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType);
210  [MarshalAs(UnmanagedType.FunctionPtr)]
211  internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum;
212 
213  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
214  internal delegate bool _IsInputAvailable();
215  [MarshalAs(UnmanagedType.FunctionPtr)]
216  internal _IsInputAvailable IsInputAvailable;
217 
218  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
219  internal delegate bool _IsSteamVRDrawingControllers();
220  [MarshalAs(UnmanagedType.FunctionPtr)]
221  internal _IsSteamVRDrawingControllers IsSteamVRDrawingControllers;
222 
223  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
224  internal delegate bool _ShouldApplicationPause();
225  [MarshalAs(UnmanagedType.FunctionPtr)]
226  internal _ShouldApplicationPause ShouldApplicationPause;
227 
228  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
229  internal delegate bool _ShouldApplicationReduceRenderingWork();
230  [MarshalAs(UnmanagedType.FunctionPtr)]
231  internal _ShouldApplicationReduceRenderingWork ShouldApplicationReduceRenderingWork;
232 
233  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
234  internal delegate uint _DriverDebugRequest(uint unDeviceIndex, string pchRequest, System.Text.StringBuilder pchResponseBuffer, uint unResponseBufferSize);
235  [MarshalAs(UnmanagedType.FunctionPtr)]
236  internal _DriverDebugRequest DriverDebugRequest;
237 
238  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
239  internal delegate EVRFirmwareError _PerformFirmwareUpdate(uint unDeviceIndex);
240  [MarshalAs(UnmanagedType.FunctionPtr)]
241  internal _PerformFirmwareUpdate PerformFirmwareUpdate;
242 
243  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
244  internal delegate void _AcknowledgeQuit_Exiting();
245  [MarshalAs(UnmanagedType.FunctionPtr)]
246  internal _AcknowledgeQuit_Exiting AcknowledgeQuit_Exiting;
247 
248  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
249  internal delegate void _AcknowledgeQuit_UserPrompt();
250  [MarshalAs(UnmanagedType.FunctionPtr)]
251  internal _AcknowledgeQuit_UserPrompt AcknowledgeQuit_UserPrompt;
252 
253 }
254 
255 [StructLayout(LayoutKind.Sequential)]
256 public struct IVRExtendedDisplay
257 {
258  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
259  internal delegate void _GetWindowBounds(ref int pnX, ref int pnY, ref uint pnWidth, ref uint pnHeight);
260  [MarshalAs(UnmanagedType.FunctionPtr)]
261  internal _GetWindowBounds GetWindowBounds;
262 
263  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
264  internal delegate void _GetEyeOutputViewport(EVREye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
265  [MarshalAs(UnmanagedType.FunctionPtr)]
266  internal _GetEyeOutputViewport GetEyeOutputViewport;
267 
268  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
269  internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex, ref int pnAdapterOutputIndex);
270  [MarshalAs(UnmanagedType.FunctionPtr)]
271  internal _GetDXGIOutputInfo GetDXGIOutputInfo;
272 
273 }
274 
275 [StructLayout(LayoutKind.Sequential)]
276 public struct IVRTrackedCamera
277 {
278  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
279  internal delegate IntPtr _GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError);
280  [MarshalAs(UnmanagedType.FunctionPtr)]
281  internal _GetCameraErrorNameFromEnum GetCameraErrorNameFromEnum;
282 
283  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
284  internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, ref bool pHasCamera);
285  [MarshalAs(UnmanagedType.FunctionPtr)]
286  internal _HasCamera HasCamera;
287 
288  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
289  internal delegate EVRTrackedCameraError _GetCameraFrameSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref uint pnWidth, ref uint pnHeight, ref uint pnFrameBufferSize);
290  [MarshalAs(UnmanagedType.FunctionPtr)]
291  internal _GetCameraFrameSize GetCameraFrameSize;
292 
293  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
294  internal delegate EVRTrackedCameraError _GetCameraIntrinsics(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter);
295  [MarshalAs(UnmanagedType.FunctionPtr)]
296  internal _GetCameraIntrinsics GetCameraIntrinsics;
297 
298  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
299  internal delegate EVRTrackedCameraError _GetCameraProjection(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, ref HmdMatrix44_t pProjection);
300  [MarshalAs(UnmanagedType.FunctionPtr)]
301  internal _GetCameraProjection GetCameraProjection;
302 
303  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
304  internal delegate EVRTrackedCameraError _AcquireVideoStreamingService(uint nDeviceIndex, ref ulong pHandle);
305  [MarshalAs(UnmanagedType.FunctionPtr)]
306  internal _AcquireVideoStreamingService AcquireVideoStreamingService;
307 
308  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
309  internal delegate EVRTrackedCameraError _ReleaseVideoStreamingService(ulong hTrackedCamera);
310  [MarshalAs(UnmanagedType.FunctionPtr)]
311  internal _ReleaseVideoStreamingService ReleaseVideoStreamingService;
312 
313  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
314  internal delegate EVRTrackedCameraError _GetVideoStreamFrameBuffer(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pFrameBuffer, uint nFrameBufferSize, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
315  [MarshalAs(UnmanagedType.FunctionPtr)]
316  internal _GetVideoStreamFrameBuffer GetVideoStreamFrameBuffer;
317 
318  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
319  internal delegate EVRTrackedCameraError _GetVideoStreamTextureSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref VRTextureBounds_t pTextureBounds, ref uint pnWidth, ref uint pnHeight);
320  [MarshalAs(UnmanagedType.FunctionPtr)]
321  internal _GetVideoStreamTextureSize GetVideoStreamTextureSize;
322 
323  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
324  internal delegate EVRTrackedCameraError _GetVideoStreamTextureD3D11(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
325  [MarshalAs(UnmanagedType.FunctionPtr)]
326  internal _GetVideoStreamTextureD3D11 GetVideoStreamTextureD3D11;
327 
328  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
329  internal delegate EVRTrackedCameraError _GetVideoStreamTextureGL(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, ref uint pglTextureId, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
330  [MarshalAs(UnmanagedType.FunctionPtr)]
331  internal _GetVideoStreamTextureGL GetVideoStreamTextureGL;
332 
333  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
334  internal delegate EVRTrackedCameraError _ReleaseVideoStreamTextureGL(ulong hTrackedCamera, uint glTextureId);
335  [MarshalAs(UnmanagedType.FunctionPtr)]
336  internal _ReleaseVideoStreamTextureGL ReleaseVideoStreamTextureGL;
337 
338 }
339 
340 [StructLayout(LayoutKind.Sequential)]
341 public struct IVRApplications
342 {
343  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
344  internal delegate EVRApplicationError _AddApplicationManifest(string pchApplicationManifestFullPath, bool bTemporary);
345  [MarshalAs(UnmanagedType.FunctionPtr)]
346  internal _AddApplicationManifest AddApplicationManifest;
347 
348  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
349  internal delegate EVRApplicationError _RemoveApplicationManifest(string pchApplicationManifestFullPath);
350  [MarshalAs(UnmanagedType.FunctionPtr)]
351  internal _RemoveApplicationManifest RemoveApplicationManifest;
352 
353  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
354  internal delegate bool _IsApplicationInstalled(string pchAppKey);
355  [MarshalAs(UnmanagedType.FunctionPtr)]
356  internal _IsApplicationInstalled IsApplicationInstalled;
357 
358  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
359  internal delegate uint _GetApplicationCount();
360  [MarshalAs(UnmanagedType.FunctionPtr)]
361  internal _GetApplicationCount GetApplicationCount;
362 
363  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
364  internal delegate EVRApplicationError _GetApplicationKeyByIndex(uint unApplicationIndex, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
365  [MarshalAs(UnmanagedType.FunctionPtr)]
366  internal _GetApplicationKeyByIndex GetApplicationKeyByIndex;
367 
368  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
369  internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
370  [MarshalAs(UnmanagedType.FunctionPtr)]
371  internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId;
372 
373  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
374  internal delegate EVRApplicationError _LaunchApplication(string pchAppKey);
375  [MarshalAs(UnmanagedType.FunctionPtr)]
376  internal _LaunchApplication LaunchApplication;
377 
378  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
379  internal delegate EVRApplicationError _LaunchTemplateApplication(string pchTemplateAppKey, string pchNewAppKey, [In, Out] AppOverrideKeys_t[] pKeys, uint unKeys);
380  [MarshalAs(UnmanagedType.FunctionPtr)]
381  internal _LaunchTemplateApplication LaunchTemplateApplication;
382 
383  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
384  internal delegate EVRApplicationError _LaunchApplicationFromMimeType(string pchMimeType, string pchArgs);
385  [MarshalAs(UnmanagedType.FunctionPtr)]
386  internal _LaunchApplicationFromMimeType LaunchApplicationFromMimeType;
387 
388  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
389  internal delegate EVRApplicationError _LaunchDashboardOverlay(string pchAppKey);
390  [MarshalAs(UnmanagedType.FunctionPtr)]
391  internal _LaunchDashboardOverlay LaunchDashboardOverlay;
392 
393  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
394  internal delegate bool _CancelApplicationLaunch(string pchAppKey);
395  [MarshalAs(UnmanagedType.FunctionPtr)]
396  internal _CancelApplicationLaunch CancelApplicationLaunch;
397 
398  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
399  internal delegate EVRApplicationError _IdentifyApplication(uint unProcessId, string pchAppKey);
400  [MarshalAs(UnmanagedType.FunctionPtr)]
401  internal _IdentifyApplication IdentifyApplication;
402 
403  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
404  internal delegate uint _GetApplicationProcessId(string pchAppKey);
405  [MarshalAs(UnmanagedType.FunctionPtr)]
406  internal _GetApplicationProcessId GetApplicationProcessId;
407 
408  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
409  internal delegate IntPtr _GetApplicationsErrorNameFromEnum(EVRApplicationError error);
410  [MarshalAs(UnmanagedType.FunctionPtr)]
411  internal _GetApplicationsErrorNameFromEnum GetApplicationsErrorNameFromEnum;
412 
413  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
414  internal delegate uint _GetApplicationPropertyString(string pchAppKey, EVRApplicationProperty eProperty, System.Text.StringBuilder pchPropertyValueBuffer, uint unPropertyValueBufferLen, ref EVRApplicationError peError);
415  [MarshalAs(UnmanagedType.FunctionPtr)]
416  internal _GetApplicationPropertyString GetApplicationPropertyString;
417 
418  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
419  internal delegate bool _GetApplicationPropertyBool(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
420  [MarshalAs(UnmanagedType.FunctionPtr)]
421  internal _GetApplicationPropertyBool GetApplicationPropertyBool;
422 
423  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
424  internal delegate ulong _GetApplicationPropertyUint64(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
425  [MarshalAs(UnmanagedType.FunctionPtr)]
426  internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64;
427 
428  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
429  internal delegate EVRApplicationError _SetApplicationAutoLaunch(string pchAppKey, bool bAutoLaunch);
430  [MarshalAs(UnmanagedType.FunctionPtr)]
431  internal _SetApplicationAutoLaunch SetApplicationAutoLaunch;
432 
433  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
434  internal delegate bool _GetApplicationAutoLaunch(string pchAppKey);
435  [MarshalAs(UnmanagedType.FunctionPtr)]
436  internal _GetApplicationAutoLaunch GetApplicationAutoLaunch;
437 
438  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
439  internal delegate EVRApplicationError _SetDefaultApplicationForMimeType(string pchAppKey, string pchMimeType);
440  [MarshalAs(UnmanagedType.FunctionPtr)]
441  internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType;
442 
443  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
444  internal delegate bool _GetDefaultApplicationForMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
445  [MarshalAs(UnmanagedType.FunctionPtr)]
446  internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType;
447 
448  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
449  internal delegate bool _GetApplicationSupportedMimeTypes(string pchAppKey, System.Text.StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer);
450  [MarshalAs(UnmanagedType.FunctionPtr)]
451  internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes;
452 
453  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
454  internal delegate uint _GetApplicationsThatSupportMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer);
455  [MarshalAs(UnmanagedType.FunctionPtr)]
456  internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType;
457 
458  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
459  internal delegate uint _GetApplicationLaunchArguments(uint unHandle, System.Text.StringBuilder pchArgs, uint unArgs);
460  [MarshalAs(UnmanagedType.FunctionPtr)]
461  internal _GetApplicationLaunchArguments GetApplicationLaunchArguments;
462 
463  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
464  internal delegate EVRApplicationError _GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
465  [MarshalAs(UnmanagedType.FunctionPtr)]
466  internal _GetStartingApplication GetStartingApplication;
467 
468  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
469  internal delegate EVRApplicationTransitionState _GetTransitionState();
470  [MarshalAs(UnmanagedType.FunctionPtr)]
471  internal _GetTransitionState GetTransitionState;
472 
473  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
474  internal delegate EVRApplicationError _PerformApplicationPrelaunchCheck(string pchAppKey);
475  [MarshalAs(UnmanagedType.FunctionPtr)]
476  internal _PerformApplicationPrelaunchCheck PerformApplicationPrelaunchCheck;
477 
478  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
479  internal delegate IntPtr _GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state);
480  [MarshalAs(UnmanagedType.FunctionPtr)]
481  internal _GetApplicationsTransitionStateNameFromEnum GetApplicationsTransitionStateNameFromEnum;
482 
483  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
484  internal delegate bool _IsQuitUserPromptRequested();
485  [MarshalAs(UnmanagedType.FunctionPtr)]
486  internal _IsQuitUserPromptRequested IsQuitUserPromptRequested;
487 
488  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
489  internal delegate EVRApplicationError _LaunchInternalProcess(string pchBinaryPath, string pchArguments, string pchWorkingDirectory);
490  [MarshalAs(UnmanagedType.FunctionPtr)]
491  internal _LaunchInternalProcess LaunchInternalProcess;
492 
493  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
494  internal delegate uint _GetCurrentSceneProcessId();
495  [MarshalAs(UnmanagedType.FunctionPtr)]
496  internal _GetCurrentSceneProcessId GetCurrentSceneProcessId;
497 
498 }
499 
500 [StructLayout(LayoutKind.Sequential)]
501 public struct IVRChaperone
502 {
503  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
504  internal delegate ChaperoneCalibrationState _GetCalibrationState();
505  [MarshalAs(UnmanagedType.FunctionPtr)]
506  internal _GetCalibrationState GetCalibrationState;
507 
508  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
509  internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ);
510  [MarshalAs(UnmanagedType.FunctionPtr)]
511  internal _GetPlayAreaSize GetPlayAreaSize;
512 
513  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
514  internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect);
515  [MarshalAs(UnmanagedType.FunctionPtr)]
516  internal _GetPlayAreaRect GetPlayAreaRect;
517 
518  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
519  internal delegate void _ReloadInfo();
520  [MarshalAs(UnmanagedType.FunctionPtr)]
521  internal _ReloadInfo ReloadInfo;
522 
523  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
524  internal delegate void _SetSceneColor(HmdColor_t color);
525  [MarshalAs(UnmanagedType.FunctionPtr)]
526  internal _SetSceneColor SetSceneColor;
527 
528  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
529  internal delegate void _GetBoundsColor(ref HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, ref HmdColor_t pOutputCameraColor);
530  [MarshalAs(UnmanagedType.FunctionPtr)]
531  internal _GetBoundsColor GetBoundsColor;
532 
533  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
534  internal delegate bool _AreBoundsVisible();
535  [MarshalAs(UnmanagedType.FunctionPtr)]
536  internal _AreBoundsVisible AreBoundsVisible;
537 
538  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
539  internal delegate void _ForceBoundsVisible(bool bForce);
540  [MarshalAs(UnmanagedType.FunctionPtr)]
541  internal _ForceBoundsVisible ForceBoundsVisible;
542 
543 }
544 
545 [StructLayout(LayoutKind.Sequential)]
546 public struct IVRChaperoneSetup
547 {
548  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
549  internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile);
550  [MarshalAs(UnmanagedType.FunctionPtr)]
551  internal _CommitWorkingCopy CommitWorkingCopy;
552 
553  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
554  internal delegate void _RevertWorkingCopy();
555  [MarshalAs(UnmanagedType.FunctionPtr)]
556  internal _RevertWorkingCopy RevertWorkingCopy;
557 
558  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
559  internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ);
560  [MarshalAs(UnmanagedType.FunctionPtr)]
561  internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize;
562 
563  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
564  internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect);
565  [MarshalAs(UnmanagedType.FunctionPtr)]
566  internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect;
567 
568  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
569  internal delegate bool _GetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
570  [MarshalAs(UnmanagedType.FunctionPtr)]
571  internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo;
572 
573  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
574  internal delegate bool _GetLiveCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
575  [MarshalAs(UnmanagedType.FunctionPtr)]
576  internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo;
577 
578  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
579  internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
580  [MarshalAs(UnmanagedType.FunctionPtr)]
581  internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose;
582 
583  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
584  internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);
585  [MarshalAs(UnmanagedType.FunctionPtr)]
586  internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose;
587 
588  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
589  internal delegate void _SetWorkingPlayAreaSize(float sizeX, float sizeZ);
590  [MarshalAs(UnmanagedType.FunctionPtr)]
591  internal _SetWorkingPlayAreaSize SetWorkingPlayAreaSize;
592 
593  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
594  internal delegate void _SetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
595  [MarshalAs(UnmanagedType.FunctionPtr)]
596  internal _SetWorkingCollisionBoundsInfo SetWorkingCollisionBoundsInfo;
597 
598  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
599  internal delegate void _SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);
600  [MarshalAs(UnmanagedType.FunctionPtr)]
601  internal _SetWorkingSeatedZeroPoseToRawTrackingPose SetWorkingSeatedZeroPoseToRawTrackingPose;
602 
603  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
604  internal delegate void _SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
605  [MarshalAs(UnmanagedType.FunctionPtr)]
606  internal _SetWorkingStandingZeroPoseToRawTrackingPose SetWorkingStandingZeroPoseToRawTrackingPose;
607 
608  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
609  internal delegate void _ReloadFromDisk(EChaperoneConfigFile configFile);
610  [MarshalAs(UnmanagedType.FunctionPtr)]
611  internal _ReloadFromDisk ReloadFromDisk;
612 
613  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
614  internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
615  [MarshalAs(UnmanagedType.FunctionPtr)]
616  internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose;
617 
618  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
619  internal delegate void _SetWorkingCollisionBoundsTagsInfo([In, Out] byte[] pTagsBuffer, uint unTagCount);
620  [MarshalAs(UnmanagedType.FunctionPtr)]
621  internal _SetWorkingCollisionBoundsTagsInfo SetWorkingCollisionBoundsTagsInfo;
622 
623  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
624  internal delegate bool _GetLiveCollisionBoundsTagsInfo([In, Out] byte[] pTagsBuffer, ref uint punTagCount);
625  [MarshalAs(UnmanagedType.FunctionPtr)]
626  internal _GetLiveCollisionBoundsTagsInfo GetLiveCollisionBoundsTagsInfo;
627 
628  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
629  internal delegate bool _SetWorkingPhysicalBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
630  [MarshalAs(UnmanagedType.FunctionPtr)]
631  internal _SetWorkingPhysicalBoundsInfo SetWorkingPhysicalBoundsInfo;
632 
633  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
634  internal delegate bool _GetLivePhysicalBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
635  [MarshalAs(UnmanagedType.FunctionPtr)]
636  internal _GetLivePhysicalBoundsInfo GetLivePhysicalBoundsInfo;
637 
638  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
639  internal delegate bool _ExportLiveToBuffer(System.Text.StringBuilder pBuffer, ref uint pnBufferLength);
640  [MarshalAs(UnmanagedType.FunctionPtr)]
641  internal _ExportLiveToBuffer ExportLiveToBuffer;
642 
643  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
644  internal delegate bool _ImportFromBufferToWorking(string pBuffer, uint nImportFlags);
645  [MarshalAs(UnmanagedType.FunctionPtr)]
646  internal _ImportFromBufferToWorking ImportFromBufferToWorking;
647 
648 }
649 
650 [StructLayout(LayoutKind.Sequential)]
651 public struct IVRCompositor
652 {
653  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
654  internal delegate void _SetTrackingSpace(ETrackingUniverseOrigin eOrigin);
655  [MarshalAs(UnmanagedType.FunctionPtr)]
656  internal _SetTrackingSpace SetTrackingSpace;
657 
658  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
659  internal delegate ETrackingUniverseOrigin _GetTrackingSpace();
660  [MarshalAs(UnmanagedType.FunctionPtr)]
661  internal _GetTrackingSpace GetTrackingSpace;
662 
663  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
664  internal delegate EVRCompositorError _WaitGetPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
665  [MarshalAs(UnmanagedType.FunctionPtr)]
666  internal _WaitGetPoses WaitGetPoses;
667 
668  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
669  internal delegate EVRCompositorError _GetLastPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
670  [MarshalAs(UnmanagedType.FunctionPtr)]
671  internal _GetLastPoses GetLastPoses;
672 
673  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
674  internal delegate EVRCompositorError _GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex, ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pOutputGamePose);
675  [MarshalAs(UnmanagedType.FunctionPtr)]
676  internal _GetLastPoseForTrackedDeviceIndex GetLastPoseForTrackedDeviceIndex;
677 
678  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
679  internal delegate EVRCompositorError _Submit(EVREye eEye, ref Texture_t pTexture, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags);
680  [MarshalAs(UnmanagedType.FunctionPtr)]
681  internal _Submit Submit;
682 
683  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
684  internal delegate void _ClearLastSubmittedFrame();
685  [MarshalAs(UnmanagedType.FunctionPtr)]
686  internal _ClearLastSubmittedFrame ClearLastSubmittedFrame;
687 
688  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
689  internal delegate void _PostPresentHandoff();
690  [MarshalAs(UnmanagedType.FunctionPtr)]
691  internal _PostPresentHandoff PostPresentHandoff;
692 
693  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
694  internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo);
695  [MarshalAs(UnmanagedType.FunctionPtr)]
696  internal _GetFrameTiming GetFrameTiming;
697 
698  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
699  internal delegate uint _GetFrameTimings(ref Compositor_FrameTiming pTiming, uint nFrames);
700  [MarshalAs(UnmanagedType.FunctionPtr)]
701  internal _GetFrameTimings GetFrameTimings;
702 
703  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
704  internal delegate float _GetFrameTimeRemaining();
705  [MarshalAs(UnmanagedType.FunctionPtr)]
706  internal _GetFrameTimeRemaining GetFrameTimeRemaining;
707 
708  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
709  internal delegate void _GetCumulativeStats(ref Compositor_CumulativeStats pStats, uint nStatsSizeInBytes);
710  [MarshalAs(UnmanagedType.FunctionPtr)]
711  internal _GetCumulativeStats GetCumulativeStats;
712 
713  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
714  internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground);
715  [MarshalAs(UnmanagedType.FunctionPtr)]
716  internal _FadeToColor FadeToColor;
717 
718  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
719  internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground);
720  [MarshalAs(UnmanagedType.FunctionPtr)]
721  internal _GetCurrentFadeColor GetCurrentFadeColor;
722 
723  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
724  internal delegate void _FadeGrid(float fSeconds, bool bFadeIn);
725  [MarshalAs(UnmanagedType.FunctionPtr)]
726  internal _FadeGrid FadeGrid;
727 
728  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
729  internal delegate float _GetCurrentGridAlpha();
730  [MarshalAs(UnmanagedType.FunctionPtr)]
731  internal _GetCurrentGridAlpha GetCurrentGridAlpha;
732 
733  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
734  internal delegate EVRCompositorError _SetSkyboxOverride([In, Out] Texture_t[] pTextures, uint unTextureCount);
735  [MarshalAs(UnmanagedType.FunctionPtr)]
736  internal _SetSkyboxOverride SetSkyboxOverride;
737 
738  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
739  internal delegate void _ClearSkyboxOverride();
740  [MarshalAs(UnmanagedType.FunctionPtr)]
741  internal _ClearSkyboxOverride ClearSkyboxOverride;
742 
743  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
744  internal delegate void _CompositorBringToFront();
745  [MarshalAs(UnmanagedType.FunctionPtr)]
746  internal _CompositorBringToFront CompositorBringToFront;
747 
748  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
749  internal delegate void _CompositorGoToBack();
750  [MarshalAs(UnmanagedType.FunctionPtr)]
751  internal _CompositorGoToBack CompositorGoToBack;
752 
753  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
754  internal delegate void _CompositorQuit();
755  [MarshalAs(UnmanagedType.FunctionPtr)]
756  internal _CompositorQuit CompositorQuit;
757 
758  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
759  internal delegate bool _IsFullscreen();
760  [MarshalAs(UnmanagedType.FunctionPtr)]
761  internal _IsFullscreen IsFullscreen;
762 
763  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
764  internal delegate uint _GetCurrentSceneFocusProcess();
765  [MarshalAs(UnmanagedType.FunctionPtr)]
766  internal _GetCurrentSceneFocusProcess GetCurrentSceneFocusProcess;
767 
768  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
769  internal delegate uint _GetLastFrameRenderer();
770  [MarshalAs(UnmanagedType.FunctionPtr)]
771  internal _GetLastFrameRenderer GetLastFrameRenderer;
772 
773  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
774  internal delegate bool _CanRenderScene();
775  [MarshalAs(UnmanagedType.FunctionPtr)]
776  internal _CanRenderScene CanRenderScene;
777 
778  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
779  internal delegate void _ShowMirrorWindow();
780  [MarshalAs(UnmanagedType.FunctionPtr)]
781  internal _ShowMirrorWindow ShowMirrorWindow;
782 
783  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
784  internal delegate void _HideMirrorWindow();
785  [MarshalAs(UnmanagedType.FunctionPtr)]
786  internal _HideMirrorWindow HideMirrorWindow;
787 
788  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
789  internal delegate bool _IsMirrorWindowVisible();
790  [MarshalAs(UnmanagedType.FunctionPtr)]
791  internal _IsMirrorWindowVisible IsMirrorWindowVisible;
792 
793  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
794  internal delegate void _CompositorDumpImages();
795  [MarshalAs(UnmanagedType.FunctionPtr)]
796  internal _CompositorDumpImages CompositorDumpImages;
797 
798  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
799  internal delegate bool _ShouldAppRenderWithLowResources();
800  [MarshalAs(UnmanagedType.FunctionPtr)]
801  internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources;
802 
803  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
804  internal delegate void _ForceInterleavedReprojectionOn(bool bOverride);
805  [MarshalAs(UnmanagedType.FunctionPtr)]
806  internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn;
807 
808  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
809  internal delegate void _ForceReconnectProcess();
810  [MarshalAs(UnmanagedType.FunctionPtr)]
811  internal _ForceReconnectProcess ForceReconnectProcess;
812 
813  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
814  internal delegate void _SuspendRendering(bool bSuspend);
815  [MarshalAs(UnmanagedType.FunctionPtr)]
816  internal _SuspendRendering SuspendRendering;
817 
818  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
819  internal delegate EVRCompositorError _GetMirrorTextureD3D11(EVREye eEye, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView);
820  [MarshalAs(UnmanagedType.FunctionPtr)]
821  internal _GetMirrorTextureD3D11 GetMirrorTextureD3D11;
822 
823  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
824  internal delegate void _ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView);
825  [MarshalAs(UnmanagedType.FunctionPtr)]
826  internal _ReleaseMirrorTextureD3D11 ReleaseMirrorTextureD3D11;
827 
828  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
829  internal delegate EVRCompositorError _GetMirrorTextureGL(EVREye eEye, ref uint pglTextureId, IntPtr pglSharedTextureHandle);
830  [MarshalAs(UnmanagedType.FunctionPtr)]
831  internal _GetMirrorTextureGL GetMirrorTextureGL;
832 
833  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
834  internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle);
835  [MarshalAs(UnmanagedType.FunctionPtr)]
836  internal _ReleaseSharedGLTexture ReleaseSharedGLTexture;
837 
838  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
839  internal delegate void _LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
840  [MarshalAs(UnmanagedType.FunctionPtr)]
841  internal _LockGLSharedTextureForAccess LockGLSharedTextureForAccess;
842 
843  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
844  internal delegate void _UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
845  [MarshalAs(UnmanagedType.FunctionPtr)]
846  internal _UnlockGLSharedTextureForAccess UnlockGLSharedTextureForAccess;
847 
848  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
849  internal delegate uint _GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue, uint unBufferSize);
850  [MarshalAs(UnmanagedType.FunctionPtr)]
851  internal _GetVulkanInstanceExtensionsRequired GetVulkanInstanceExtensionsRequired;
852 
853  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
854  internal delegate uint _GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice, System.Text.StringBuilder pchValue, uint unBufferSize);
855  [MarshalAs(UnmanagedType.FunctionPtr)]
856  internal _GetVulkanDeviceExtensionsRequired GetVulkanDeviceExtensionsRequired;
857 
858  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
859  internal delegate void _SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode);
860  [MarshalAs(UnmanagedType.FunctionPtr)]
861  internal _SetExplicitTimingMode SetExplicitTimingMode;
862 
863  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
864  internal delegate EVRCompositorError _SubmitExplicitTimingData();
865  [MarshalAs(UnmanagedType.FunctionPtr)]
866  internal _SubmitExplicitTimingData SubmitExplicitTimingData;
867 
868 }
869 
870 [StructLayout(LayoutKind.Sequential)]
871 public struct IVROverlay
872 {
873  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
874  internal delegate EVROverlayError _FindOverlay(string pchOverlayKey, ref ulong pOverlayHandle);
875  [MarshalAs(UnmanagedType.FunctionPtr)]
876  internal _FindOverlay FindOverlay;
877 
878  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
879  internal delegate EVROverlayError _CreateOverlay(string pchOverlayKey, string pchOverlayName, ref ulong pOverlayHandle);
880  [MarshalAs(UnmanagedType.FunctionPtr)]
881  internal _CreateOverlay CreateOverlay;
882 
883  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
884  internal delegate EVROverlayError _DestroyOverlay(ulong ulOverlayHandle);
885  [MarshalAs(UnmanagedType.FunctionPtr)]
886  internal _DestroyOverlay DestroyOverlay;
887 
888  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
889  internal delegate EVROverlayError _SetHighQualityOverlay(ulong ulOverlayHandle);
890  [MarshalAs(UnmanagedType.FunctionPtr)]
891  internal _SetHighQualityOverlay SetHighQualityOverlay;
892 
893  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
894  internal delegate ulong _GetHighQualityOverlay();
895  [MarshalAs(UnmanagedType.FunctionPtr)]
896  internal _GetHighQualityOverlay GetHighQualityOverlay;
897 
898  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
899  internal delegate uint _GetOverlayKey(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
900  [MarshalAs(UnmanagedType.FunctionPtr)]
901  internal _GetOverlayKey GetOverlayKey;
902 
903  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
904  internal delegate uint _GetOverlayName(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
905  [MarshalAs(UnmanagedType.FunctionPtr)]
906  internal _GetOverlayName GetOverlayName;
907 
908  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
909  internal delegate EVROverlayError _SetOverlayName(ulong ulOverlayHandle, string pchName);
910  [MarshalAs(UnmanagedType.FunctionPtr)]
911  internal _SetOverlayName SetOverlayName;
912 
913  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
914  internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);
915  [MarshalAs(UnmanagedType.FunctionPtr)]
916  internal _GetOverlayImageData GetOverlayImageData;
917 
918  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
919  internal delegate IntPtr _GetOverlayErrorNameFromEnum(EVROverlayError error);
920  [MarshalAs(UnmanagedType.FunctionPtr)]
921  internal _GetOverlayErrorNameFromEnum GetOverlayErrorNameFromEnum;
922 
923  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
924  internal delegate EVROverlayError _SetOverlayRenderingPid(ulong ulOverlayHandle, uint unPID);
925  [MarshalAs(UnmanagedType.FunctionPtr)]
926  internal _SetOverlayRenderingPid SetOverlayRenderingPid;
927 
928  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
929  internal delegate uint _GetOverlayRenderingPid(ulong ulOverlayHandle);
930  [MarshalAs(UnmanagedType.FunctionPtr)]
931  internal _GetOverlayRenderingPid GetOverlayRenderingPid;
932 
933  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
934  internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled);
935  [MarshalAs(UnmanagedType.FunctionPtr)]
936  internal _SetOverlayFlag SetOverlayFlag;
937 
938  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
939  internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled);
940  [MarshalAs(UnmanagedType.FunctionPtr)]
941  internal _GetOverlayFlag GetOverlayFlag;
942 
943  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
944  internal delegate EVROverlayError _SetOverlayColor(ulong ulOverlayHandle, float fRed, float fGreen, float fBlue);
945  [MarshalAs(UnmanagedType.FunctionPtr)]
946  internal _SetOverlayColor SetOverlayColor;
947 
948  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
949  internal delegate EVROverlayError _GetOverlayColor(ulong ulOverlayHandle, ref float pfRed, ref float pfGreen, ref float pfBlue);
950  [MarshalAs(UnmanagedType.FunctionPtr)]
951  internal _GetOverlayColor GetOverlayColor;
952 
953  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
954  internal delegate EVROverlayError _SetOverlayAlpha(ulong ulOverlayHandle, float fAlpha);
955  [MarshalAs(UnmanagedType.FunctionPtr)]
956  internal _SetOverlayAlpha SetOverlayAlpha;
957 
958  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
959  internal delegate EVROverlayError _GetOverlayAlpha(ulong ulOverlayHandle, ref float pfAlpha);
960  [MarshalAs(UnmanagedType.FunctionPtr)]
961  internal _GetOverlayAlpha GetOverlayAlpha;
962 
963  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
964  internal delegate EVROverlayError _SetOverlayTexelAspect(ulong ulOverlayHandle, float fTexelAspect);
965  [MarshalAs(UnmanagedType.FunctionPtr)]
966  internal _SetOverlayTexelAspect SetOverlayTexelAspect;
967 
968  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
969  internal delegate EVROverlayError _GetOverlayTexelAspect(ulong ulOverlayHandle, ref float pfTexelAspect);
970  [MarshalAs(UnmanagedType.FunctionPtr)]
971  internal _GetOverlayTexelAspect GetOverlayTexelAspect;
972 
973  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
974  internal delegate EVROverlayError _SetOverlaySortOrder(ulong ulOverlayHandle, uint unSortOrder);
975  [MarshalAs(UnmanagedType.FunctionPtr)]
976  internal _SetOverlaySortOrder SetOverlaySortOrder;
977 
978  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
979  internal delegate EVROverlayError _GetOverlaySortOrder(ulong ulOverlayHandle, ref uint punSortOrder);
980  [MarshalAs(UnmanagedType.FunctionPtr)]
981  internal _GetOverlaySortOrder GetOverlaySortOrder;
982 
983  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
984  internal delegate EVROverlayError _SetOverlayWidthInMeters(ulong ulOverlayHandle, float fWidthInMeters);
985  [MarshalAs(UnmanagedType.FunctionPtr)]
986  internal _SetOverlayWidthInMeters SetOverlayWidthInMeters;
987 
988  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
989  internal delegate EVROverlayError _GetOverlayWidthInMeters(ulong ulOverlayHandle, ref float pfWidthInMeters);
990  [MarshalAs(UnmanagedType.FunctionPtr)]
991  internal _GetOverlayWidthInMeters GetOverlayWidthInMeters;
992 
993  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
994  internal delegate EVROverlayError _SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters);
995  [MarshalAs(UnmanagedType.FunctionPtr)]
996  internal _SetOverlayAutoCurveDistanceRangeInMeters SetOverlayAutoCurveDistanceRangeInMeters;
997 
998  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
999  internal delegate EVROverlayError _GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, ref float pfMinDistanceInMeters, ref float pfMaxDistanceInMeters);
1000  [MarshalAs(UnmanagedType.FunctionPtr)]
1001  internal _GetOverlayAutoCurveDistanceRangeInMeters GetOverlayAutoCurveDistanceRangeInMeters;
1002 
1003  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1004  internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace);
1005  [MarshalAs(UnmanagedType.FunctionPtr)]
1006  internal _SetOverlayTextureColorSpace SetOverlayTextureColorSpace;
1007 
1008  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1009  internal delegate EVROverlayError _GetOverlayTextureColorSpace(ulong ulOverlayHandle, ref EColorSpace peTextureColorSpace);
1010  [MarshalAs(UnmanagedType.FunctionPtr)]
1011  internal _GetOverlayTextureColorSpace GetOverlayTextureColorSpace;
1012 
1013  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1014  internal delegate EVROverlayError _SetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
1015  [MarshalAs(UnmanagedType.FunctionPtr)]
1016  internal _SetOverlayTextureBounds SetOverlayTextureBounds;
1017 
1018  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1019  internal delegate EVROverlayError _GetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
1020  [MarshalAs(UnmanagedType.FunctionPtr)]
1021  internal _GetOverlayTextureBounds GetOverlayTextureBounds;
1022 
1023  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1024  internal delegate uint _GetOverlayRenderModel(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref HmdColor_t pColor, ref EVROverlayError pError);
1025  [MarshalAs(UnmanagedType.FunctionPtr)]
1026  internal _GetOverlayRenderModel GetOverlayRenderModel;
1027 
1028  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1029  internal delegate EVROverlayError _SetOverlayRenderModel(ulong ulOverlayHandle, string pchRenderModel, ref HmdColor_t pColor);
1030  [MarshalAs(UnmanagedType.FunctionPtr)]
1031  internal _SetOverlayRenderModel SetOverlayRenderModel;
1032 
1033  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1034  internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
1035  [MarshalAs(UnmanagedType.FunctionPtr)]
1036  internal _GetOverlayTransformType GetOverlayTransformType;
1037 
1038  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1039  internal delegate EVROverlayError _SetOverlayTransformAbsolute(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
1040  [MarshalAs(UnmanagedType.FunctionPtr)]
1041  internal _SetOverlayTransformAbsolute SetOverlayTransformAbsolute;
1042 
1043  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1044  internal delegate EVROverlayError _GetOverlayTransformAbsolute(ulong ulOverlayHandle, ref ETrackingUniverseOrigin peTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
1045  [MarshalAs(UnmanagedType.FunctionPtr)]
1046  internal _GetOverlayTransformAbsolute GetOverlayTransformAbsolute;
1047 
1048  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1049  internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, uint unTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
1050  [MarshalAs(UnmanagedType.FunctionPtr)]
1051  internal _SetOverlayTransformTrackedDeviceRelative SetOverlayTransformTrackedDeviceRelative;
1052 
1053  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1054  internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, ref uint punTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
1055  [MarshalAs(UnmanagedType.FunctionPtr)]
1056  internal _GetOverlayTransformTrackedDeviceRelative GetOverlayTransformTrackedDeviceRelative;
1057 
1058  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1059  internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, uint unDeviceIndex, string pchComponentName);
1060  [MarshalAs(UnmanagedType.FunctionPtr)]
1061  internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent;
1062 
1063  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1064  internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameSize);
1065  [MarshalAs(UnmanagedType.FunctionPtr)]
1066  internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;
1067 
1068  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1069  internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
1070  [MarshalAs(UnmanagedType.FunctionPtr)]
1071  internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative;
1072 
1073  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1074  internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
1075  [MarshalAs(UnmanagedType.FunctionPtr)]
1076  internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative;
1077 
1078  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1079  internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);
1080  [MarshalAs(UnmanagedType.FunctionPtr)]
1081  internal _ShowOverlay ShowOverlay;
1082 
1083  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1084  internal delegate EVROverlayError _HideOverlay(ulong ulOverlayHandle);
1085  [MarshalAs(UnmanagedType.FunctionPtr)]
1086  internal _HideOverlay HideOverlay;
1087 
1088  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1089  internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle);
1090  [MarshalAs(UnmanagedType.FunctionPtr)]
1091  internal _IsOverlayVisible IsOverlayVisible;
1092 
1093  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1094  internal delegate EVROverlayError _GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);
1095  [MarshalAs(UnmanagedType.FunctionPtr)]
1096  internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates;
1097 
1098  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1099  internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent);
1100  [MarshalAs(UnmanagedType.FunctionPtr)]
1101  internal _PollNextOverlayEvent PollNextOverlayEvent;
1102 
1103  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1104  internal delegate EVROverlayError _GetOverlayInputMethod(ulong ulOverlayHandle, ref VROverlayInputMethod peInputMethod);
1105  [MarshalAs(UnmanagedType.FunctionPtr)]
1106  internal _GetOverlayInputMethod GetOverlayInputMethod;
1107 
1108  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1109  internal delegate EVROverlayError _SetOverlayInputMethod(ulong ulOverlayHandle, VROverlayInputMethod eInputMethod);
1110  [MarshalAs(UnmanagedType.FunctionPtr)]
1111  internal _SetOverlayInputMethod SetOverlayInputMethod;
1112 
1113  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1114  internal delegate EVROverlayError _GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
1115  [MarshalAs(UnmanagedType.FunctionPtr)]
1116  internal _GetOverlayMouseScale GetOverlayMouseScale;
1117 
1118  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1119  internal delegate EVROverlayError _SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
1120  [MarshalAs(UnmanagedType.FunctionPtr)]
1121  internal _SetOverlayMouseScale SetOverlayMouseScale;
1122 
1123  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1124  internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);
1125  [MarshalAs(UnmanagedType.FunctionPtr)]
1126  internal _ComputeOverlayIntersection ComputeOverlayIntersection;
1127 
1128  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1129  internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle);
1130  [MarshalAs(UnmanagedType.FunctionPtr)]
1131  internal _IsHoverTargetOverlay IsHoverTargetOverlay;
1132 
1133  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1134  internal delegate ulong _GetGamepadFocusOverlay();
1135  [MarshalAs(UnmanagedType.FunctionPtr)]
1136  internal _GetGamepadFocusOverlay GetGamepadFocusOverlay;
1137 
1138  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1139  internal delegate EVROverlayError _SetGamepadFocusOverlay(ulong ulNewFocusOverlay);
1140  [MarshalAs(UnmanagedType.FunctionPtr)]
1141  internal _SetGamepadFocusOverlay SetGamepadFocusOverlay;
1142 
1143  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1144  internal delegate EVROverlayError _SetOverlayNeighbor(EOverlayDirection eDirection, ulong ulFrom, ulong ulTo);
1145  [MarshalAs(UnmanagedType.FunctionPtr)]
1146  internal _SetOverlayNeighbor SetOverlayNeighbor;
1147 
1148  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1149  internal delegate EVROverlayError _MoveGamepadFocusToNeighbor(EOverlayDirection eDirection, ulong ulFrom);
1150  [MarshalAs(UnmanagedType.FunctionPtr)]
1151  internal _MoveGamepadFocusToNeighbor MoveGamepadFocusToNeighbor;
1152 
1153  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1154  internal delegate EVROverlayError _SetOverlayDualAnalogTransform(ulong ulOverlay, EDualAnalogWhich eWhich, IntPtr vCenter, float fRadius);
1155  [MarshalAs(UnmanagedType.FunctionPtr)]
1156  internal _SetOverlayDualAnalogTransform SetOverlayDualAnalogTransform;
1157 
1158  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1159  internal delegate EVROverlayError _GetOverlayDualAnalogTransform(ulong ulOverlay, EDualAnalogWhich eWhich, ref HmdVector2_t pvCenter, ref float pfRadius);
1160  [MarshalAs(UnmanagedType.FunctionPtr)]
1161  internal _GetOverlayDualAnalogTransform GetOverlayDualAnalogTransform;
1162 
1163  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1164  internal delegate EVROverlayError _SetOverlayTexture(ulong ulOverlayHandle, ref Texture_t pTexture);
1165  [MarshalAs(UnmanagedType.FunctionPtr)]
1166  internal _SetOverlayTexture SetOverlayTexture;
1167 
1168  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1169  internal delegate EVROverlayError _ClearOverlayTexture(ulong ulOverlayHandle);
1170  [MarshalAs(UnmanagedType.FunctionPtr)]
1171  internal _ClearOverlayTexture ClearOverlayTexture;
1172 
1173  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1174  internal delegate EVROverlayError _SetOverlayRaw(ulong ulOverlayHandle, IntPtr pvBuffer, uint unWidth, uint unHeight, uint unDepth);
1175  [MarshalAs(UnmanagedType.FunctionPtr)]
1176  internal _SetOverlayRaw SetOverlayRaw;
1177 
1178  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1179  internal delegate EVROverlayError _SetOverlayFromFile(ulong ulOverlayHandle, string pchFilePath);
1180  [MarshalAs(UnmanagedType.FunctionPtr)]
1181  internal _SetOverlayFromFile SetOverlayFromFile;
1182 
1183  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1184  internal delegate EVROverlayError _GetOverlayTexture(ulong ulOverlayHandle, ref IntPtr pNativeTextureHandle, IntPtr pNativeTextureRef, ref uint pWidth, ref uint pHeight, ref uint pNativeFormat, ref ETextureType pAPIType, ref EColorSpace pColorSpace, ref VRTextureBounds_t pTextureBounds);
1185  [MarshalAs(UnmanagedType.FunctionPtr)]
1186  internal _GetOverlayTexture GetOverlayTexture;
1187 
1188  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1189  internal delegate EVROverlayError _ReleaseNativeOverlayHandle(ulong ulOverlayHandle, IntPtr pNativeTextureHandle);
1190  [MarshalAs(UnmanagedType.FunctionPtr)]
1191  internal _ReleaseNativeOverlayHandle ReleaseNativeOverlayHandle;
1192 
1193  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1194  internal delegate EVROverlayError _GetOverlayTextureSize(ulong ulOverlayHandle, ref uint pWidth, ref uint pHeight);
1195  [MarshalAs(UnmanagedType.FunctionPtr)]
1196  internal _GetOverlayTextureSize GetOverlayTextureSize;
1197 
1198  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1199  internal delegate EVROverlayError _CreateDashboardOverlay(string pchOverlayKey, string pchOverlayFriendlyName, ref ulong pMainHandle, ref ulong pThumbnailHandle);
1200  [MarshalAs(UnmanagedType.FunctionPtr)]
1201  internal _CreateDashboardOverlay CreateDashboardOverlay;
1202 
1203  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1204  internal delegate bool _IsDashboardVisible();
1205  [MarshalAs(UnmanagedType.FunctionPtr)]
1206  internal _IsDashboardVisible IsDashboardVisible;
1207 
1208  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1209  internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle);
1210  [MarshalAs(UnmanagedType.FunctionPtr)]
1211  internal _IsActiveDashboardOverlay IsActiveDashboardOverlay;
1212 
1213  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1214  internal delegate EVROverlayError _SetDashboardOverlaySceneProcess(ulong ulOverlayHandle, uint unProcessId);
1215  [MarshalAs(UnmanagedType.FunctionPtr)]
1216  internal _SetDashboardOverlaySceneProcess SetDashboardOverlaySceneProcess;
1217 
1218  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1219  internal delegate EVROverlayError _GetDashboardOverlaySceneProcess(ulong ulOverlayHandle, ref uint punProcessId);
1220  [MarshalAs(UnmanagedType.FunctionPtr)]
1221  internal _GetDashboardOverlaySceneProcess GetDashboardOverlaySceneProcess;
1222 
1223  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1224  internal delegate void _ShowDashboard(string pchOverlayToShow);
1225  [MarshalAs(UnmanagedType.FunctionPtr)]
1226  internal _ShowDashboard ShowDashboard;
1227 
1228  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1229  internal delegate uint _GetPrimaryDashboardDevice();
1230  [MarshalAs(UnmanagedType.FunctionPtr)]
1231  internal _GetPrimaryDashboardDevice GetPrimaryDashboardDevice;
1232 
1233  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1234  internal delegate EVROverlayError _ShowKeyboard(int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
1235  [MarshalAs(UnmanagedType.FunctionPtr)]
1236  internal _ShowKeyboard ShowKeyboard;
1237 
1238  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1239  internal delegate EVROverlayError _ShowKeyboardForOverlay(ulong ulOverlayHandle, int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
1240  [MarshalAs(UnmanagedType.FunctionPtr)]
1241  internal _ShowKeyboardForOverlay ShowKeyboardForOverlay;
1242 
1243  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1244  internal delegate uint _GetKeyboardText(System.Text.StringBuilder pchText, uint cchText);
1245  [MarshalAs(UnmanagedType.FunctionPtr)]
1246  internal _GetKeyboardText GetKeyboardText;
1247 
1248  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1249  internal delegate void _HideKeyboard();
1250  [MarshalAs(UnmanagedType.FunctionPtr)]
1251  internal _HideKeyboard HideKeyboard;
1252 
1253  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1254  internal delegate void _SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);
1255  [MarshalAs(UnmanagedType.FunctionPtr)]
1256  internal _SetKeyboardTransformAbsolute SetKeyboardTransformAbsolute;
1257 
1258  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1259  internal delegate void _SetKeyboardPositionForOverlay(ulong ulOverlayHandle, HmdRect2_t avoidRect);
1260  [MarshalAs(UnmanagedType.FunctionPtr)]
1261  internal _SetKeyboardPositionForOverlay SetKeyboardPositionForOverlay;
1262 
1263  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1264  internal delegate EVROverlayError _SetOverlayIntersectionMask(ulong ulOverlayHandle, ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, uint unNumMaskPrimitives, uint unPrimitiveSize);
1265  [MarshalAs(UnmanagedType.FunctionPtr)]
1266  internal _SetOverlayIntersectionMask SetOverlayIntersectionMask;
1267 
1268  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1269  internal delegate EVROverlayError _GetOverlayFlags(ulong ulOverlayHandle, ref uint pFlags);
1270  [MarshalAs(UnmanagedType.FunctionPtr)]
1271  internal _GetOverlayFlags GetOverlayFlags;
1272 
1273  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1274  internal delegate VRMessageOverlayResponse _ShowMessageOverlay(string pchText, string pchCaption, string pchButton0Text, string pchButton1Text, string pchButton2Text, string pchButton3Text);
1275  [MarshalAs(UnmanagedType.FunctionPtr)]
1276  internal _ShowMessageOverlay ShowMessageOverlay;
1277 
1278  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1279  internal delegate void _CloseMessageOverlay();
1280  [MarshalAs(UnmanagedType.FunctionPtr)]
1281  internal _CloseMessageOverlay CloseMessageOverlay;
1282 
1283 }
1284 
1285 [StructLayout(LayoutKind.Sequential)]
1286 public struct IVRRenderModels
1287 {
1288  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1289  internal delegate EVRRenderModelError _LoadRenderModel_Async(string pchRenderModelName, ref IntPtr ppRenderModel);
1290  [MarshalAs(UnmanagedType.FunctionPtr)]
1291  internal _LoadRenderModel_Async LoadRenderModel_Async;
1292 
1293  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1294  internal delegate void _FreeRenderModel(IntPtr pRenderModel);
1295  [MarshalAs(UnmanagedType.FunctionPtr)]
1296  internal _FreeRenderModel FreeRenderModel;
1297 
1298  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1299  internal delegate EVRRenderModelError _LoadTexture_Async(int textureId, ref IntPtr ppTexture);
1300  [MarshalAs(UnmanagedType.FunctionPtr)]
1301  internal _LoadTexture_Async LoadTexture_Async;
1302 
1303  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1304  internal delegate void _FreeTexture(IntPtr pTexture);
1305  [MarshalAs(UnmanagedType.FunctionPtr)]
1306  internal _FreeTexture FreeTexture;
1307 
1308  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1309  internal delegate EVRRenderModelError _LoadTextureD3D11_Async(int textureId, IntPtr pD3D11Device, ref IntPtr ppD3D11Texture2D);
1310  [MarshalAs(UnmanagedType.FunctionPtr)]
1311  internal _LoadTextureD3D11_Async LoadTextureD3D11_Async;
1312 
1313  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1314  internal delegate EVRRenderModelError _LoadIntoTextureD3D11_Async(int textureId, IntPtr pDstTexture);
1315  [MarshalAs(UnmanagedType.FunctionPtr)]
1316  internal _LoadIntoTextureD3D11_Async LoadIntoTextureD3D11_Async;
1317 
1318  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1319  internal delegate void _FreeTextureD3D11(IntPtr pD3D11Texture2D);
1320  [MarshalAs(UnmanagedType.FunctionPtr)]
1321  internal _FreeTextureD3D11 FreeTextureD3D11;
1322 
1323  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1324  internal delegate uint _GetRenderModelName(uint unRenderModelIndex, System.Text.StringBuilder pchRenderModelName, uint unRenderModelNameLen);
1325  [MarshalAs(UnmanagedType.FunctionPtr)]
1326  internal _GetRenderModelName GetRenderModelName;
1327 
1328  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1329  internal delegate uint _GetRenderModelCount();
1330  [MarshalAs(UnmanagedType.FunctionPtr)]
1331  internal _GetRenderModelCount GetRenderModelCount;
1332 
1333  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1334  internal delegate uint _GetComponentCount(string pchRenderModelName);
1335  [MarshalAs(UnmanagedType.FunctionPtr)]
1336  internal _GetComponentCount GetComponentCount;
1337 
1338  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1339  internal delegate uint _GetComponentName(string pchRenderModelName, uint unComponentIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameLen);
1340  [MarshalAs(UnmanagedType.FunctionPtr)]
1341  internal _GetComponentName GetComponentName;
1342 
1343  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1344  internal delegate ulong _GetComponentButtonMask(string pchRenderModelName, string pchComponentName);
1345  [MarshalAs(UnmanagedType.FunctionPtr)]
1346  internal _GetComponentButtonMask GetComponentButtonMask;
1347 
1348  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1349  internal delegate uint _GetComponentRenderModelName(string pchRenderModelName, string pchComponentName, System.Text.StringBuilder pchComponentRenderModelName, uint unComponentRenderModelNameLen);
1350  [MarshalAs(UnmanagedType.FunctionPtr)]
1351  internal _GetComponentRenderModelName GetComponentRenderModelName;
1352 
1353  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1354  internal delegate bool _GetComponentState(string pchRenderModelName, string pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
1355  [MarshalAs(UnmanagedType.FunctionPtr)]
1356  internal _GetComponentState GetComponentState;
1357 
1358  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1359  internal delegate bool _RenderModelHasComponent(string pchRenderModelName, string pchComponentName);
1360  [MarshalAs(UnmanagedType.FunctionPtr)]
1361  internal _RenderModelHasComponent RenderModelHasComponent;
1362 
1363  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1364  internal delegate uint _GetRenderModelThumbnailURL(string pchRenderModelName, System.Text.StringBuilder pchThumbnailURL, uint unThumbnailURLLen, ref EVRRenderModelError peError);
1365  [MarshalAs(UnmanagedType.FunctionPtr)]
1366  internal _GetRenderModelThumbnailURL GetRenderModelThumbnailURL;
1367 
1368  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1369  internal delegate uint _GetRenderModelOriginalPath(string pchRenderModelName, System.Text.StringBuilder pchOriginalPath, uint unOriginalPathLen, ref EVRRenderModelError peError);
1370  [MarshalAs(UnmanagedType.FunctionPtr)]
1371  internal _GetRenderModelOriginalPath GetRenderModelOriginalPath;
1372 
1373  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1374  internal delegate IntPtr _GetRenderModelErrorNameFromEnum(EVRRenderModelError error);
1375  [MarshalAs(UnmanagedType.FunctionPtr)]
1376  internal _GetRenderModelErrorNameFromEnum GetRenderModelErrorNameFromEnum;
1377 
1378 }
1379 
1380 [StructLayout(LayoutKind.Sequential)]
1381 public struct IVRNotifications
1382 {
1383  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1384  internal delegate EVRNotificationError _CreateNotification(ulong ulOverlayHandle, ulong ulUserValue, EVRNotificationType type, string pchText, EVRNotificationStyle style, ref NotificationBitmap_t pImage, ref uint pNotificationId);
1385  [MarshalAs(UnmanagedType.FunctionPtr)]
1386  internal _CreateNotification CreateNotification;
1387 
1388  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1389  internal delegate EVRNotificationError _RemoveNotification(uint notificationId);
1390  [MarshalAs(UnmanagedType.FunctionPtr)]
1391  internal _RemoveNotification RemoveNotification;
1392 
1393 }
1394 
1395 [StructLayout(LayoutKind.Sequential)]
1396 public struct IVRSettings
1397 {
1398  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1399  internal delegate IntPtr _GetSettingsErrorNameFromEnum(EVRSettingsError eError);
1400  [MarshalAs(UnmanagedType.FunctionPtr)]
1401  internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum;
1402 
1403  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1404  internal delegate bool _Sync(bool bForce, ref EVRSettingsError peError);
1405  [MarshalAs(UnmanagedType.FunctionPtr)]
1406  internal _Sync Sync;
1407 
1408  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1409  internal delegate void _SetBool(string pchSection, string pchSettingsKey, bool bValue, ref EVRSettingsError peError);
1410  [MarshalAs(UnmanagedType.FunctionPtr)]
1411  internal _SetBool SetBool;
1412 
1413  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1414  internal delegate void _SetInt32(string pchSection, string pchSettingsKey, int nValue, ref EVRSettingsError peError);
1415  [MarshalAs(UnmanagedType.FunctionPtr)]
1416  internal _SetInt32 SetInt32;
1417 
1418  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1419  internal delegate void _SetFloat(string pchSection, string pchSettingsKey, float flValue, ref EVRSettingsError peError);
1420  [MarshalAs(UnmanagedType.FunctionPtr)]
1421  internal _SetFloat SetFloat;
1422 
1423  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1424  internal delegate void _SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError);
1425  [MarshalAs(UnmanagedType.FunctionPtr)]
1426  internal _SetString SetString;
1427 
1428  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1429  internal delegate bool _GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1430  [MarshalAs(UnmanagedType.FunctionPtr)]
1431  internal _GetBool GetBool;
1432 
1433  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1434  internal delegate int _GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1435  [MarshalAs(UnmanagedType.FunctionPtr)]
1436  internal _GetInt32 GetInt32;
1437 
1438  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1439  internal delegate float _GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1440  [MarshalAs(UnmanagedType.FunctionPtr)]
1441  internal _GetFloat GetFloat;
1442 
1443  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1444  internal delegate void _GetString(string pchSection, string pchSettingsKey, System.Text.StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError);
1445  [MarshalAs(UnmanagedType.FunctionPtr)]
1446  internal _GetString GetString;
1447 
1448  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1449  internal delegate void _RemoveSection(string pchSection, ref EVRSettingsError peError);
1450  [MarshalAs(UnmanagedType.FunctionPtr)]
1451  internal _RemoveSection RemoveSection;
1452 
1453  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1454  internal delegate void _RemoveKeyInSection(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1455  [MarshalAs(UnmanagedType.FunctionPtr)]
1456  internal _RemoveKeyInSection RemoveKeyInSection;
1457 
1458 }
1459 
1460 [StructLayout(LayoutKind.Sequential)]
1461 public struct IVRScreenshots
1462 {
1463  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1464  internal delegate EVRScreenshotError _RequestScreenshot(ref uint pOutScreenshotHandle, EVRScreenshotType type, string pchPreviewFilename, string pchVRFilename);
1465  [MarshalAs(UnmanagedType.FunctionPtr)]
1466  internal _RequestScreenshot RequestScreenshot;
1467 
1468  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1469  internal delegate EVRScreenshotError _HookScreenshot([In, Out] EVRScreenshotType[] pSupportedTypes, int numTypes);
1470  [MarshalAs(UnmanagedType.FunctionPtr)]
1471  internal _HookScreenshot HookScreenshot;
1472 
1473  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1474  internal delegate EVRScreenshotType _GetScreenshotPropertyType(uint screenshotHandle, ref EVRScreenshotError pError);
1475  [MarshalAs(UnmanagedType.FunctionPtr)]
1476  internal _GetScreenshotPropertyType GetScreenshotPropertyType;
1477 
1478  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1479  internal delegate uint _GetScreenshotPropertyFilename(uint screenshotHandle, EVRScreenshotPropertyFilenames filenameType, System.Text.StringBuilder pchFilename, uint cchFilename, ref EVRScreenshotError pError);
1480  [MarshalAs(UnmanagedType.FunctionPtr)]
1481  internal _GetScreenshotPropertyFilename GetScreenshotPropertyFilename;
1482 
1483  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1484  internal delegate EVRScreenshotError _UpdateScreenshotProgress(uint screenshotHandle, float flProgress);
1485  [MarshalAs(UnmanagedType.FunctionPtr)]
1486  internal _UpdateScreenshotProgress UpdateScreenshotProgress;
1487 
1488  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1489  internal delegate EVRScreenshotError _TakeStereoScreenshot(ref uint pOutScreenshotHandle, string pchPreviewFilename, string pchVRFilename);
1490  [MarshalAs(UnmanagedType.FunctionPtr)]
1491  internal _TakeStereoScreenshot TakeStereoScreenshot;
1492 
1493  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1494  internal delegate EVRScreenshotError _SubmitScreenshot(uint screenshotHandle, EVRScreenshotType type, string pchSourcePreviewFilename, string pchSourceVRFilename);
1495  [MarshalAs(UnmanagedType.FunctionPtr)]
1496  internal _SubmitScreenshot SubmitScreenshot;
1497 
1498 }
1499 
1500 [StructLayout(LayoutKind.Sequential)]
1501 public struct IVRResources
1502 {
1503  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1504  internal delegate uint _LoadSharedResource(string pchResourceName, string pchBuffer, uint unBufferLen);
1505  [MarshalAs(UnmanagedType.FunctionPtr)]
1506  internal _LoadSharedResource LoadSharedResource;
1507 
1508  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1509  internal delegate uint _GetResourceFullPath(string pchResourceName, string pchResourceTypeDirectory, System.Text.StringBuilder pchPathBuffer, uint unBufferLen);
1510  [MarshalAs(UnmanagedType.FunctionPtr)]
1511  internal _GetResourceFullPath GetResourceFullPath;
1512 
1513 }
1514 
1515 [StructLayout(LayoutKind.Sequential)]
1516 public struct IVRDriverManager
1517 {
1518  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1519  internal delegate uint _GetDriverCount();
1520  [MarshalAs(UnmanagedType.FunctionPtr)]
1521  internal _GetDriverCount GetDriverCount;
1522 
1523  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1524  internal delegate uint _GetDriverName(uint nDriver, System.Text.StringBuilder pchValue, uint unBufferSize);
1525  [MarshalAs(UnmanagedType.FunctionPtr)]
1526  internal _GetDriverName GetDriverName;
1527 
1528 }
1529 
1530 
1531 public class CVRSystem
1532 {
1533  IVRSystem FnTable;
1534  internal CVRSystem(IntPtr pInterface)
1535  {
1536  FnTable = (IVRSystem)Marshal.PtrToStructure(pInterface, typeof(IVRSystem));
1537  }
1538  public void GetRecommendedRenderTargetSize(ref uint pnWidth,ref uint pnHeight)
1539  {
1540  pnWidth = 0;
1541  pnHeight = 0;
1542  FnTable.GetRecommendedRenderTargetSize(ref pnWidth,ref pnHeight);
1543  }
1544  public HmdMatrix44_t GetProjectionMatrix(EVREye eEye,float fNearZ,float fFarZ)
1545  {
1546  HmdMatrix44_t result = FnTable.GetProjectionMatrix(eEye,fNearZ,fFarZ);
1547  return result;
1548  }
1549  public void GetProjectionRaw(EVREye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom)
1550  {
1551  pfLeft = 0;
1552  pfRight = 0;
1553  pfTop = 0;
1554  pfBottom = 0;
1555  FnTable.GetProjectionRaw(eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom);
1556  }
1557  public bool ComputeDistortion(EVREye eEye,float fU,float fV,ref DistortionCoordinates_t pDistortionCoordinates)
1558  {
1559  bool result = FnTable.ComputeDistortion(eEye,fU,fV,ref pDistortionCoordinates);
1560  return result;
1561  }
1562  public HmdMatrix34_t GetEyeToHeadTransform(EVREye eEye)
1563  {
1564  HmdMatrix34_t result = FnTable.GetEyeToHeadTransform(eEye);
1565  return result;
1566  }
1567  public bool GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync,ref ulong pulFrameCounter)
1568  {
1569  pfSecondsSinceLastVsync = 0;
1570  pulFrameCounter = 0;
1571  bool result = FnTable.GetTimeSinceLastVsync(ref pfSecondsSinceLastVsync,ref pulFrameCounter);
1572  return result;
1573  }
1574  public int GetD3D9AdapterIndex()
1575  {
1576  int result = FnTable.GetD3D9AdapterIndex();
1577  return result;
1578  }
1579  public void GetDXGIOutputInfo(ref int pnAdapterIndex)
1580  {
1581  pnAdapterIndex = 0;
1582  FnTable.GetDXGIOutputInfo(ref pnAdapterIndex);
1583  }
1584  public void GetOutputDevice(ref ulong pnDevice,ETextureType textureType,IntPtr pInstance)
1585  {
1586  pnDevice = 0;
1587  FnTable.GetOutputDevice(ref pnDevice,textureType,pInstance);
1588  }
1589  public bool IsDisplayOnDesktop()
1590  {
1591  bool result = FnTable.IsDisplayOnDesktop();
1592  return result;
1593  }
1594  public bool SetDisplayVisibility(bool bIsVisibleOnDesktop)
1595  {
1596  bool result = FnTable.SetDisplayVisibility(bIsVisibleOnDesktop);
1597  return result;
1598  }
1599  public void GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,float fPredictedSecondsToPhotonsFromNow,TrackedDevicePose_t [] pTrackedDevicePoseArray)
1600  {
1601  FnTable.GetDeviceToAbsoluteTrackingPose(eOrigin,fPredictedSecondsToPhotonsFromNow,pTrackedDevicePoseArray,(uint) pTrackedDevicePoseArray.Length);
1602  }
1603  public void ResetSeatedZeroPose()
1604  {
1605  FnTable.ResetSeatedZeroPose();
1606  }
1607  public HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose()
1608  {
1609  HmdMatrix34_t result = FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
1610  return result;
1611  }
1612  public HmdMatrix34_t GetRawZeroPoseToStandingAbsoluteTrackingPose()
1613  {
1614  HmdMatrix34_t result = FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose();
1615  return result;
1616  }
1617  public uint GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass,uint [] punTrackedDeviceIndexArray,uint unRelativeToTrackedDeviceIndex)
1618  {
1619  uint result = FnTable.GetSortedTrackedDeviceIndicesOfClass(eTrackedDeviceClass,punTrackedDeviceIndexArray,(uint) punTrackedDeviceIndexArray.Length,unRelativeToTrackedDeviceIndex);
1620  return result;
1621  }
1622  public EDeviceActivityLevel GetTrackedDeviceActivityLevel(uint unDeviceId)
1623  {
1624  EDeviceActivityLevel result = FnTable.GetTrackedDeviceActivityLevel(unDeviceId);
1625  return result;
1626  }
1627  public void ApplyTransform(ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pTrackedDevicePose,ref HmdMatrix34_t pTransform)
1628  {
1629  FnTable.ApplyTransform(ref pOutputPose,ref pTrackedDevicePose,ref pTransform);
1630  }
1631  public uint GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType)
1632  {
1633  uint result = FnTable.GetTrackedDeviceIndexForControllerRole(unDeviceType);
1634  return result;
1635  }
1636  public ETrackedControllerRole GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex)
1637  {
1638  ETrackedControllerRole result = FnTable.GetControllerRoleForTrackedDeviceIndex(unDeviceIndex);
1639  return result;
1640  }
1641  public ETrackedDeviceClass GetTrackedDeviceClass(uint unDeviceIndex)
1642  {
1643  ETrackedDeviceClass result = FnTable.GetTrackedDeviceClass(unDeviceIndex);
1644  return result;
1645  }
1646  public bool IsTrackedDeviceConnected(uint unDeviceIndex)
1647  {
1648  bool result = FnTable.IsTrackedDeviceConnected(unDeviceIndex);
1649  return result;
1650  }
1651  public bool GetBoolTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1652  {
1653  bool result = FnTable.GetBoolTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1654  return result;
1655  }
1656  public float GetFloatTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1657  {
1658  float result = FnTable.GetFloatTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1659  return result;
1660  }
1661  public int GetInt32TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1662  {
1663  int result = FnTable.GetInt32TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1664  return result;
1665  }
1666  public ulong GetUint64TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1667  {
1668  ulong result = FnTable.GetUint64TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1669  return result;
1670  }
1671  public HmdMatrix34_t GetMatrix34TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1672  {
1673  HmdMatrix34_t result = FnTable.GetMatrix34TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1674  return result;
1675  }
1676  public uint GetArrayTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,uint propType,IntPtr pBuffer,uint unBufferSize,ref ETrackedPropertyError pError)
1677  {
1678  uint result = FnTable.GetArrayTrackedDeviceProperty(unDeviceIndex,prop,propType,pBuffer,unBufferSize,ref pError);
1679  return result;
1680  }
1681  public uint GetStringTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,System.Text.StringBuilder pchValue,uint unBufferSize,ref ETrackedPropertyError pError)
1682  {
1683  uint result = FnTable.GetStringTrackedDeviceProperty(unDeviceIndex,prop,pchValue,unBufferSize,ref pError);
1684  return result;
1685  }
1686  public string GetPropErrorNameFromEnum(ETrackedPropertyError error)
1687  {
1688  IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
1689  return Marshal.PtrToStringAnsi(result);
1690  }
1691 // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
1692 // originally mis-compiled with the wrong packing for Linux and OSX.
1693  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1694  internal delegate bool _PollNextEventPacked(ref VREvent_t_Packed pEvent,uint uncbVREvent);
1695  [StructLayout(LayoutKind.Explicit)]
1696  struct PollNextEventUnion
1697  {
1698  [FieldOffset(0)]
1699  public IVRSystem._PollNextEvent pPollNextEvent;
1700  [FieldOffset(0)]
1701  public _PollNextEventPacked pPollNextEventPacked;
1702  }
1703  public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
1704  {
1705 #if !UNITY_METRO
1706  if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
1707  (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
1708  {
1709  PollNextEventUnion u;
1710  VREvent_t_Packed event_packed = new VREvent_t_Packed();
1711  u.pPollNextEventPacked = null;
1712  u.pPollNextEvent = FnTable.PollNextEvent;
1713  bool packed_result = u.pPollNextEventPacked(ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
1714 
1715  event_packed.Unpack(ref pEvent);
1716  return packed_result;
1717  }
1718 #endif
1719  bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
1720  return result;
1721  }
1722  public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
1723  {
1724  bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
1725  return result;
1726  }
1727  public string GetEventTypeNameFromEnum(EVREventType eType)
1728  {
1729  IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
1730  return Marshal.PtrToStringAnsi(result);
1731  }
1732  public HiddenAreaMesh_t GetHiddenAreaMesh(EVREye eEye,EHiddenAreaMeshType type)
1733  {
1734  HiddenAreaMesh_t result = FnTable.GetHiddenAreaMesh(eEye,type);
1735  return result;
1736  }
1737 // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
1738 // originally mis-compiled with the wrong packing for Linux and OSX.
1739  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1740  internal delegate bool _GetControllerStatePacked(uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize);
1741  [StructLayout(LayoutKind.Explicit)]
1742  struct GetControllerStateUnion
1743  {
1744  [FieldOffset(0)]
1745  public IVRSystem._GetControllerState pGetControllerState;
1746  [FieldOffset(0)]
1747  public _GetControllerStatePacked pGetControllerStatePacked;
1748  }
1749  public bool GetControllerState(uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize)
1750  {
1751 #if !UNITY_METRO
1752  if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
1753  (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
1754  {
1755  GetControllerStateUnion u;
1756  VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
1757  u.pGetControllerStatePacked = null;
1758  u.pGetControllerState = FnTable.GetControllerState;
1759  bool packed_result = u.pGetControllerStatePacked(unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)));
1760 
1761  state_packed.Unpack(ref pControllerState);
1762  return packed_result;
1763  }
1764 #endif
1765  bool result = FnTable.GetControllerState(unControllerDeviceIndex,ref pControllerState,unControllerStateSize);
1766  return result;
1767  }
1768 // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
1769 // originally mis-compiled with the wrong packing for Linux and OSX.
1770  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1771  internal delegate bool _GetControllerStateWithPosePacked(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose);
1772  [StructLayout(LayoutKind.Explicit)]
1773  struct GetControllerStateWithPoseUnion
1774  {
1775  [FieldOffset(0)]
1776  public IVRSystem._GetControllerStateWithPose pGetControllerStateWithPose;
1777  [FieldOffset(0)]
1778  public _GetControllerStateWithPosePacked pGetControllerStateWithPosePacked;
1779  }
1780  public bool GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose)
1781  {
1782 #if !UNITY_METRO
1783  if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
1784  (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
1785  {
1786  GetControllerStateWithPoseUnion u;
1787  VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
1788  u.pGetControllerStateWithPosePacked = null;
1789  u.pGetControllerStateWithPose = FnTable.GetControllerStateWithPose;
1790  bool packed_result = u.pGetControllerStateWithPosePacked(eOrigin,unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)),ref pTrackedDevicePose);
1791 
1792  state_packed.Unpack(ref pControllerState);
1793  return packed_result;
1794  }
1795 #endif
1796  bool result = FnTable.GetControllerStateWithPose(eOrigin,unControllerDeviceIndex,ref pControllerState,unControllerStateSize,ref pTrackedDevicePose);
1797  return result;
1798  }
1799  public void TriggerHapticPulse(uint unControllerDeviceIndex,uint unAxisId,char usDurationMicroSec)
1800  {
1801  FnTable.TriggerHapticPulse(unControllerDeviceIndex,unAxisId,usDurationMicroSec);
1802  }
1803  public string GetButtonIdNameFromEnum(EVRButtonId eButtonId)
1804  {
1805  IntPtr result = FnTable.GetButtonIdNameFromEnum(eButtonId);
1806  return Marshal.PtrToStringAnsi(result);
1807  }
1808  public string GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType)
1809  {
1810  IntPtr result = FnTable.GetControllerAxisTypeNameFromEnum(eAxisType);
1811  return Marshal.PtrToStringAnsi(result);
1812  }
1813  public bool IsInputAvailable()
1814  {
1815  bool result = FnTable.IsInputAvailable();
1816  return result;
1817  }
1818  public bool IsSteamVRDrawingControllers()
1819  {
1820  bool result = FnTable.IsSteamVRDrawingControllers();
1821  return result;
1822  }
1823  public bool ShouldApplicationPause()
1824  {
1825  bool result = FnTable.ShouldApplicationPause();
1826  return result;
1827  }
1828  public bool ShouldApplicationReduceRenderingWork()
1829  {
1830  bool result = FnTable.ShouldApplicationReduceRenderingWork();
1831  return result;
1832  }
1833  public uint DriverDebugRequest(uint unDeviceIndex,string pchRequest,System.Text.StringBuilder pchResponseBuffer,uint unResponseBufferSize)
1834  {
1835  uint result = FnTable.DriverDebugRequest(unDeviceIndex,pchRequest,pchResponseBuffer,unResponseBufferSize);
1836  return result;
1837  }
1838  public EVRFirmwareError PerformFirmwareUpdate(uint unDeviceIndex)
1839  {
1840  EVRFirmwareError result = FnTable.PerformFirmwareUpdate(unDeviceIndex);
1841  return result;
1842  }
1843  public void AcknowledgeQuit_Exiting()
1844  {
1845  FnTable.AcknowledgeQuit_Exiting();
1846  }
1847  public void AcknowledgeQuit_UserPrompt()
1848  {
1849  FnTable.AcknowledgeQuit_UserPrompt();
1850  }
1851 }
1852 
1853 
1855 {
1856  IVRExtendedDisplay FnTable;
1857  internal CVRExtendedDisplay(IntPtr pInterface)
1858  {
1859  FnTable = (IVRExtendedDisplay)Marshal.PtrToStructure(pInterface, typeof(IVRExtendedDisplay));
1860  }
1861  public void GetWindowBounds(ref int pnX,ref int pnY,ref uint pnWidth,ref uint pnHeight)
1862  {
1863  pnX = 0;
1864  pnY = 0;
1865  pnWidth = 0;
1866  pnHeight = 0;
1867  FnTable.GetWindowBounds(ref pnX,ref pnY,ref pnWidth,ref pnHeight);
1868  }
1869  public void GetEyeOutputViewport(EVREye eEye,ref uint pnX,ref uint pnY,ref uint pnWidth,ref uint pnHeight)
1870  {
1871  pnX = 0;
1872  pnY = 0;
1873  pnWidth = 0;
1874  pnHeight = 0;
1875  FnTable.GetEyeOutputViewport(eEye,ref pnX,ref pnY,ref pnWidth,ref pnHeight);
1876  }
1877  public void GetDXGIOutputInfo(ref int pnAdapterIndex,ref int pnAdapterOutputIndex)
1878  {
1879  pnAdapterIndex = 0;
1880  pnAdapterOutputIndex = 0;
1881  FnTable.GetDXGIOutputInfo(ref pnAdapterIndex,ref pnAdapterOutputIndex);
1882  }
1883 }
1884 
1885 
1886 public class CVRTrackedCamera
1887 {
1888  IVRTrackedCamera FnTable;
1889  internal CVRTrackedCamera(IntPtr pInterface)
1890  {
1891  FnTable = (IVRTrackedCamera)Marshal.PtrToStructure(pInterface, typeof(IVRTrackedCamera));
1892  }
1893  public string GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError)
1894  {
1895  IntPtr result = FnTable.GetCameraErrorNameFromEnum(eCameraError);
1896  return Marshal.PtrToStringAnsi(result);
1897  }
1898  public EVRTrackedCameraError HasCamera(uint nDeviceIndex,ref bool pHasCamera)
1899  {
1900  pHasCamera = false;
1901  EVRTrackedCameraError result = FnTable.HasCamera(nDeviceIndex,ref pHasCamera);
1902  return result;
1903  }
1904  public EVRTrackedCameraError GetCameraFrameSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref uint pnWidth,ref uint pnHeight,ref uint pnFrameBufferSize)
1905  {
1906  pnWidth = 0;
1907  pnHeight = 0;
1908  pnFrameBufferSize = 0;
1909  EVRTrackedCameraError result = FnTable.GetCameraFrameSize(nDeviceIndex,eFrameType,ref pnWidth,ref pnHeight,ref pnFrameBufferSize);
1910  return result;
1911  }
1912  public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref HmdVector2_t pFocalLength,ref HmdVector2_t pCenter)
1913  {
1914  EVRTrackedCameraError result = FnTable.GetCameraIntrinsics(nDeviceIndex,eFrameType,ref pFocalLength,ref pCenter);
1915  return result;
1916  }
1917  public EVRTrackedCameraError GetCameraProjection(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,float flZNear,float flZFar,ref HmdMatrix44_t pProjection)
1918  {
1919  EVRTrackedCameraError result = FnTable.GetCameraProjection(nDeviceIndex,eFrameType,flZNear,flZFar,ref pProjection);
1920  return result;
1921  }
1922  public EVRTrackedCameraError AcquireVideoStreamingService(uint nDeviceIndex,ref ulong pHandle)
1923  {
1924  pHandle = 0;
1925  EVRTrackedCameraError result = FnTable.AcquireVideoStreamingService(nDeviceIndex,ref pHandle);
1926  return result;
1927  }
1928  public EVRTrackedCameraError ReleaseVideoStreamingService(ulong hTrackedCamera)
1929  {
1930  EVRTrackedCameraError result = FnTable.ReleaseVideoStreamingService(hTrackedCamera);
1931  return result;
1932  }
1933  public EVRTrackedCameraError GetVideoStreamFrameBuffer(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pFrameBuffer,uint nFrameBufferSize,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1934  {
1935  EVRTrackedCameraError result = FnTable.GetVideoStreamFrameBuffer(hTrackedCamera,eFrameType,pFrameBuffer,nFrameBufferSize,ref pFrameHeader,nFrameHeaderSize);
1936  return result;
1937  }
1938  public EVRTrackedCameraError GetVideoStreamTextureSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref VRTextureBounds_t pTextureBounds,ref uint pnWidth,ref uint pnHeight)
1939  {
1940  pnWidth = 0;
1941  pnHeight = 0;
1942  EVRTrackedCameraError result = FnTable.GetVideoStreamTextureSize(nDeviceIndex,eFrameType,ref pTextureBounds,ref pnWidth,ref pnHeight);
1943  return result;
1944  }
1945  public EVRTrackedCameraError GetVideoStreamTextureD3D11(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1946  {
1947  EVRTrackedCameraError result = FnTable.GetVideoStreamTextureD3D11(hTrackedCamera,eFrameType,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView,ref pFrameHeader,nFrameHeaderSize);
1948  return result;
1949  }
1950  public EVRTrackedCameraError GetVideoStreamTextureGL(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,ref uint pglTextureId,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1951  {
1952  pglTextureId = 0;
1953  EVRTrackedCameraError result = FnTable.GetVideoStreamTextureGL(hTrackedCamera,eFrameType,ref pglTextureId,ref pFrameHeader,nFrameHeaderSize);
1954  return result;
1955  }
1956  public EVRTrackedCameraError ReleaseVideoStreamTextureGL(ulong hTrackedCamera,uint glTextureId)
1957  {
1958  EVRTrackedCameraError result = FnTable.ReleaseVideoStreamTextureGL(hTrackedCamera,glTextureId);
1959  return result;
1960  }
1961 }
1962 
1963 
1964 public class CVRApplications
1965 {
1966  IVRApplications FnTable;
1967  internal CVRApplications(IntPtr pInterface)
1968  {
1969  FnTable = (IVRApplications)Marshal.PtrToStructure(pInterface, typeof(IVRApplications));
1970  }
1971  public EVRApplicationError AddApplicationManifest(string pchApplicationManifestFullPath,bool bTemporary)
1972  {
1973  EVRApplicationError result = FnTable.AddApplicationManifest(pchApplicationManifestFullPath,bTemporary);
1974  return result;
1975  }
1976  public EVRApplicationError RemoveApplicationManifest(string pchApplicationManifestFullPath)
1977  {
1978  EVRApplicationError result = FnTable.RemoveApplicationManifest(pchApplicationManifestFullPath);
1979  return result;
1980  }
1981  public bool IsApplicationInstalled(string pchAppKey)
1982  {
1983  bool result = FnTable.IsApplicationInstalled(pchAppKey);
1984  return result;
1985  }
1986  public uint GetApplicationCount()
1987  {
1988  uint result = FnTable.GetApplicationCount();
1989  return result;
1990  }
1991  public EVRApplicationError GetApplicationKeyByIndex(uint unApplicationIndex,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
1992  {
1993  EVRApplicationError result = FnTable.GetApplicationKeyByIndex(unApplicationIndex,pchAppKeyBuffer,unAppKeyBufferLen);
1994  return result;
1995  }
1996  public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
1997  {
1998  EVRApplicationError result = FnTable.GetApplicationKeyByProcessId(unProcessId,pchAppKeyBuffer,unAppKeyBufferLen);
1999  return result;
2000  }
2001  public EVRApplicationError LaunchApplication(string pchAppKey)
2002  {
2003  EVRApplicationError result = FnTable.LaunchApplication(pchAppKey);
2004  return result;
2005  }
2006  public EVRApplicationError LaunchTemplateApplication(string pchTemplateAppKey,string pchNewAppKey,AppOverrideKeys_t [] pKeys)
2007  {
2008  EVRApplicationError result = FnTable.LaunchTemplateApplication(pchTemplateAppKey,pchNewAppKey,pKeys,(uint) pKeys.Length);
2009  return result;
2010  }
2011  public EVRApplicationError LaunchApplicationFromMimeType(string pchMimeType,string pchArgs)
2012  {
2013  EVRApplicationError result = FnTable.LaunchApplicationFromMimeType(pchMimeType,pchArgs);
2014  return result;
2015  }
2016  public EVRApplicationError LaunchDashboardOverlay(string pchAppKey)
2017  {
2018  EVRApplicationError result = FnTable.LaunchDashboardOverlay(pchAppKey);
2019  return result;
2020  }
2021  public bool CancelApplicationLaunch(string pchAppKey)
2022  {
2023  bool result = FnTable.CancelApplicationLaunch(pchAppKey);
2024  return result;
2025  }
2026  public EVRApplicationError IdentifyApplication(uint unProcessId,string pchAppKey)
2027  {
2028  EVRApplicationError result = FnTable.IdentifyApplication(unProcessId,pchAppKey);
2029  return result;
2030  }
2031  public uint GetApplicationProcessId(string pchAppKey)
2032  {
2033  uint result = FnTable.GetApplicationProcessId(pchAppKey);
2034  return result;
2035  }
2036  public string GetApplicationsErrorNameFromEnum(EVRApplicationError error)
2037  {
2038  IntPtr result = FnTable.GetApplicationsErrorNameFromEnum(error);
2039  return Marshal.PtrToStringAnsi(result);
2040  }
2041  public uint GetApplicationPropertyString(string pchAppKey,EVRApplicationProperty eProperty,System.Text.StringBuilder pchPropertyValueBuffer,uint unPropertyValueBufferLen,ref EVRApplicationError peError)
2042  {
2043  uint result = FnTable.GetApplicationPropertyString(pchAppKey,eProperty,pchPropertyValueBuffer,unPropertyValueBufferLen,ref peError);
2044  return result;
2045  }
2046  public bool GetApplicationPropertyBool(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
2047  {
2048  bool result = FnTable.GetApplicationPropertyBool(pchAppKey,eProperty,ref peError);
2049  return result;
2050  }
2051  public ulong GetApplicationPropertyUint64(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
2052  {
2053  ulong result = FnTable.GetApplicationPropertyUint64(pchAppKey,eProperty,ref peError);
2054  return result;
2055  }
2056  public EVRApplicationError SetApplicationAutoLaunch(string pchAppKey,bool bAutoLaunch)
2057  {
2058  EVRApplicationError result = FnTable.SetApplicationAutoLaunch(pchAppKey,bAutoLaunch);
2059  return result;
2060  }
2061  public bool GetApplicationAutoLaunch(string pchAppKey)
2062  {
2063  bool result = FnTable.GetApplicationAutoLaunch(pchAppKey);
2064  return result;
2065  }
2066  public EVRApplicationError SetDefaultApplicationForMimeType(string pchAppKey,string pchMimeType)
2067  {
2068  EVRApplicationError result = FnTable.SetDefaultApplicationForMimeType(pchAppKey,pchMimeType);
2069  return result;
2070  }
2071  public bool GetDefaultApplicationForMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
2072  {
2073  bool result = FnTable.GetDefaultApplicationForMimeType(pchMimeType,pchAppKeyBuffer,unAppKeyBufferLen);
2074  return result;
2075  }
2076  public bool GetApplicationSupportedMimeTypes(string pchAppKey,System.Text.StringBuilder pchMimeTypesBuffer,uint unMimeTypesBuffer)
2077  {
2078  bool result = FnTable.GetApplicationSupportedMimeTypes(pchAppKey,pchMimeTypesBuffer,unMimeTypesBuffer);
2079  return result;
2080  }
2081  public uint GetApplicationsThatSupportMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer)
2082  {
2083  uint result = FnTable.GetApplicationsThatSupportMimeType(pchMimeType,pchAppKeysThatSupportBuffer,unAppKeysThatSupportBuffer);
2084  return result;
2085  }
2086  public uint GetApplicationLaunchArguments(uint unHandle,System.Text.StringBuilder pchArgs,uint unArgs)
2087  {
2088  uint result = FnTable.GetApplicationLaunchArguments(unHandle,pchArgs,unArgs);
2089  return result;
2090  }
2091  public EVRApplicationError GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
2092  {
2093  EVRApplicationError result = FnTable.GetStartingApplication(pchAppKeyBuffer,unAppKeyBufferLen);
2094  return result;
2095  }
2096  public EVRApplicationTransitionState GetTransitionState()
2097  {
2098  EVRApplicationTransitionState result = FnTable.GetTransitionState();
2099  return result;
2100  }
2101  public EVRApplicationError PerformApplicationPrelaunchCheck(string pchAppKey)
2102  {
2103  EVRApplicationError result = FnTable.PerformApplicationPrelaunchCheck(pchAppKey);
2104  return result;
2105  }
2106  public string GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state)
2107  {
2108  IntPtr result = FnTable.GetApplicationsTransitionStateNameFromEnum(state);
2109  return Marshal.PtrToStringAnsi(result);
2110  }
2111  public bool IsQuitUserPromptRequested()
2112  {
2113  bool result = FnTable.IsQuitUserPromptRequested();
2114  return result;
2115  }
2116  public EVRApplicationError LaunchInternalProcess(string pchBinaryPath,string pchArguments,string pchWorkingDirectory)
2117  {
2118  EVRApplicationError result = FnTable.LaunchInternalProcess(pchBinaryPath,pchArguments,pchWorkingDirectory);
2119  return result;
2120  }
2121  public uint GetCurrentSceneProcessId()
2122  {
2123  uint result = FnTable.GetCurrentSceneProcessId();
2124  return result;
2125  }
2126 }
2127 
2128 
2129 public class CVRChaperone
2130 {
2131  IVRChaperone FnTable;
2132  internal CVRChaperone(IntPtr pInterface)
2133  {
2134  FnTable = (IVRChaperone)Marshal.PtrToStructure(pInterface, typeof(IVRChaperone));
2135  }
2136  public ChaperoneCalibrationState GetCalibrationState()
2137  {
2138  ChaperoneCalibrationState result = FnTable.GetCalibrationState();
2139  return result;
2140  }
2141  public bool GetPlayAreaSize(ref float pSizeX,ref float pSizeZ)
2142  {
2143  pSizeX = 0;
2144  pSizeZ = 0;
2145  bool result = FnTable.GetPlayAreaSize(ref pSizeX,ref pSizeZ);
2146  return result;
2147  }
2148  public bool GetPlayAreaRect(ref HmdQuad_t rect)
2149  {
2150  bool result = FnTable.GetPlayAreaRect(ref rect);
2151  return result;
2152  }
2153  public void ReloadInfo()
2154  {
2155  FnTable.ReloadInfo();
2156  }
2157  public void SetSceneColor(HmdColor_t color)
2158  {
2159  FnTable.SetSceneColor(color);
2160  }
2161  public void GetBoundsColor(ref HmdColor_t pOutputColorArray,int nNumOutputColors,float flCollisionBoundsFadeDistance,ref HmdColor_t pOutputCameraColor)
2162  {
2163  FnTable.GetBoundsColor(ref pOutputColorArray,nNumOutputColors,flCollisionBoundsFadeDistance,ref pOutputCameraColor);
2164  }
2165  public bool AreBoundsVisible()
2166  {
2167  bool result = FnTable.AreBoundsVisible();
2168  return result;
2169  }
2170  public void ForceBoundsVisible(bool bForce)
2171  {
2172  FnTable.ForceBoundsVisible(bForce);
2173  }
2174 }
2175 
2176 
2177 public class CVRChaperoneSetup
2178 {
2179  IVRChaperoneSetup FnTable;
2180  internal CVRChaperoneSetup(IntPtr pInterface)
2181  {
2182  FnTable = (IVRChaperoneSetup)Marshal.PtrToStructure(pInterface, typeof(IVRChaperoneSetup));
2183  }
2184  public bool CommitWorkingCopy(EChaperoneConfigFile configFile)
2185  {
2186  bool result = FnTable.CommitWorkingCopy(configFile);
2187  return result;
2188  }
2189  public void RevertWorkingCopy()
2190  {
2191  FnTable.RevertWorkingCopy();
2192  }
2193  public bool GetWorkingPlayAreaSize(ref float pSizeX,ref float pSizeZ)
2194  {
2195  pSizeX = 0;
2196  pSizeZ = 0;
2197  bool result = FnTable.GetWorkingPlayAreaSize(ref pSizeX,ref pSizeZ);
2198  return result;
2199  }
2200  public bool GetWorkingPlayAreaRect(ref HmdQuad_t rect)
2201  {
2202  bool result = FnTable.GetWorkingPlayAreaRect(ref rect);
2203  return result;
2204  }
2205  public bool GetWorkingCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2206  {
2207  uint punQuadsCount = 0;
2208  bool result = FnTable.GetWorkingCollisionBoundsInfo(null,ref punQuadsCount);
2209  pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2210  result = FnTable.GetWorkingCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2211  return result;
2212  }
2213  public bool GetLiveCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2214  {
2215  uint punQuadsCount = 0;
2216  bool result = FnTable.GetLiveCollisionBoundsInfo(null,ref punQuadsCount);
2217  pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2218  result = FnTable.GetLiveCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2219  return result;
2220  }
2221  public bool GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
2222  {
2223  bool result = FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
2224  return result;
2225  }
2226  public bool GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose)
2227  {
2228  bool result = FnTable.GetWorkingStandingZeroPoseToRawTrackingPose(ref pmatStandingZeroPoseToRawTrackingPose);
2229  return result;
2230  }
2231  public void SetWorkingPlayAreaSize(float sizeX,float sizeZ)
2232  {
2233  FnTable.SetWorkingPlayAreaSize(sizeX,sizeZ);
2234  }
2235  public void SetWorkingCollisionBoundsInfo(HmdQuad_t [] pQuadsBuffer)
2236  {
2237  FnTable.SetWorkingCollisionBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
2238  }
2239  public void SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose)
2240  {
2241  FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose(ref pMatSeatedZeroPoseToRawTrackingPose);
2242  }
2243  public void SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose)
2244  {
2245  FnTable.SetWorkingStandingZeroPoseToRawTrackingPose(ref pMatStandingZeroPoseToRawTrackingPose);
2246  }
2247  public void ReloadFromDisk(EChaperoneConfigFile configFile)
2248  {
2249  FnTable.ReloadFromDisk(configFile);
2250  }
2251  public bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
2252  {
2253  bool result = FnTable.GetLiveSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
2254  return result;
2255  }
2256  public void SetWorkingCollisionBoundsTagsInfo(byte [] pTagsBuffer)
2257  {
2258  FnTable.SetWorkingCollisionBoundsTagsInfo(pTagsBuffer,(uint) pTagsBuffer.Length);
2259  }
2260  public bool GetLiveCollisionBoundsTagsInfo(out byte [] pTagsBuffer)
2261  {
2262  uint punTagCount = 0;
2263  bool result = FnTable.GetLiveCollisionBoundsTagsInfo(null,ref punTagCount);
2264  pTagsBuffer= new byte[punTagCount];
2265  result = FnTable.GetLiveCollisionBoundsTagsInfo(pTagsBuffer,ref punTagCount);
2266  return result;
2267  }
2268  public bool SetWorkingPhysicalBoundsInfo(HmdQuad_t [] pQuadsBuffer)
2269  {
2270  bool result = FnTable.SetWorkingPhysicalBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
2271  return result;
2272  }
2273  public bool GetLivePhysicalBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2274  {
2275  uint punQuadsCount = 0;
2276  bool result = FnTable.GetLivePhysicalBoundsInfo(null,ref punQuadsCount);
2277  pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2278  result = FnTable.GetLivePhysicalBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2279  return result;
2280  }
2281  public bool ExportLiveToBuffer(System.Text.StringBuilder pBuffer,ref uint pnBufferLength)
2282  {
2283  pnBufferLength = 0;
2284  bool result = FnTable.ExportLiveToBuffer(pBuffer,ref pnBufferLength);
2285  return result;
2286  }
2287  public bool ImportFromBufferToWorking(string pBuffer,uint nImportFlags)
2288  {
2289  bool result = FnTable.ImportFromBufferToWorking(pBuffer,nImportFlags);
2290  return result;
2291  }
2292 }
2293 
2294 
2295 public class CVRCompositor
2296 {
2297  IVRCompositor FnTable;
2298  internal CVRCompositor(IntPtr pInterface)
2299  {
2300  FnTable = (IVRCompositor)Marshal.PtrToStructure(pInterface, typeof(IVRCompositor));
2301  }
2302  public void SetTrackingSpace(ETrackingUniverseOrigin eOrigin)
2303  {
2304  FnTable.SetTrackingSpace(eOrigin);
2305  }
2306  public ETrackingUniverseOrigin GetTrackingSpace()
2307  {
2308  ETrackingUniverseOrigin result = FnTable.GetTrackingSpace();
2309  return result;
2310  }
2311  public EVRCompositorError WaitGetPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
2312  {
2313  EVRCompositorError result = FnTable.WaitGetPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
2314  return result;
2315  }
2316  public EVRCompositorError GetLastPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
2317  {
2318  EVRCompositorError result = FnTable.GetLastPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
2319  return result;
2320  }
2321  public EVRCompositorError GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex,ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pOutputGamePose)
2322  {
2323  EVRCompositorError result = FnTable.GetLastPoseForTrackedDeviceIndex(unDeviceIndex,ref pOutputPose,ref pOutputGamePose);
2324  return result;
2325  }
2326  public EVRCompositorError Submit(EVREye eEye,ref Texture_t pTexture,ref VRTextureBounds_t pBounds,EVRSubmitFlags nSubmitFlags)
2327  {
2328  EVRCompositorError result = FnTable.Submit(eEye,ref pTexture,ref pBounds,nSubmitFlags);
2329  return result;
2330  }
2331  public void ClearLastSubmittedFrame()
2332  {
2333  FnTable.ClearLastSubmittedFrame();
2334  }
2335  public void PostPresentHandoff()
2336  {
2337  FnTable.PostPresentHandoff();
2338  }
2339  public bool GetFrameTiming(ref Compositor_FrameTiming pTiming,uint unFramesAgo)
2340  {
2341  bool result = FnTable.GetFrameTiming(ref pTiming,unFramesAgo);
2342  return result;
2343  }
2344  public uint GetFrameTimings(ref Compositor_FrameTiming pTiming,uint nFrames)
2345  {
2346  uint result = FnTable.GetFrameTimings(ref pTiming,nFrames);
2347  return result;
2348  }
2349  public float GetFrameTimeRemaining()
2350  {
2351  float result = FnTable.GetFrameTimeRemaining();
2352  return result;
2353  }
2354  public void GetCumulativeStats(ref Compositor_CumulativeStats pStats,uint nStatsSizeInBytes)
2355  {
2356  FnTable.GetCumulativeStats(ref pStats,nStatsSizeInBytes);
2357  }
2358  public void FadeToColor(float fSeconds,float fRed,float fGreen,float fBlue,float fAlpha,bool bBackground)
2359  {
2360  FnTable.FadeToColor(fSeconds,fRed,fGreen,fBlue,fAlpha,bBackground);
2361  }
2362  public HmdColor_t GetCurrentFadeColor(bool bBackground)
2363  {
2364  HmdColor_t result = FnTable.GetCurrentFadeColor(bBackground);
2365  return result;
2366  }
2367  public void FadeGrid(float fSeconds,bool bFadeIn)
2368  {
2369  FnTable.FadeGrid(fSeconds,bFadeIn);
2370  }
2371  public float GetCurrentGridAlpha()
2372  {
2373  float result = FnTable.GetCurrentGridAlpha();
2374  return result;
2375  }
2376  public EVRCompositorError SetSkyboxOverride(Texture_t [] pTextures)
2377  {
2378  EVRCompositorError result = FnTable.SetSkyboxOverride(pTextures,(uint) pTextures.Length);
2379  return result;
2380  }
2381  public void ClearSkyboxOverride()
2382  {
2383  FnTable.ClearSkyboxOverride();
2384  }
2385  public void CompositorBringToFront()
2386  {
2387  FnTable.CompositorBringToFront();
2388  }
2389  public void CompositorGoToBack()
2390  {
2391  FnTable.CompositorGoToBack();
2392  }
2393  public void CompositorQuit()
2394  {
2395  FnTable.CompositorQuit();
2396  }
2397  public bool IsFullscreen()
2398  {
2399  bool result = FnTable.IsFullscreen();
2400  return result;
2401  }
2402  public uint GetCurrentSceneFocusProcess()
2403  {
2404  uint result = FnTable.GetCurrentSceneFocusProcess();
2405  return result;
2406  }
2407  public uint GetLastFrameRenderer()
2408  {
2409  uint result = FnTable.GetLastFrameRenderer();
2410  return result;
2411  }
2412  public bool CanRenderScene()
2413  {
2414  bool result = FnTable.CanRenderScene();
2415  return result;
2416  }
2417  public void ShowMirrorWindow()
2418  {
2419  FnTable.ShowMirrorWindow();
2420  }
2421  public void HideMirrorWindow()
2422  {
2423  FnTable.HideMirrorWindow();
2424  }
2425  public bool IsMirrorWindowVisible()
2426  {
2427  bool result = FnTable.IsMirrorWindowVisible();
2428  return result;
2429  }
2430  public void CompositorDumpImages()
2431  {
2432  FnTable.CompositorDumpImages();
2433  }
2434  public bool ShouldAppRenderWithLowResources()
2435  {
2436  bool result = FnTable.ShouldAppRenderWithLowResources();
2437  return result;
2438  }
2439  public void ForceInterleavedReprojectionOn(bool bOverride)
2440  {
2441  FnTable.ForceInterleavedReprojectionOn(bOverride);
2442  }
2443  public void ForceReconnectProcess()
2444  {
2445  FnTable.ForceReconnectProcess();
2446  }
2447  public void SuspendRendering(bool bSuspend)
2448  {
2449  FnTable.SuspendRendering(bSuspend);
2450  }
2451  public EVRCompositorError GetMirrorTextureD3D11(EVREye eEye,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView)
2452  {
2453  EVRCompositorError result = FnTable.GetMirrorTextureD3D11(eEye,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView);
2454  return result;
2455  }
2456  public void ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView)
2457  {
2458  FnTable.ReleaseMirrorTextureD3D11(pD3D11ShaderResourceView);
2459  }
2460  public EVRCompositorError GetMirrorTextureGL(EVREye eEye,ref uint pglTextureId,IntPtr pglSharedTextureHandle)
2461  {
2462  pglTextureId = 0;
2463  EVRCompositorError result = FnTable.GetMirrorTextureGL(eEye,ref pglTextureId,pglSharedTextureHandle);
2464  return result;
2465  }
2466  public bool ReleaseSharedGLTexture(uint glTextureId,IntPtr glSharedTextureHandle)
2467  {
2468  bool result = FnTable.ReleaseSharedGLTexture(glTextureId,glSharedTextureHandle);
2469  return result;
2470  }
2471  public void LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
2472  {
2473  FnTable.LockGLSharedTextureForAccess(glSharedTextureHandle);
2474  }
2475  public void UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
2476  {
2477  FnTable.UnlockGLSharedTextureForAccess(glSharedTextureHandle);
2478  }
2479  public uint GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue,uint unBufferSize)
2480  {
2481  uint result = FnTable.GetVulkanInstanceExtensionsRequired(pchValue,unBufferSize);
2482  return result;
2483  }
2484  public uint GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice,System.Text.StringBuilder pchValue,uint unBufferSize)
2485  {
2486  uint result = FnTable.GetVulkanDeviceExtensionsRequired(pPhysicalDevice,pchValue,unBufferSize);
2487  return result;
2488  }
2489  public void SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode)
2490  {
2491  FnTable.SetExplicitTimingMode(eTimingMode);
2492  }
2493  public EVRCompositorError SubmitExplicitTimingData()
2494  {
2495  EVRCompositorError result = FnTable.SubmitExplicitTimingData();
2496  return result;
2497  }
2498 }
2499 
2500 
2501 public class CVROverlay
2502 {
2503  IVROverlay FnTable;
2504  internal CVROverlay(IntPtr pInterface)
2505  {
2506  FnTable = (IVROverlay)Marshal.PtrToStructure(pInterface, typeof(IVROverlay));
2507  }
2508  public EVROverlayError FindOverlay(string pchOverlayKey,ref ulong pOverlayHandle)
2509  {
2510  pOverlayHandle = 0;
2511  EVROverlayError result = FnTable.FindOverlay(pchOverlayKey,ref pOverlayHandle);
2512  return result;
2513  }
2514  public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayName,ref ulong pOverlayHandle)
2515  {
2516  pOverlayHandle = 0;
2517  EVROverlayError result = FnTable.CreateOverlay(pchOverlayKey,pchOverlayName,ref pOverlayHandle);
2518  return result;
2519  }
2520  public EVROverlayError DestroyOverlay(ulong ulOverlayHandle)
2521  {
2522  EVROverlayError result = FnTable.DestroyOverlay(ulOverlayHandle);
2523  return result;
2524  }
2525  public EVROverlayError SetHighQualityOverlay(ulong ulOverlayHandle)
2526  {
2527  EVROverlayError result = FnTable.SetHighQualityOverlay(ulOverlayHandle);
2528  return result;
2529  }
2530  public ulong GetHighQualityOverlay()
2531  {
2532  ulong result = FnTable.GetHighQualityOverlay();
2533  return result;
2534  }
2535  public uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
2536  {
2537  uint result = FnTable.GetOverlayKey(ulOverlayHandle,pchValue,unBufferSize,ref pError);
2538  return result;
2539  }
2540  public uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
2541  {
2542  uint result = FnTable.GetOverlayName(ulOverlayHandle,pchValue,unBufferSize,ref pError);
2543  return result;
2544  }
2545  public EVROverlayError SetOverlayName(ulong ulOverlayHandle,string pchName)
2546  {
2547  EVROverlayError result = FnTable.SetOverlayName(ulOverlayHandle,pchName);
2548  return result;
2549  }
2550  public EVROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight)
2551  {
2552  punWidth = 0;
2553  punHeight = 0;
2554  EVROverlayError result = FnTable.GetOverlayImageData(ulOverlayHandle,pvBuffer,unBufferSize,ref punWidth,ref punHeight);
2555  return result;
2556  }
2557  public string GetOverlayErrorNameFromEnum(EVROverlayError error)
2558  {
2559  IntPtr result = FnTable.GetOverlayErrorNameFromEnum(error);
2560  return Marshal.PtrToStringAnsi(result);
2561  }
2562  public EVROverlayError SetOverlayRenderingPid(ulong ulOverlayHandle,uint unPID)
2563  {
2564  EVROverlayError result = FnTable.SetOverlayRenderingPid(ulOverlayHandle,unPID);
2565  return result;
2566  }
2567  public uint GetOverlayRenderingPid(ulong ulOverlayHandle)
2568  {
2569  uint result = FnTable.GetOverlayRenderingPid(ulOverlayHandle);
2570  return result;
2571  }
2572  public EVROverlayError SetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,bool bEnabled)
2573  {
2574  EVROverlayError result = FnTable.SetOverlayFlag(ulOverlayHandle,eOverlayFlag,bEnabled);
2575  return result;
2576  }
2577  public EVROverlayError GetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,ref bool pbEnabled)
2578  {
2579  pbEnabled = false;
2580  EVROverlayError result = FnTable.GetOverlayFlag(ulOverlayHandle,eOverlayFlag,ref pbEnabled);
2581  return result;
2582  }
2583  public EVROverlayError SetOverlayColor(ulong ulOverlayHandle,float fRed,float fGreen,float fBlue)
2584  {
2585  EVROverlayError result = FnTable.SetOverlayColor(ulOverlayHandle,fRed,fGreen,fBlue);
2586  return result;
2587  }
2588  public EVROverlayError GetOverlayColor(ulong ulOverlayHandle,ref float pfRed,ref float pfGreen,ref float pfBlue)
2589  {
2590  pfRed = 0;
2591  pfGreen = 0;
2592  pfBlue = 0;
2593  EVROverlayError result = FnTable.GetOverlayColor(ulOverlayHandle,ref pfRed,ref pfGreen,ref pfBlue);
2594  return result;
2595  }
2596  public EVROverlayError SetOverlayAlpha(ulong ulOverlayHandle,float fAlpha)
2597  {
2598  EVROverlayError result = FnTable.SetOverlayAlpha(ulOverlayHandle,fAlpha);
2599  return result;
2600  }
2601  public EVROverlayError GetOverlayAlpha(ulong ulOverlayHandle,ref float pfAlpha)
2602  {
2603  pfAlpha = 0;
2604  EVROverlayError result = FnTable.GetOverlayAlpha(ulOverlayHandle,ref pfAlpha);
2605  return result;
2606  }
2607  public EVROverlayError SetOverlayTexelAspect(ulong ulOverlayHandle,float fTexelAspect)
2608  {
2609  EVROverlayError result = FnTable.SetOverlayTexelAspect(ulOverlayHandle,fTexelAspect);
2610  return result;
2611  }
2612  public EVROverlayError GetOverlayTexelAspect(ulong ulOverlayHandle,ref float pfTexelAspect)
2613  {
2614  pfTexelAspect = 0;
2615  EVROverlayError result = FnTable.GetOverlayTexelAspect(ulOverlayHandle,ref pfTexelAspect);
2616  return result;
2617  }
2618  public EVROverlayError SetOverlaySortOrder(ulong ulOverlayHandle,uint unSortOrder)
2619  {
2620  EVROverlayError result = FnTable.SetOverlaySortOrder(ulOverlayHandle,unSortOrder);
2621  return result;
2622  }
2623  public EVROverlayError GetOverlaySortOrder(ulong ulOverlayHandle,ref uint punSortOrder)
2624  {
2625  punSortOrder = 0;
2626  EVROverlayError result = FnTable.GetOverlaySortOrder(ulOverlayHandle,ref punSortOrder);
2627  return result;
2628  }
2629  public EVROverlayError SetOverlayWidthInMeters(ulong ulOverlayHandle,float fWidthInMeters)
2630  {
2631  EVROverlayError result = FnTable.SetOverlayWidthInMeters(ulOverlayHandle,fWidthInMeters);
2632  return result;
2633  }
2634  public EVROverlayError GetOverlayWidthInMeters(ulong ulOverlayHandle,ref float pfWidthInMeters)
2635  {
2636  pfWidthInMeters = 0;
2637  EVROverlayError result = FnTable.GetOverlayWidthInMeters(ulOverlayHandle,ref pfWidthInMeters);
2638  return result;
2639  }
2640  public EVROverlayError SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,float fMinDistanceInMeters,float fMaxDistanceInMeters)
2641  {
2642  EVROverlayError result = FnTable.SetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,fMinDistanceInMeters,fMaxDistanceInMeters);
2643  return result;
2644  }
2645  public EVROverlayError GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,ref float pfMinDistanceInMeters,ref float pfMaxDistanceInMeters)
2646  {
2647  pfMinDistanceInMeters = 0;
2648  pfMaxDistanceInMeters = 0;
2649  EVROverlayError result = FnTable.GetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,ref pfMinDistanceInMeters,ref pfMaxDistanceInMeters);
2650  return result;
2651  }
2652  public EVROverlayError SetOverlayTextureColorSpace(ulong ulOverlayHandle,EColorSpace eTextureColorSpace)
2653  {
2654  EVROverlayError result = FnTable.SetOverlayTextureColorSpace(ulOverlayHandle,eTextureColorSpace);
2655  return result;
2656  }
2657  public EVROverlayError GetOverlayTextureColorSpace(ulong ulOverlayHandle,ref EColorSpace peTextureColorSpace)
2658  {
2659  EVROverlayError result = FnTable.GetOverlayTextureColorSpace(ulOverlayHandle,ref peTextureColorSpace);
2660  return result;
2661  }
2662  public EVROverlayError SetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
2663  {
2664  EVROverlayError result = FnTable.SetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
2665  return result;
2666  }
2667  public EVROverlayError GetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
2668  {
2669  EVROverlayError result = FnTable.GetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
2670  return result;
2671  }
2672  public uint GetOverlayRenderModel(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref HmdColor_t pColor,ref EVROverlayError pError)
2673  {
2674  uint result = FnTable.GetOverlayRenderModel(ulOverlayHandle,pchValue,unBufferSize,ref pColor,ref pError);
2675  return result;
2676  }
2677  public EVROverlayError SetOverlayRenderModel(ulong ulOverlayHandle,string pchRenderModel,ref HmdColor_t pColor)
2678  {
2679  EVROverlayError result = FnTable.SetOverlayRenderModel(ulOverlayHandle,pchRenderModel,ref pColor);
2680  return result;
2681  }
2682  public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
2683  {
2684  EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
2685  return result;
2686  }
2687  public EVROverlayError SetOverlayTransformAbsolute(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
2688  {
2689  EVROverlayError result = FnTable.SetOverlayTransformAbsolute(ulOverlayHandle,eTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
2690  return result;
2691  }
2692  public EVROverlayError GetOverlayTransformAbsolute(ulong ulOverlayHandle,ref ETrackingUniverseOrigin peTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
2693  {
2694  EVROverlayError result = FnTable.GetOverlayTransformAbsolute(ulOverlayHandle,ref peTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
2695  return result;
2696  }
2697  public EVROverlayError SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,uint unTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
2698  {
2699  EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,unTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
2700  return result;
2701  }
2702  public EVROverlayError GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,ref uint punTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
2703  {
2704  punTrackedDevice = 0;
2705  EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,ref punTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
2706  return result;
2707  }
2708  public EVROverlayError SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,uint unDeviceIndex,string pchComponentName)
2709  {
2710  EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,unDeviceIndex,pchComponentName);
2711  return result;
2712  }
2713  public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameSize)
2714  {
2715  punDeviceIndex = 0;
2716  EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize);
2717  return result;
2718  }
2719  public EVROverlayError GetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ref ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
2720  {
2721  ulOverlayHandleParent = 0;
2722  EVROverlayError result = FnTable.GetOverlayTransformOverlayRelative(ulOverlayHandle,ref ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
2723  return result;
2724  }
2725  public EVROverlayError SetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
2726  {
2727  EVROverlayError result = FnTable.SetOverlayTransformOverlayRelative(ulOverlayHandle,ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
2728  return result;
2729  }
2730  public EVROverlayError ShowOverlay(ulong ulOverlayHandle)
2731  {
2732  EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle);
2733  return result;
2734  }
2735  public EVROverlayError HideOverlay(ulong ulOverlayHandle)
2736  {
2737  EVROverlayError result = FnTable.HideOverlay(ulOverlayHandle);
2738  return result;
2739  }
2740  public bool IsOverlayVisible(ulong ulOverlayHandle)
2741  {
2742  bool result = FnTable.IsOverlayVisible(ulOverlayHandle);
2743  return result;
2744  }
2745  public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
2746  {
2747  EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
2748  return result;
2749  }
2750 // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
2751 // originally mis-compiled with the wrong packing for Linux and OSX.
2752  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
2753  internal delegate bool _PollNextOverlayEventPacked(ulong ulOverlayHandle,ref VREvent_t_Packed pEvent,uint uncbVREvent);
2754  [StructLayout(LayoutKind.Explicit)]
2755  struct PollNextOverlayEventUnion
2756  {
2757  [FieldOffset(0)]
2758  public IVROverlay._PollNextOverlayEvent pPollNextOverlayEvent;
2759  [FieldOffset(0)]
2760  public _PollNextOverlayEventPacked pPollNextOverlayEventPacked;
2761  }
2762  public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
2763  {
2764 #if !UNITY_METRO
2765  if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
2766  (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
2767  {
2768  PollNextOverlayEventUnion u;
2769  VREvent_t_Packed event_packed = new VREvent_t_Packed();
2770  u.pPollNextOverlayEventPacked = null;
2771  u.pPollNextOverlayEvent = FnTable.PollNextOverlayEvent;
2772  bool packed_result = u.pPollNextOverlayEventPacked(ulOverlayHandle,ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
2773 
2774  event_packed.Unpack(ref pEvent);
2775  return packed_result;
2776  }
2777 #endif
2778  bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
2779  return result;
2780  }
2781  public EVROverlayError GetOverlayInputMethod(ulong ulOverlayHandle,ref VROverlayInputMethod peInputMethod)
2782  {
2783  EVROverlayError result = FnTable.GetOverlayInputMethod(ulOverlayHandle,ref peInputMethod);
2784  return result;
2785  }
2786  public EVROverlayError SetOverlayInputMethod(ulong ulOverlayHandle,VROverlayInputMethod eInputMethod)
2787  {
2788  EVROverlayError result = FnTable.SetOverlayInputMethod(ulOverlayHandle,eInputMethod);
2789  return result;
2790  }
2791  public EVROverlayError GetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
2792  {
2793  EVROverlayError result = FnTable.GetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
2794  return result;
2795  }
2796  public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
2797  {
2798  EVROverlayError result = FnTable.SetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
2799  return result;
2800  }
2801  public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
2802  {
2803  bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults);
2804  return result;
2805  }
2806  public bool IsHoverTargetOverlay(ulong ulOverlayHandle)
2807  {
2808  bool result = FnTable.IsHoverTargetOverlay(ulOverlayHandle);
2809  return result;
2810  }
2811  public ulong GetGamepadFocusOverlay()
2812  {
2813  ulong result = FnTable.GetGamepadFocusOverlay();
2814  return result;
2815  }
2816  public EVROverlayError SetGamepadFocusOverlay(ulong ulNewFocusOverlay)
2817  {
2818  EVROverlayError result = FnTable.SetGamepadFocusOverlay(ulNewFocusOverlay);
2819  return result;
2820  }
2821  public EVROverlayError SetOverlayNeighbor(EOverlayDirection eDirection,ulong ulFrom,ulong ulTo)
2822  {
2823  EVROverlayError result = FnTable.SetOverlayNeighbor(eDirection,ulFrom,ulTo);
2824  return result;
2825  }
2826  public EVROverlayError MoveGamepadFocusToNeighbor(EOverlayDirection eDirection,ulong ulFrom)
2827  {
2828  EVROverlayError result = FnTable.MoveGamepadFocusToNeighbor(eDirection,ulFrom);
2829  return result;
2830  }
2831  public EVROverlayError SetOverlayDualAnalogTransform(ulong ulOverlay,EDualAnalogWhich eWhich,IntPtr vCenter,float fRadius)
2832  {
2833  EVROverlayError result = FnTable.SetOverlayDualAnalogTransform(ulOverlay,eWhich,vCenter,fRadius);
2834  return result;
2835  }
2836  public EVROverlayError GetOverlayDualAnalogTransform(ulong ulOverlay,EDualAnalogWhich eWhich,ref HmdVector2_t pvCenter,ref float pfRadius)
2837  {
2838  pfRadius = 0;
2839  EVROverlayError result = FnTable.GetOverlayDualAnalogTransform(ulOverlay,eWhich,ref pvCenter,ref pfRadius);
2840  return result;
2841  }
2842  public EVROverlayError SetOverlayTexture(ulong ulOverlayHandle,ref Texture_t pTexture)
2843  {
2844  EVROverlayError result = FnTable.SetOverlayTexture(ulOverlayHandle,ref pTexture);
2845  return result;
2846  }
2847  public EVROverlayError ClearOverlayTexture(ulong ulOverlayHandle)
2848  {
2849  EVROverlayError result = FnTable.ClearOverlayTexture(ulOverlayHandle);
2850  return result;
2851  }
2852  public EVROverlayError SetOverlayRaw(ulong ulOverlayHandle,IntPtr pvBuffer,uint unWidth,uint unHeight,uint unDepth)
2853  {
2854  EVROverlayError result = FnTable.SetOverlayRaw(ulOverlayHandle,pvBuffer,unWidth,unHeight,unDepth);
2855  return result;
2856  }
2857  public EVROverlayError SetOverlayFromFile(ulong ulOverlayHandle,string pchFilePath)
2858  {
2859  EVROverlayError result = FnTable.SetOverlayFromFile(ulOverlayHandle,pchFilePath);
2860  return result;
2861  }
2862  public EVROverlayError GetOverlayTexture(ulong ulOverlayHandle,ref IntPtr pNativeTextureHandle,IntPtr pNativeTextureRef,ref uint pWidth,ref uint pHeight,ref uint pNativeFormat,ref ETextureType pAPIType,ref EColorSpace pColorSpace,ref VRTextureBounds_t pTextureBounds)
2863  {
2864  pWidth = 0;
2865  pHeight = 0;
2866  pNativeFormat = 0;
2867  EVROverlayError result = FnTable.GetOverlayTexture(ulOverlayHandle,ref pNativeTextureHandle,pNativeTextureRef,ref pWidth,ref pHeight,ref pNativeFormat,ref pAPIType,ref pColorSpace,ref pTextureBounds);
2868  return result;
2869  }
2870  public EVROverlayError ReleaseNativeOverlayHandle(ulong ulOverlayHandle,IntPtr pNativeTextureHandle)
2871  {
2872  EVROverlayError result = FnTable.ReleaseNativeOverlayHandle(ulOverlayHandle,pNativeTextureHandle);
2873  return result;
2874  }
2875  public EVROverlayError GetOverlayTextureSize(ulong ulOverlayHandle,ref uint pWidth,ref uint pHeight)
2876  {
2877  pWidth = 0;
2878  pHeight = 0;
2879  EVROverlayError result = FnTable.GetOverlayTextureSize(ulOverlayHandle,ref pWidth,ref pHeight);
2880  return result;
2881  }
2882  public EVROverlayError CreateDashboardOverlay(string pchOverlayKey,string pchOverlayFriendlyName,ref ulong pMainHandle,ref ulong pThumbnailHandle)
2883  {
2884  pMainHandle = 0;
2885  pThumbnailHandle = 0;
2886  EVROverlayError result = FnTable.CreateDashboardOverlay(pchOverlayKey,pchOverlayFriendlyName,ref pMainHandle,ref pThumbnailHandle);
2887  return result;
2888  }
2889  public bool IsDashboardVisible()
2890  {
2891  bool result = FnTable.IsDashboardVisible();
2892  return result;
2893  }
2894  public bool IsActiveDashboardOverlay(ulong ulOverlayHandle)
2895  {
2896  bool result = FnTable.IsActiveDashboardOverlay(ulOverlayHandle);
2897  return result;
2898  }
2899  public EVROverlayError SetDashboardOverlaySceneProcess(ulong ulOverlayHandle,uint unProcessId)
2900  {
2901  EVROverlayError result = FnTable.SetDashboardOverlaySceneProcess(ulOverlayHandle,unProcessId);
2902  return result;
2903  }
2904  public EVROverlayError GetDashboardOverlaySceneProcess(ulong ulOverlayHandle,ref uint punProcessId)
2905  {
2906  punProcessId = 0;
2907  EVROverlayError result = FnTable.GetDashboardOverlaySceneProcess(ulOverlayHandle,ref punProcessId);
2908  return result;
2909  }
2910  public void ShowDashboard(string pchOverlayToShow)
2911  {
2912  FnTable.ShowDashboard(pchOverlayToShow);
2913  }
2914  public uint GetPrimaryDashboardDevice()
2915  {
2916  uint result = FnTable.GetPrimaryDashboardDevice();
2917  return result;
2918  }
2919  public EVROverlayError ShowKeyboard(int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText,bool bUseMinimalMode,ulong uUserValue)
2920  {
2921  EVROverlayError result = FnTable.ShowKeyboard(eInputMode,eLineInputMode,pchDescription,unCharMax,pchExistingText,bUseMinimalMode,uUserValue);
2922  return result;
2923  }
2924  public EVROverlayError ShowKeyboardForOverlay(ulong ulOverlayHandle,int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText,bool bUseMinimalMode,ulong uUserValue)
2925  {
2926  EVROverlayError result = FnTable.ShowKeyboardForOverlay(ulOverlayHandle,eInputMode,eLineInputMode,pchDescription,unCharMax,pchExistingText,bUseMinimalMode,uUserValue);
2927  return result;
2928  }
2929  public uint GetKeyboardText(System.Text.StringBuilder pchText,uint cchText)
2930  {
2931  uint result = FnTable.GetKeyboardText(pchText,cchText);
2932  return result;
2933  }
2934  public void HideKeyboard()
2935  {
2936  FnTable.HideKeyboard();
2937  }
2938  public void SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform)
2939  {
2940  FnTable.SetKeyboardTransformAbsolute(eTrackingOrigin,ref pmatTrackingOriginToKeyboardTransform);
2941  }
2942  public void SetKeyboardPositionForOverlay(ulong ulOverlayHandle,HmdRect2_t avoidRect)
2943  {
2944  FnTable.SetKeyboardPositionForOverlay(ulOverlayHandle,avoidRect);
2945  }
2946  public EVROverlayError SetOverlayIntersectionMask(ulong ulOverlayHandle,ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives,uint unNumMaskPrimitives,uint unPrimitiveSize)
2947  {
2948  EVROverlayError result = FnTable.SetOverlayIntersectionMask(ulOverlayHandle,ref pMaskPrimitives,unNumMaskPrimitives,unPrimitiveSize);
2949  return result;
2950  }
2951  public EVROverlayError GetOverlayFlags(ulong ulOverlayHandle,ref uint pFlags)
2952  {
2953  pFlags = 0;
2954  EVROverlayError result = FnTable.GetOverlayFlags(ulOverlayHandle,ref pFlags);
2955  return result;
2956  }
2957  public VRMessageOverlayResponse ShowMessageOverlay(string pchText,string pchCaption,string pchButton0Text,string pchButton1Text,string pchButton2Text,string pchButton3Text)
2958  {
2959  VRMessageOverlayResponse result = FnTable.ShowMessageOverlay(pchText,pchCaption,pchButton0Text,pchButton1Text,pchButton2Text,pchButton3Text);
2960  return result;
2961  }
2962  public void CloseMessageOverlay()
2963  {
2964  FnTable.CloseMessageOverlay();
2965  }
2966 }
2967 
2968 
2969 public class CVRRenderModels
2970 {
2971  IVRRenderModels FnTable;
2972  internal CVRRenderModels(IntPtr pInterface)
2973  {
2974  FnTable = (IVRRenderModels)Marshal.PtrToStructure(pInterface, typeof(IVRRenderModels));
2975  }
2976  public EVRRenderModelError LoadRenderModel_Async(string pchRenderModelName,ref IntPtr ppRenderModel)
2977  {
2978  EVRRenderModelError result = FnTable.LoadRenderModel_Async(pchRenderModelName,ref ppRenderModel);
2979  return result;
2980  }
2981  public void FreeRenderModel(IntPtr pRenderModel)
2982  {
2983  FnTable.FreeRenderModel(pRenderModel);
2984  }
2985  public EVRRenderModelError LoadTexture_Async(int textureId,ref IntPtr ppTexture)
2986  {
2987  EVRRenderModelError result = FnTable.LoadTexture_Async(textureId,ref ppTexture);
2988  return result;
2989  }
2990  public void FreeTexture(IntPtr pTexture)
2991  {
2992  FnTable.FreeTexture(pTexture);
2993  }
2994  public EVRRenderModelError LoadTextureD3D11_Async(int textureId,IntPtr pD3D11Device,ref IntPtr ppD3D11Texture2D)
2995  {
2996  EVRRenderModelError result = FnTable.LoadTextureD3D11_Async(textureId,pD3D11Device,ref ppD3D11Texture2D);
2997  return result;
2998  }
2999  public EVRRenderModelError LoadIntoTextureD3D11_Async(int textureId,IntPtr pDstTexture)
3000  {
3001  EVRRenderModelError result = FnTable.LoadIntoTextureD3D11_Async(textureId,pDstTexture);
3002  return result;
3003  }
3004  public void FreeTextureD3D11(IntPtr pD3D11Texture2D)
3005  {
3006  FnTable.FreeTextureD3D11(pD3D11Texture2D);
3007  }
3008  public uint GetRenderModelName(uint unRenderModelIndex,System.Text.StringBuilder pchRenderModelName,uint unRenderModelNameLen)
3009  {
3010  uint result = FnTable.GetRenderModelName(unRenderModelIndex,pchRenderModelName,unRenderModelNameLen);
3011  return result;
3012  }
3013  public uint GetRenderModelCount()
3014  {
3015  uint result = FnTable.GetRenderModelCount();
3016  return result;
3017  }
3018  public uint GetComponentCount(string pchRenderModelName)
3019  {
3020  uint result = FnTable.GetComponentCount(pchRenderModelName);
3021  return result;
3022  }
3023  public uint GetComponentName(string pchRenderModelName,uint unComponentIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameLen)
3024  {
3025  uint result = FnTable.GetComponentName(pchRenderModelName,unComponentIndex,pchComponentName,unComponentNameLen);
3026  return result;
3027  }
3028  public ulong GetComponentButtonMask(string pchRenderModelName,string pchComponentName)
3029  {
3030  ulong result = FnTable.GetComponentButtonMask(pchRenderModelName,pchComponentName);
3031  return result;
3032  }
3033  public uint GetComponentRenderModelName(string pchRenderModelName,string pchComponentName,System.Text.StringBuilder pchComponentRenderModelName,uint unComponentRenderModelNameLen)
3034  {
3035  uint result = FnTable.GetComponentRenderModelName(pchRenderModelName,pchComponentName,pchComponentRenderModelName,unComponentRenderModelNameLen);
3036  return result;
3037  }
3038 // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
3039 // originally mis-compiled with the wrong packing for Linux and OSX.
3040  [UnmanagedFunctionPointer(CallingConvention.StdCall)]
3041  internal delegate bool _GetComponentStatePacked(string pchRenderModelName,string pchComponentName,ref VRControllerState_t_Packed pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState);
3042  [StructLayout(LayoutKind.Explicit)]
3043  struct GetComponentStateUnion
3044  {
3045  [FieldOffset(0)]
3046  public IVRRenderModels._GetComponentState pGetComponentState;
3047  [FieldOffset(0)]
3048  public _GetComponentStatePacked pGetComponentStatePacked;
3049  }
3050  public bool GetComponentState(string pchRenderModelName,string pchComponentName,ref VRControllerState_t pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)
3051  {
3052 #if !UNITY_METRO
3053  if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
3054  (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
3055  {
3056  GetComponentStateUnion u;
3057  VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
3058  u.pGetComponentStatePacked = null;
3059  u.pGetComponentState = FnTable.GetComponentState;
3060  bool packed_result = u.pGetComponentStatePacked(pchRenderModelName,pchComponentName,ref state_packed,ref pState,ref pComponentState);
3061 
3062  state_packed.Unpack(ref pControllerState);
3063  return packed_result;
3064  }
3065 #endif
3066  bool result = FnTable.GetComponentState(pchRenderModelName,pchComponentName,ref pControllerState,ref pState,ref pComponentState);
3067  return result;
3068  }
3069  public bool RenderModelHasComponent(string pchRenderModelName,string pchComponentName)
3070  {
3071  bool result = FnTable.RenderModelHasComponent(pchRenderModelName,pchComponentName);
3072  return result;
3073  }
3074  public uint GetRenderModelThumbnailURL(string pchRenderModelName,System.Text.StringBuilder pchThumbnailURL,uint unThumbnailURLLen,ref EVRRenderModelError peError)
3075  {
3076  uint result = FnTable.GetRenderModelThumbnailURL(pchRenderModelName,pchThumbnailURL,unThumbnailURLLen,ref peError);
3077  return result;
3078  }
3079  public uint GetRenderModelOriginalPath(string pchRenderModelName,System.Text.StringBuilder pchOriginalPath,uint unOriginalPathLen,ref EVRRenderModelError peError)
3080  {
3081  uint result = FnTable.GetRenderModelOriginalPath(pchRenderModelName,pchOriginalPath,unOriginalPathLen,ref peError);
3082  return result;
3083  }
3084  public string GetRenderModelErrorNameFromEnum(EVRRenderModelError error)
3085  {
3086  IntPtr result = FnTable.GetRenderModelErrorNameFromEnum(error);
3087  return Marshal.PtrToStringAnsi(result);
3088  }
3089 }
3090 
3091 
3092 public class CVRNotifications
3093 {
3094  IVRNotifications FnTable;
3095  internal CVRNotifications(IntPtr pInterface)
3096  {
3097  FnTable = (IVRNotifications)Marshal.PtrToStructure(pInterface, typeof(IVRNotifications));
3098  }
3099  public EVRNotificationError CreateNotification(ulong ulOverlayHandle,ulong ulUserValue,EVRNotificationType type,string pchText,EVRNotificationStyle style,ref NotificationBitmap_t pImage,ref uint pNotificationId)
3100  {
3101  pNotificationId = 0;
3102  EVRNotificationError result = FnTable.CreateNotification(ulOverlayHandle,ulUserValue,type,pchText,style,ref pImage,ref pNotificationId);
3103  return result;
3104  }
3105  public EVRNotificationError RemoveNotification(uint notificationId)
3106  {
3107  EVRNotificationError result = FnTable.RemoveNotification(notificationId);
3108  return result;
3109  }
3110 }
3111 
3112 
3113 public class CVRSettings
3114 {
3115  IVRSettings FnTable;
3116  internal CVRSettings(IntPtr pInterface)
3117  {
3118  FnTable = (IVRSettings)Marshal.PtrToStructure(pInterface, typeof(IVRSettings));
3119  }
3120  public string GetSettingsErrorNameFromEnum(EVRSettingsError eError)
3121  {
3122  IntPtr result = FnTable.GetSettingsErrorNameFromEnum(eError);
3123  return Marshal.PtrToStringAnsi(result);
3124  }
3125  public bool Sync(bool bForce,ref EVRSettingsError peError)
3126  {
3127  bool result = FnTable.Sync(bForce,ref peError);
3128  return result;
3129  }
3130  public void SetBool(string pchSection,string pchSettingsKey,bool bValue,ref EVRSettingsError peError)
3131  {
3132  FnTable.SetBool(pchSection,pchSettingsKey,bValue,ref peError);
3133  }
3134  public void SetInt32(string pchSection,string pchSettingsKey,int nValue,ref EVRSettingsError peError)
3135  {
3136  FnTable.SetInt32(pchSection,pchSettingsKey,nValue,ref peError);
3137  }
3138  public void SetFloat(string pchSection,string pchSettingsKey,float flValue,ref EVRSettingsError peError)
3139  {
3140  FnTable.SetFloat(pchSection,pchSettingsKey,flValue,ref peError);
3141  }
3142  public void SetString(string pchSection,string pchSettingsKey,string pchValue,ref EVRSettingsError peError)
3143  {
3144  FnTable.SetString(pchSection,pchSettingsKey,pchValue,ref peError);
3145  }
3146  public bool GetBool(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
3147  {
3148  bool result = FnTable.GetBool(pchSection,pchSettingsKey,ref peError);
3149  return result;
3150  }
3151  public int GetInt32(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
3152  {
3153  int result = FnTable.GetInt32(pchSection,pchSettingsKey,ref peError);
3154  return result;
3155  }
3156  public float GetFloat(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
3157  {
3158  float result = FnTable.GetFloat(pchSection,pchSettingsKey,ref peError);
3159  return result;
3160  }
3161  public void GetString(string pchSection,string pchSettingsKey,System.Text.StringBuilder pchValue,uint unValueLen,ref EVRSettingsError peError)
3162  {
3163  FnTable.GetString(pchSection,pchSettingsKey,pchValue,unValueLen,ref peError);
3164  }
3165  public void RemoveSection(string pchSection,ref EVRSettingsError peError)
3166  {
3167  FnTable.RemoveSection(pchSection,ref peError);
3168  }
3169  public void RemoveKeyInSection(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
3170  {
3171  FnTable.RemoveKeyInSection(pchSection,pchSettingsKey,ref peError);
3172  }
3173 }
3174 
3175 
3176 public class CVRScreenshots
3177 {
3178  IVRScreenshots FnTable;
3179  internal CVRScreenshots(IntPtr pInterface)
3180  {
3181  FnTable = (IVRScreenshots)Marshal.PtrToStructure(pInterface, typeof(IVRScreenshots));
3182  }
3183  public EVRScreenshotError RequestScreenshot(ref uint pOutScreenshotHandle,EVRScreenshotType type,string pchPreviewFilename,string pchVRFilename)
3184  {
3185  pOutScreenshotHandle = 0;
3186  EVRScreenshotError result = FnTable.RequestScreenshot(ref pOutScreenshotHandle,type,pchPreviewFilename,pchVRFilename);
3187  return result;
3188  }
3189  public EVRScreenshotError HookScreenshot(EVRScreenshotType [] pSupportedTypes)
3190  {
3191  EVRScreenshotError result = FnTable.HookScreenshot(pSupportedTypes,(int) pSupportedTypes.Length);
3192  return result;
3193  }
3194  public EVRScreenshotType GetScreenshotPropertyType(uint screenshotHandle,ref EVRScreenshotError pError)
3195  {
3196  EVRScreenshotType result = FnTable.GetScreenshotPropertyType(screenshotHandle,ref pError);
3197  return result;
3198  }
3199  public uint GetScreenshotPropertyFilename(uint screenshotHandle,EVRScreenshotPropertyFilenames filenameType,System.Text.StringBuilder pchFilename,uint cchFilename,ref EVRScreenshotError pError)
3200  {
3201  uint result = FnTable.GetScreenshotPropertyFilename(screenshotHandle,filenameType,pchFilename,cchFilename,ref pError);
3202  return result;
3203  }
3204  public EVRScreenshotError UpdateScreenshotProgress(uint screenshotHandle,float flProgress)
3205  {
3206  EVRScreenshotError result = FnTable.UpdateScreenshotProgress(screenshotHandle,flProgress);
3207  return result;
3208  }
3209  public EVRScreenshotError TakeStereoScreenshot(ref uint pOutScreenshotHandle,string pchPreviewFilename,string pchVRFilename)
3210  {
3211  pOutScreenshotHandle = 0;
3212  EVRScreenshotError result = FnTable.TakeStereoScreenshot(ref pOutScreenshotHandle,pchPreviewFilename,pchVRFilename);
3213  return result;
3214  }
3215  public EVRScreenshotError SubmitScreenshot(uint screenshotHandle,EVRScreenshotType type,string pchSourcePreviewFilename,string pchSourceVRFilename)
3216  {
3217  EVRScreenshotError result = FnTable.SubmitScreenshot(screenshotHandle,type,pchSourcePreviewFilename,pchSourceVRFilename);
3218  return result;
3219  }
3220 }
3221 
3222 
3223 public class CVRResources
3224 {
3225  IVRResources FnTable;
3226  internal CVRResources(IntPtr pInterface)
3227  {
3228  FnTable = (IVRResources)Marshal.PtrToStructure(pInterface, typeof(IVRResources));
3229  }
3230  public uint LoadSharedResource(string pchResourceName,string pchBuffer,uint unBufferLen)
3231  {
3232  uint result = FnTable.LoadSharedResource(pchResourceName,pchBuffer,unBufferLen);
3233  return result;
3234  }
3235  public uint GetResourceFullPath(string pchResourceName,string pchResourceTypeDirectory,System.Text.StringBuilder pchPathBuffer,uint unBufferLen)
3236  {
3237  uint result = FnTable.GetResourceFullPath(pchResourceName,pchResourceTypeDirectory,pchPathBuffer,unBufferLen);
3238  return result;
3239  }
3240 }
3241 
3242 
3243 public class CVRDriverManager
3244 {
3245  IVRDriverManager FnTable;
3246  internal CVRDriverManager(IntPtr pInterface)
3247  {
3248  FnTable = (IVRDriverManager)Marshal.PtrToStructure(pInterface, typeof(IVRDriverManager));
3249  }
3250  public uint GetDriverCount()
3251  {
3252  uint result = FnTable.GetDriverCount();
3253  return result;
3254  }
3255  public uint GetDriverName(uint nDriver,System.Text.StringBuilder pchValue,uint unBufferSize)
3256  {
3257  uint result = FnTable.GetDriverName(nDriver,pchValue,unBufferSize);
3258  return result;
3259  }
3260 }
3261 
3262 
3263 public class OpenVRInterop
3264 {
3265  [DllImportAttribute("openvr_api", EntryPoint = "VR_InitInternal", CallingConvention = CallingConvention.Cdecl)]
3266  internal static extern uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType);
3267  [DllImportAttribute("openvr_api", EntryPoint = "VR_ShutdownInternal", CallingConvention = CallingConvention.Cdecl)]
3268  internal static extern void ShutdownInternal();
3269  [DllImportAttribute("openvr_api", EntryPoint = "VR_IsHmdPresent", CallingConvention = CallingConvention.Cdecl)]
3270  internal static extern bool IsHmdPresent();
3271  [DllImportAttribute("openvr_api", EntryPoint = "VR_IsRuntimeInstalled", CallingConvention = CallingConvention.Cdecl)]
3272  internal static extern bool IsRuntimeInstalled();
3273  [DllImportAttribute("openvr_api", EntryPoint = "VR_GetStringForHmdError", CallingConvention = CallingConvention.Cdecl)]
3274  internal static extern IntPtr GetStringForHmdError(EVRInitError error);
3275  [DllImportAttribute("openvr_api", EntryPoint = "VR_GetGenericInterface", CallingConvention = CallingConvention.Cdecl)]
3276  internal static extern IntPtr GetGenericInterface([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion, ref EVRInitError peError);
3277  [DllImportAttribute("openvr_api", EntryPoint = "VR_IsInterfaceVersionValid", CallingConvention = CallingConvention.Cdecl)]
3278  internal static extern bool IsInterfaceVersionValid([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion);
3279  [DllImportAttribute("openvr_api", EntryPoint = "VR_GetInitToken", CallingConvention = CallingConvention.Cdecl)]
3280  internal static extern uint GetInitToken();
3281 }
3282 
3283 
3284 public enum EVREye
3285 {
3286  Eye_Left = 0,
3287  Eye_Right = 1,
3288 }
3289 public enum ETextureType
3290 {
3291  DirectX = 0,
3292  OpenGL = 1,
3293  Vulkan = 2,
3294  IOSurface = 3,
3295  DirectX12 = 4,
3296 }
3297 public enum EColorSpace
3298 {
3299  Auto = 0,
3300  Gamma = 1,
3301  Linear = 2,
3302 }
3303 public enum ETrackingResult
3304 {
3305  Uninitialized = 1,
3306  Calibrating_InProgress = 100,
3307  Calibrating_OutOfRange = 101,
3308  Running_OK = 200,
3309  Running_OutOfRange = 201,
3310 }
3311 public enum ETrackedDeviceClass
3312 {
3313  Invalid = 0,
3314  HMD = 1,
3315  Controller = 2,
3316  GenericTracker = 3,
3317  TrackingReference = 4,
3318  DisplayRedirect = 5,
3319 }
3320 public enum ETrackedControllerRole
3321 {
3322  Invalid = 0,
3323  LeftHand = 1,
3324  RightHand = 2,
3325 }
3326 public enum ETrackingUniverseOrigin
3327 {
3328  TrackingUniverseSeated = 0,
3329  TrackingUniverseStanding = 1,
3330  TrackingUniverseRawAndUncalibrated = 2,
3331 }
3332 public enum ETrackedDeviceProperty
3333 {
3334  Prop_Invalid = 0,
3335  Prop_TrackingSystemName_String = 1000,
3336  Prop_ModelNumber_String = 1001,
3337  Prop_SerialNumber_String = 1002,
3338  Prop_RenderModelName_String = 1003,
3339  Prop_WillDriftInYaw_Bool = 1004,
3340  Prop_ManufacturerName_String = 1005,
3341  Prop_TrackingFirmwareVersion_String = 1006,
3342  Prop_HardwareRevision_String = 1007,
3343  Prop_AllWirelessDongleDescriptions_String = 1008,
3344  Prop_ConnectedWirelessDongle_String = 1009,
3345  Prop_DeviceIsWireless_Bool = 1010,
3346  Prop_DeviceIsCharging_Bool = 1011,
3347  Prop_DeviceBatteryPercentage_Float = 1012,
3348  Prop_StatusDisplayTransform_Matrix34 = 1013,
3349  Prop_Firmware_UpdateAvailable_Bool = 1014,
3350  Prop_Firmware_ManualUpdate_Bool = 1015,
3351  Prop_Firmware_ManualUpdateURL_String = 1016,
3352  Prop_HardwareRevision_Uint64 = 1017,
3353  Prop_FirmwareVersion_Uint64 = 1018,
3354  Prop_FPGAVersion_Uint64 = 1019,
3355  Prop_VRCVersion_Uint64 = 1020,
3356  Prop_RadioVersion_Uint64 = 1021,
3357  Prop_DongleVersion_Uint64 = 1022,
3358  Prop_BlockServerShutdown_Bool = 1023,
3359  Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024,
3360  Prop_ContainsProximitySensor_Bool = 1025,
3361  Prop_DeviceProvidesBatteryStatus_Bool = 1026,
3362  Prop_DeviceCanPowerOff_Bool = 1027,
3363  Prop_Firmware_ProgrammingTarget_String = 1028,
3364  Prop_DeviceClass_Int32 = 1029,
3365  Prop_HasCamera_Bool = 1030,
3366  Prop_DriverVersion_String = 1031,
3367  Prop_Firmware_ForceUpdateRequired_Bool = 1032,
3368  Prop_ViveSystemButtonFixRequired_Bool = 1033,
3369  Prop_ParentDriver_Uint64 = 1034,
3370  Prop_ResourceRoot_String = 1035,
3371  Prop_RegisteredDeviceType_String = 1036,
3372  Prop_InputProfilePath_String = 1037,
3373  Prop_ReportsTimeSinceVSync_Bool = 2000,
3374  Prop_SecondsFromVsyncToPhotons_Float = 2001,
3375  Prop_DisplayFrequency_Float = 2002,
3376  Prop_UserIpdMeters_Float = 2003,
3377  Prop_CurrentUniverseId_Uint64 = 2004,
3378  Prop_PreviousUniverseId_Uint64 = 2005,
3379  Prop_DisplayFirmwareVersion_Uint64 = 2006,
3380  Prop_IsOnDesktop_Bool = 2007,
3381  Prop_DisplayMCType_Int32 = 2008,
3382  Prop_DisplayMCOffset_Float = 2009,
3383  Prop_DisplayMCScale_Float = 2010,
3384  Prop_EdidVendorID_Int32 = 2011,
3385  Prop_DisplayMCImageLeft_String = 2012,
3386  Prop_DisplayMCImageRight_String = 2013,
3387  Prop_DisplayGCBlackClamp_Float = 2014,
3388  Prop_EdidProductID_Int32 = 2015,
3389  Prop_CameraToHeadTransform_Matrix34 = 2016,
3390  Prop_DisplayGCType_Int32 = 2017,
3391  Prop_DisplayGCOffset_Float = 2018,
3392  Prop_DisplayGCScale_Float = 2019,
3393  Prop_DisplayGCPrescale_Float = 2020,
3394  Prop_DisplayGCImage_String = 2021,
3395  Prop_LensCenterLeftU_Float = 2022,
3396  Prop_LensCenterLeftV_Float = 2023,
3397  Prop_LensCenterRightU_Float = 2024,
3398  Prop_LensCenterRightV_Float = 2025,
3399  Prop_UserHeadToEyeDepthMeters_Float = 2026,
3400  Prop_CameraFirmwareVersion_Uint64 = 2027,
3401  Prop_CameraFirmwareDescription_String = 2028,
3402  Prop_DisplayFPGAVersion_Uint64 = 2029,
3403  Prop_DisplayBootloaderVersion_Uint64 = 2030,
3404  Prop_DisplayHardwareVersion_Uint64 = 2031,
3405  Prop_AudioFirmwareVersion_Uint64 = 2032,
3406  Prop_CameraCompatibilityMode_Int32 = 2033,
3407  Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034,
3408  Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035,
3409  Prop_DisplaySuppressed_Bool = 2036,
3410  Prop_DisplayAllowNightMode_Bool = 2037,
3411  Prop_DisplayMCImageWidth_Int32 = 2038,
3412  Prop_DisplayMCImageHeight_Int32 = 2039,
3413  Prop_DisplayMCImageNumChannels_Int32 = 2040,
3414  Prop_DisplayMCImageData_Binary = 2041,
3415  Prop_SecondsFromPhotonsToVblank_Float = 2042,
3416  Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043,
3417  Prop_DisplayDebugMode_Bool = 2044,
3418  Prop_GraphicsAdapterLuid_Uint64 = 2045,
3419  Prop_DriverProvidedChaperonePath_String = 2048,
3420  Prop_ExpectedTrackingReferenceCount_Int32 = 2049,
3421  Prop_ExpectedControllerCount_Int32 = 2050,
3422  Prop_NamedIconPathControllerLeftDeviceOff_String = 2051,
3423  Prop_NamedIconPathControllerRightDeviceOff_String = 2052,
3424  Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053,
3425  Prop_DoNotApplyPrediction_Bool = 2054,
3426  Prop_CameraToHeadTransforms_Matrix34_Array = 2055,
3427  Prop_DriverIsDrawingControllers_Bool = 2057,
3428  Prop_DriverRequestsApplicationPause_Bool = 2058,
3429  Prop_DriverRequestsReducedRendering_Bool = 2059,
3430  Prop_AttachedDeviceId_String = 3000,
3431  Prop_SupportedButtons_Uint64 = 3001,
3432  Prop_Axis0Type_Int32 = 3002,
3433  Prop_Axis1Type_Int32 = 3003,
3434  Prop_Axis2Type_Int32 = 3004,
3435  Prop_Axis3Type_Int32 = 3005,
3436  Prop_Axis4Type_Int32 = 3006,
3437  Prop_ControllerRoleHint_Int32 = 3007,
3438  Prop_FieldOfViewLeftDegrees_Float = 4000,
3439  Prop_FieldOfViewRightDegrees_Float = 4001,
3440  Prop_FieldOfViewTopDegrees_Float = 4002,
3441  Prop_FieldOfViewBottomDegrees_Float = 4003,
3442  Prop_TrackingRangeMinimumMeters_Float = 4004,
3443  Prop_TrackingRangeMaximumMeters_Float = 4005,
3444  Prop_ModeLabel_String = 4006,
3445  Prop_IconPathName_String = 5000,
3446  Prop_NamedIconPathDeviceOff_String = 5001,
3447  Prop_NamedIconPathDeviceSearching_String = 5002,
3448  Prop_NamedIconPathDeviceSearchingAlert_String = 5003,
3449  Prop_NamedIconPathDeviceReady_String = 5004,
3450  Prop_NamedIconPathDeviceReadyAlert_String = 5005,
3451  Prop_NamedIconPathDeviceNotReady_String = 5006,
3452  Prop_NamedIconPathDeviceStandby_String = 5007,
3453  Prop_NamedIconPathDeviceAlertLow_String = 5008,
3454  Prop_DisplayHiddenArea_Binary_Start = 5100,
3455  Prop_DisplayHiddenArea_Binary_End = 5150,
3456  Prop_ParentContainer = 5151,
3457  Prop_UserConfigPath_String = 6000,
3458  Prop_InstallPath_String = 6001,
3459  Prop_HasDisplayComponent_Bool = 6002,
3460  Prop_HasControllerComponent_Bool = 6003,
3461  Prop_HasCameraComponent_Bool = 6004,
3462  Prop_HasDriverDirectModeComponent_Bool = 6005,
3463  Prop_HasVirtualDisplayComponent_Bool = 6006,
3464  Prop_ControllerType_String = 7000,
3465  Prop_LegacyInputProfile_String = 7001,
3466  Prop_VendorSpecific_Reserved_Start = 10000,
3467  Prop_VendorSpecific_Reserved_End = 10999,
3468  Prop_TrackedDeviceProperty_Max = 1000000,
3469 }
3470 public enum ETrackedPropertyError
3471 {
3472  TrackedProp_Success = 0,
3473  TrackedProp_WrongDataType = 1,
3474  TrackedProp_WrongDeviceClass = 2,
3475  TrackedProp_BufferTooSmall = 3,
3476  TrackedProp_UnknownProperty = 4,
3477  TrackedProp_InvalidDevice = 5,
3478  TrackedProp_CouldNotContactServer = 6,
3479  TrackedProp_ValueNotProvidedByDevice = 7,
3480  TrackedProp_StringExceedsMaximumLength = 8,
3481  TrackedProp_NotYetAvailable = 9,
3482  TrackedProp_PermissionDenied = 10,
3483  TrackedProp_InvalidOperation = 11,
3484  TrackedProp_CannotWriteToWildcards = 12,
3485 }
3486 public enum EVRSubmitFlags
3487 {
3488  Submit_Default = 0,
3489  Submit_LensDistortionAlreadyApplied = 1,
3490  Submit_GlRenderBuffer = 2,
3491  Submit_Reserved = 4,
3492  Submit_TextureWithPose = 8,
3493  Submit_TextureWithDepth = 16,
3494 }
3495 public enum EVRState
3496 {
3497  Undefined = -1,
3498  Off = 0,
3499  Searching = 1,
3500  Searching_Alert = 2,
3501  Ready = 3,
3502  Ready_Alert = 4,
3503  NotReady = 5,
3504  Standby = 6,
3505  Ready_Alert_Low = 7,
3506 }
3507 public enum EVREventType
3508 {
3509  VREvent_None = 0,
3510  VREvent_TrackedDeviceActivated = 100,
3511  VREvent_TrackedDeviceDeactivated = 101,
3512  VREvent_TrackedDeviceUpdated = 102,
3513  VREvent_TrackedDeviceUserInteractionStarted = 103,
3514  VREvent_TrackedDeviceUserInteractionEnded = 104,
3515  VREvent_IpdChanged = 105,
3516  VREvent_EnterStandbyMode = 106,
3517  VREvent_LeaveStandbyMode = 107,
3518  VREvent_TrackedDeviceRoleChanged = 108,
3519  VREvent_WatchdogWakeUpRequested = 109,
3520  VREvent_LensDistortionChanged = 110,
3521  VREvent_PropertyChanged = 111,
3522  VREvent_WirelessDisconnect = 112,
3523  VREvent_WirelessReconnect = 113,
3524  VREvent_ButtonPress = 200,
3525  VREvent_ButtonUnpress = 201,
3526  VREvent_ButtonTouch = 202,
3527  VREvent_ButtonUntouch = 203,
3528  VREvent_DualAnalog_Press = 250,
3529  VREvent_DualAnalog_Unpress = 251,
3530  VREvent_DualAnalog_Touch = 252,
3531  VREvent_DualAnalog_Untouch = 253,
3532  VREvent_DualAnalog_Move = 254,
3533  VREvent_DualAnalog_ModeSwitch1 = 255,
3534  VREvent_DualAnalog_ModeSwitch2 = 256,
3535  VREvent_DualAnalog_Cancel = 257,
3536  VREvent_MouseMove = 300,
3537  VREvent_MouseButtonDown = 301,
3538  VREvent_MouseButtonUp = 302,
3539  VREvent_FocusEnter = 303,
3540  VREvent_FocusLeave = 304,
3541  VREvent_Scroll = 305,
3542  VREvent_TouchPadMove = 306,
3543  VREvent_OverlayFocusChanged = 307,
3544  VREvent_InputFocusCaptured = 400,
3545  VREvent_InputFocusReleased = 401,
3546  VREvent_SceneFocusLost = 402,
3547  VREvent_SceneFocusGained = 403,
3548  VREvent_SceneApplicationChanged = 404,
3549  VREvent_SceneFocusChanged = 405,
3550  VREvent_InputFocusChanged = 406,
3551  VREvent_SceneApplicationSecondaryRenderingStarted = 407,
3552  VREvent_HideRenderModels = 410,
3553  VREvent_ShowRenderModels = 411,
3554  VREvent_ConsoleOpened = 420,
3555  VREvent_ConsoleClosed = 421,
3556  VREvent_OverlayShown = 500,
3557  VREvent_OverlayHidden = 501,
3558  VREvent_DashboardActivated = 502,
3559  VREvent_DashboardDeactivated = 503,
3560  VREvent_DashboardThumbSelected = 504,
3561  VREvent_DashboardRequested = 505,
3562  VREvent_ResetDashboard = 506,
3563  VREvent_RenderToast = 507,
3564  VREvent_ImageLoaded = 508,
3565  VREvent_ShowKeyboard = 509,
3566  VREvent_HideKeyboard = 510,
3567  VREvent_OverlayGamepadFocusGained = 511,
3568  VREvent_OverlayGamepadFocusLost = 512,
3569  VREvent_OverlaySharedTextureChanged = 513,
3570  VREvent_DashboardGuideButtonDown = 514,
3571  VREvent_DashboardGuideButtonUp = 515,
3572  VREvent_ScreenshotTriggered = 516,
3573  VREvent_ImageFailed = 517,
3574  VREvent_DashboardOverlayCreated = 518,
3575  VREvent_RequestScreenshot = 520,
3576  VREvent_ScreenshotTaken = 521,
3577  VREvent_ScreenshotFailed = 522,
3578  VREvent_SubmitScreenshotToDashboard = 523,
3579  VREvent_ScreenshotProgressToDashboard = 524,
3580  VREvent_PrimaryDashboardDeviceChanged = 525,
3581  VREvent_Notification_Shown = 600,
3582  VREvent_Notification_Hidden = 601,
3583  VREvent_Notification_BeginInteraction = 602,
3584  VREvent_Notification_Destroyed = 603,
3585  VREvent_Quit = 700,
3586  VREvent_ProcessQuit = 701,
3587  VREvent_QuitAborted_UserPrompt = 702,
3588  VREvent_QuitAcknowledged = 703,
3589  VREvent_DriverRequestedQuit = 704,
3590  VREvent_ChaperoneDataHasChanged = 800,
3591  VREvent_ChaperoneUniverseHasChanged = 801,
3592  VREvent_ChaperoneTempDataHasChanged = 802,
3593  VREvent_ChaperoneSettingsHaveChanged = 803,
3594  VREvent_SeatedZeroPoseReset = 804,
3595  VREvent_AudioSettingsHaveChanged = 820,
3596  VREvent_BackgroundSettingHasChanged = 850,
3597  VREvent_CameraSettingsHaveChanged = 851,
3598  VREvent_ReprojectionSettingHasChanged = 852,
3599  VREvent_ModelSkinSettingsHaveChanged = 853,
3600  VREvent_EnvironmentSettingsHaveChanged = 854,
3601  VREvent_PowerSettingsHaveChanged = 855,
3602  VREvent_EnableHomeAppSettingsHaveChanged = 856,
3603  VREvent_SteamVRSectionSettingChanged = 857,
3604  VREvent_LighthouseSectionSettingChanged = 858,
3605  VREvent_NullSectionSettingChanged = 859,
3606  VREvent_UserInterfaceSectionSettingChanged = 860,
3607  VREvent_NotificationsSectionSettingChanged = 861,
3608  VREvent_KeyboardSectionSettingChanged = 862,
3609  VREvent_PerfSectionSettingChanged = 863,
3610  VREvent_DashboardSectionSettingChanged = 864,
3611  VREvent_WebInterfaceSectionSettingChanged = 865,
3612  VREvent_StatusUpdate = 900,
3613  VREvent_WebInterface_InstallDriverCompleted = 950,
3614  VREvent_MCImageUpdated = 1000,
3615  VREvent_FirmwareUpdateStarted = 1100,
3616  VREvent_FirmwareUpdateFinished = 1101,
3617  VREvent_KeyboardClosed = 1200,
3618  VREvent_KeyboardCharInput = 1201,
3619  VREvent_KeyboardDone = 1202,
3620  VREvent_ApplicationTransitionStarted = 1300,
3621  VREvent_ApplicationTransitionAborted = 1301,
3622  VREvent_ApplicationTransitionNewAppStarted = 1302,
3623  VREvent_ApplicationListUpdated = 1303,
3624  VREvent_ApplicationMimeTypeLoad = 1304,
3625  VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,
3626  VREvent_ProcessConnected = 1306,
3627  VREvent_ProcessDisconnected = 1307,
3628  VREvent_Compositor_MirrorWindowShown = 1400,
3629  VREvent_Compositor_MirrorWindowHidden = 1401,
3630  VREvent_Compositor_ChaperoneBoundsShown = 1410,
3631  VREvent_Compositor_ChaperoneBoundsHidden = 1411,
3632  VREvent_TrackedCamera_StartVideoStream = 1500,
3633  VREvent_TrackedCamera_StopVideoStream = 1501,
3634  VREvent_TrackedCamera_PauseVideoStream = 1502,
3635  VREvent_TrackedCamera_ResumeVideoStream = 1503,
3636  VREvent_TrackedCamera_EditingSurface = 1550,
3637  VREvent_PerformanceTest_EnableCapture = 1600,
3638  VREvent_PerformanceTest_DisableCapture = 1601,
3639  VREvent_PerformanceTest_FidelityLevel = 1602,
3640  VREvent_MessageOverlay_Closed = 1650,
3641  VREvent_MessageOverlayCloseRequested = 1651,
3642  VREvent_Input_HapticVibration = 1700,
3643  VREvent_VendorSpecific_Reserved_Start = 10000,
3644  VREvent_VendorSpecific_Reserved_End = 19999,
3645 }
3646 public enum EDeviceActivityLevel
3647 {
3648  k_EDeviceActivityLevel_Unknown = -1,
3649  k_EDeviceActivityLevel_Idle = 0,
3650  k_EDeviceActivityLevel_UserInteraction = 1,
3651  k_EDeviceActivityLevel_UserInteraction_Timeout = 2,
3652  k_EDeviceActivityLevel_Standby = 3,
3653 }
3654 public enum EVRButtonId
3655 {
3656  k_EButton_System = 0,
3657  k_EButton_ApplicationMenu = 1,
3658  k_EButton_Grip = 2,
3659  k_EButton_DPad_Left = 3,
3660  k_EButton_DPad_Up = 4,
3661  k_EButton_DPad_Right = 5,
3662  k_EButton_DPad_Down = 6,
3663  k_EButton_A = 7,
3664  k_EButton_ProximitySensor = 31,
3665  k_EButton_Axis0 = 32,
3666  k_EButton_Axis1 = 33,
3667  k_EButton_Axis2 = 34,
3668  k_EButton_Axis3 = 35,
3669  k_EButton_Axis4 = 36,
3670  k_EButton_SteamVR_Touchpad = 32,
3671  k_EButton_SteamVR_Trigger = 33,
3672  k_EButton_Dashboard_Back = 2,
3673  k_EButton_Max = 64,
3674 }
3675 public enum EVRMouseButton
3676 {
3677  Left = 1,
3678  Right = 2,
3679  Middle = 4,
3680 }
3681 public enum EDualAnalogWhich
3682 {
3683  k_EDualAnalog_Left = 0,
3684  k_EDualAnalog_Right = 1,
3685 }
3686 public enum EVRInputError
3687 {
3688  None = 0,
3689  NameNotFound = 1,
3690  WrongType = 2,
3691  InvalidHandle = 3,
3692  InvalidParam = 4,
3693  NoSteam = 5,
3694  MaxCapacityReached = 6,
3695  IPCError = 7,
3696  NoActiveActionSet = 8,
3697  InvalidDevice = 9,
3698 }
3699 public enum EHiddenAreaMeshType
3700 {
3701  k_eHiddenAreaMesh_Standard = 0,
3702  k_eHiddenAreaMesh_Inverse = 1,
3703  k_eHiddenAreaMesh_LineLoop = 2,
3704  k_eHiddenAreaMesh_Max = 3,
3705 }
3706 public enum EVRControllerAxisType
3707 {
3708  k_eControllerAxis_None = 0,
3709  k_eControllerAxis_TrackPad = 1,
3710  k_eControllerAxis_Joystick = 2,
3711  k_eControllerAxis_Trigger = 3,
3712 }
3713 public enum EVRControllerEventOutputType
3714 {
3715  ControllerEventOutput_OSEvents = 0,
3716  ControllerEventOutput_VREvents = 1,
3717 }
3718 public enum ECollisionBoundsStyle
3719 {
3720  COLLISION_BOUNDS_STYLE_BEGINNER = 0,
3721  COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1,
3722  COLLISION_BOUNDS_STYLE_SQUARES = 2,
3723  COLLISION_BOUNDS_STYLE_ADVANCED = 3,
3724  COLLISION_BOUNDS_STYLE_NONE = 4,
3725  COLLISION_BOUNDS_STYLE_COUNT = 5,
3726 }
3727 public enum EVROverlayError
3728 {
3729  None = 0,
3730  UnknownOverlay = 10,
3731  InvalidHandle = 11,
3732  PermissionDenied = 12,
3733  OverlayLimitExceeded = 13,
3734  WrongVisibilityType = 14,
3735  KeyTooLong = 15,
3736  NameTooLong = 16,
3737  KeyInUse = 17,
3738  WrongTransformType = 18,
3739  InvalidTrackedDevice = 19,
3740  InvalidParameter = 20,
3741  ThumbnailCantBeDestroyed = 21,
3742  ArrayTooSmall = 22,
3743  RequestFailed = 23,
3744  InvalidTexture = 24,
3745  UnableToLoadFile = 25,
3746  KeyboardAlreadyInUse = 26,
3747  NoNeighbor = 27,
3748  TooManyMaskPrimitives = 29,
3749  BadMaskPrimitive = 30,
3750  TextureAlreadyLocked = 31,
3751  TextureLockCapacityReached = 32,
3752  TextureNotLocked = 33,
3753 }
3754 public enum EVRApplicationType
3755 {
3756  VRApplication_Other = 0,
3757  VRApplication_Scene = 1,
3758  VRApplication_Overlay = 2,
3759  VRApplication_Background = 3,
3760  VRApplication_Utility = 4,
3761  VRApplication_VRMonitor = 5,
3762  VRApplication_SteamWatchdog = 6,
3763  VRApplication_Bootstrapper = 7,
3764  VRApplication_Max = 8,
3765 }
3766 public enum EVRFirmwareError
3767 {
3768  None = 0,
3769  Success = 1,
3770  Fail = 2,
3771 }
3772 public enum EVRNotificationError
3773 {
3774  OK = 0,
3775  InvalidNotificationId = 100,
3776  NotificationQueueFull = 101,
3777  InvalidOverlayHandle = 102,
3778  SystemWithUserValueAlreadyExists = 103,
3779 }
3780 public enum EVRInitError
3781 {
3782  None = 0,
3783  Unknown = 1,
3784  Init_InstallationNotFound = 100,
3785  Init_InstallationCorrupt = 101,
3786  Init_VRClientDLLNotFound = 102,
3787  Init_FileNotFound = 103,
3788  Init_FactoryNotFound = 104,
3789  Init_InterfaceNotFound = 105,
3790  Init_InvalidInterface = 106,
3791  Init_UserConfigDirectoryInvalid = 107,
3792  Init_HmdNotFound = 108,
3793  Init_NotInitialized = 109,
3794  Init_PathRegistryNotFound = 110,
3795  Init_NoConfigPath = 111,
3796  Init_NoLogPath = 112,
3797  Init_PathRegistryNotWritable = 113,
3798  Init_AppInfoInitFailed = 114,
3799  Init_Retry = 115,
3800  Init_InitCanceledByUser = 116,
3801  Init_AnotherAppLaunching = 117,
3802  Init_SettingsInitFailed = 118,
3803  Init_ShuttingDown = 119,
3804  Init_TooManyObjects = 120,
3805  Init_NoServerForBackgroundApp = 121,
3806  Init_NotSupportedWithCompositor = 122,
3807  Init_NotAvailableToUtilityApps = 123,
3808  Init_Internal = 124,
3809  Init_HmdDriverIdIsNone = 125,
3810  Init_HmdNotFoundPresenceFailed = 126,
3811  Init_VRMonitorNotFound = 127,
3812  Init_VRMonitorStartupFailed = 128,
3813  Init_LowPowerWatchdogNotSupported = 129,
3814  Init_InvalidApplicationType = 130,
3815  Init_NotAvailableToWatchdogApps = 131,
3816  Init_WatchdogDisabledInSettings = 132,
3817  Init_VRDashboardNotFound = 133,
3818  Init_VRDashboardStartupFailed = 134,
3819  Init_VRHomeNotFound = 135,
3820  Init_VRHomeStartupFailed = 136,
3821  Init_RebootingBusy = 137,
3822  Init_FirmwareUpdateBusy = 138,
3823  Init_FirmwareRecoveryBusy = 139,
3824  Init_USBServiceBusy = 140,
3825  Driver_Failed = 200,
3826  Driver_Unknown = 201,
3827  Driver_HmdUnknown = 202,
3828  Driver_NotLoaded = 203,
3829  Driver_RuntimeOutOfDate = 204,
3830  Driver_HmdInUse = 205,
3831  Driver_NotCalibrated = 206,
3832  Driver_CalibrationInvalid = 207,
3833  Driver_HmdDisplayNotFound = 208,
3834  Driver_TrackedDeviceInterfaceUnknown = 209,
3835  Driver_HmdDriverIdOutOfBounds = 211,
3836  Driver_HmdDisplayMirrored = 212,
3837  IPC_ServerInitFailed = 300,
3838  IPC_ConnectFailed = 301,
3839  IPC_SharedStateInitFailed = 302,
3840  IPC_CompositorInitFailed = 303,
3841  IPC_MutexInitFailed = 304,
3842  IPC_Failed = 305,
3843  IPC_CompositorConnectFailed = 306,
3844  IPC_CompositorInvalidConnectResponse = 307,
3845  IPC_ConnectFailedAfterMultipleAttempts = 308,
3846  Compositor_Failed = 400,
3847  Compositor_D3D11HardwareRequired = 401,
3848  Compositor_FirmwareRequiresUpdate = 402,
3849  Compositor_OverlayInitFailed = 403,
3850  Compositor_ScreenshotsInitFailed = 404,
3851  Compositor_UnableToCreateDevice = 405,
3852  VendorSpecific_UnableToConnectToOculusRuntime = 1000,
3853  VendorSpecific_WindowsNotInDevMode = 1001,
3854  VendorSpecific_HmdFound_CantOpenDevice = 1101,
3855  VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102,
3856  VendorSpecific_HmdFound_NoStoredConfig = 1103,
3857  VendorSpecific_HmdFound_ConfigTooBig = 1104,
3858  VendorSpecific_HmdFound_ConfigTooSmall = 1105,
3859  VendorSpecific_HmdFound_UnableToInitZLib = 1106,
3860  VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107,
3861  VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108,
3862  VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109,
3863  VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110,
3864  VendorSpecific_HmdFound_UserDataAddressRange = 1111,
3865  VendorSpecific_HmdFound_UserDataError = 1112,
3866  VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113,
3867  Steam_SteamInstallationNotFound = 2000,
3868 }
3869 public enum EVRScreenshotType
3870 {
3871  None = 0,
3872  Mono = 1,
3873  Stereo = 2,
3874  Cubemap = 3,
3875  MonoPanorama = 4,
3876  StereoPanorama = 5,
3877 }
3878 public enum EVRScreenshotPropertyFilenames
3879 {
3880  Preview = 0,
3881  VR = 1,
3882 }
3883 public enum EVRTrackedCameraError
3884 {
3885  None = 0,
3886  OperationFailed = 100,
3887  InvalidHandle = 101,
3888  InvalidFrameHeaderVersion = 102,
3889  OutOfHandles = 103,
3890  IPCFailure = 104,
3891  NotSupportedForThisDevice = 105,
3892  SharedMemoryFailure = 106,
3893  FrameBufferingFailure = 107,
3894  StreamSetupFailure = 108,
3895  InvalidGLTextureId = 109,
3896  InvalidSharedTextureHandle = 110,
3897  FailedToGetGLTextureId = 111,
3898  SharedTextureFailure = 112,
3899  NoFrameAvailable = 113,
3900  InvalidArgument = 114,
3901  InvalidFrameBufferSize = 115,
3902 }
3903 public enum EVRTrackedCameraFrameType
3904 {
3905  Distorted = 0,
3906  Undistorted = 1,
3907  MaximumUndistorted = 2,
3908  MAX_CAMERA_FRAME_TYPES = 3,
3909 }
3910 public enum EVRApplicationError
3911 {
3912  None = 0,
3913  AppKeyAlreadyExists = 100,
3914  NoManifest = 101,
3915  NoApplication = 102,
3916  InvalidIndex = 103,
3917  UnknownApplication = 104,
3918  IPCFailed = 105,
3919  ApplicationAlreadyRunning = 106,
3920  InvalidManifest = 107,
3921  InvalidApplication = 108,
3922  LaunchFailed = 109,
3923  ApplicationAlreadyStarting = 110,
3924  LaunchInProgress = 111,
3925  OldApplicationQuitting = 112,
3926  TransitionAborted = 113,
3927  IsTemplate = 114,
3928  SteamVRIsExiting = 115,
3929  BufferTooSmall = 200,
3930  PropertyNotSet = 201,
3931  UnknownProperty = 202,
3932  InvalidParameter = 203,
3933 }
3934 public enum EVRApplicationProperty
3935 {
3936  Name_String = 0,
3937  LaunchType_String = 11,
3938  WorkingDirectory_String = 12,
3939  BinaryPath_String = 13,
3940  Arguments_String = 14,
3941  URL_String = 15,
3942  Description_String = 50,
3943  NewsURL_String = 51,
3944  ImagePath_String = 52,
3945  Source_String = 53,
3946  ActionManifestURL_String = 54,
3947  IsDashboardOverlay_Bool = 60,
3948  IsTemplate_Bool = 61,
3949  IsInstanced_Bool = 62,
3950  IsInternal_Bool = 63,
3951  WantsCompositorPauseInStandby_Bool = 64,
3952  LastLaunchTime_Uint64 = 70,
3953 }
3954 public enum EVRApplicationTransitionState
3955 {
3956  VRApplicationTransition_None = 0,
3957  VRApplicationTransition_OldAppQuitSent = 10,
3958  VRApplicationTransition_WaitingForExternalLaunch = 11,
3959  VRApplicationTransition_NewAppLaunched = 20,
3960 }
3961 public enum ChaperoneCalibrationState
3962 {
3963  OK = 1,
3964  Warning = 100,
3965  Warning_BaseStationMayHaveMoved = 101,
3966  Warning_BaseStationRemoved = 102,
3967  Warning_SeatedBoundsInvalid = 103,
3968  Error = 200,
3969  Error_BaseStationUninitialized = 201,
3970  Error_BaseStationConflict = 202,
3971  Error_PlayAreaInvalid = 203,
3972  Error_CollisionBoundsInvalid = 204,
3973 }
3974 public enum EChaperoneConfigFile
3975 {
3976  Live = 1,
3977  Temp = 2,
3978 }
3979 public enum EChaperoneImportFlags
3980 {
3981  EChaperoneImport_BoundsOnly = 1,
3982 }
3983 public enum EVRCompositorError
3984 {
3985  None = 0,
3986  RequestFailed = 1,
3987  IncompatibleVersion = 100,
3988  DoNotHaveFocus = 101,
3989  InvalidTexture = 102,
3990  IsNotSceneApplication = 103,
3991  TextureIsOnWrongDevice = 104,
3992  TextureUsesUnsupportedFormat = 105,
3993  SharedTexturesNotSupported = 106,
3994  IndexOutOfRange = 107,
3995  AlreadySubmitted = 108,
3996  InvalidBounds = 109,
3997 }
3998 public enum EVRCompositorTimingMode
3999 {
4000  Implicit = 0,
4001  Explicit_RuntimePerformsPostPresentHandoff = 1,
4002  Explicit_ApplicationPerformsPostPresentHandoff = 2,
4003 }
4004 public enum VROverlayInputMethod
4005 {
4006  None = 0,
4007  Mouse = 1,
4008  DualAnalog = 2,
4009 }
4010 public enum VROverlayTransformType
4011 {
4012  VROverlayTransform_Absolute = 0,
4013  VROverlayTransform_TrackedDeviceRelative = 1,
4014  VROverlayTransform_SystemOverlay = 2,
4015  VROverlayTransform_TrackedComponent = 3,
4016 }
4017 public enum VROverlayFlags
4018 {
4019  None = 0,
4020  Curved = 1,
4021  RGSS4X = 2,
4022  NoDashboardTab = 3,
4023  AcceptsGamepadEvents = 4,
4024  ShowGamepadFocus = 5,
4025  SendVRScrollEvents = 6,
4026  SendVRTouchpadEvents = 7,
4027  ShowTouchPadScrollWheel = 8,
4028  TransferOwnershipToInternalProcess = 9,
4029  SideBySide_Parallel = 10,
4030  SideBySide_Crossed = 11,
4031  Panorama = 12,
4032  StereoPanorama = 13,
4033  SortWithNonSceneOverlays = 14,
4034  VisibleInDashboard = 15,
4035 }
4036 public enum VRMessageOverlayResponse
4037 {
4038  ButtonPress_0 = 0,
4039  ButtonPress_1 = 1,
4040  ButtonPress_2 = 2,
4041  ButtonPress_3 = 3,
4042  CouldntFindSystemOverlay = 4,
4043  CouldntFindOrCreateClientOverlay = 5,
4044  ApplicationQuit = 6,
4045 }
4046 public enum EGamepadTextInputMode
4047 {
4048  k_EGamepadTextInputModeNormal = 0,
4049  k_EGamepadTextInputModePassword = 1,
4050  k_EGamepadTextInputModeSubmit = 2,
4051 }
4052 public enum EGamepadTextInputLineMode
4053 {
4054  k_EGamepadTextInputLineModeSingleLine = 0,
4055  k_EGamepadTextInputLineModeMultipleLines = 1,
4056 }
4057 public enum EOverlayDirection
4058 {
4059  Up = 0,
4060  Down = 1,
4061  Left = 2,
4062  Right = 3,
4063  Count = 4,
4064 }
4065 public enum EVROverlayIntersectionMaskPrimitiveType
4066 {
4067  OverlayIntersectionPrimitiveType_Rectangle = 0,
4068  OverlayIntersectionPrimitiveType_Circle = 1,
4069 }
4070 public enum EVRRenderModelError
4071 {
4072  None = 0,
4073  Loading = 100,
4074  NotSupported = 200,
4075  InvalidArg = 300,
4076  InvalidModel = 301,
4077  NoShapes = 302,
4078  MultipleShapes = 303,
4079  TooManyVertices = 304,
4080  MultipleTextures = 305,
4081  BufferTooSmall = 306,
4082  NotEnoughNormals = 307,
4083  NotEnoughTexCoords = 308,
4084  InvalidTexture = 400,
4085 }
4086 public enum EVRComponentProperty
4087 {
4088  IsStatic = 1,
4089  IsVisible = 2,
4090  IsTouched = 4,
4091  IsPressed = 8,
4092  IsScrolled = 16,
4093 }
4094 public enum EVRNotificationType
4095 {
4096  Transient = 0,
4097  Persistent = 1,
4098  Transient_SystemWithUserValue = 2,
4099 }
4100 public enum EVRNotificationStyle
4101 {
4102  None = 0,
4103  Application = 100,
4104  Contact_Disabled = 200,
4105  Contact_Enabled = 201,
4106  Contact_Active = 202,
4107 }
4108 public enum EVRSettingsError
4109 {
4110  None = 0,
4111  IPCFailed = 1,
4112  WriteFailed = 2,
4113  ReadFailed = 3,
4114  JsonParseFailed = 4,
4115  UnsetSettingHasNoDefault = 5,
4116 }
4117 public enum EVRScreenshotError
4118 {
4119  None = 0,
4120  RequestFailed = 1,
4121  IncompatibleVersion = 100,
4122  NotFound = 101,
4123  BufferTooSmall = 102,
4124  ScreenshotAlreadyInProgress = 108,
4125 }
4126 
4127 [StructLayout(LayoutKind.Explicit)] public struct VREvent_Data_t
4128 {
4129  [FieldOffset(0)] public VREvent_Reserved_t reserved;
4130  [FieldOffset(0)] public VREvent_Controller_t controller;
4131  [FieldOffset(0)] public VREvent_Mouse_t mouse;
4132  [FieldOffset(0)] public VREvent_Scroll_t scroll;
4133  [FieldOffset(0)] public VREvent_Process_t process;
4134  [FieldOffset(0)] public VREvent_Notification_t notification;
4135  [FieldOffset(0)] public VREvent_Overlay_t overlay;
4136  [FieldOffset(0)] public VREvent_Status_t status;
4137  [FieldOffset(0)] public VREvent_Ipd_t ipd;
4138  [FieldOffset(0)] public VREvent_Chaperone_t chaperone;
4139  [FieldOffset(0)] public VREvent_PerformanceTest_t performanceTest;
4140  [FieldOffset(0)] public VREvent_TouchPadMove_t touchPadMove;
4141  [FieldOffset(0)] public VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;
4142  [FieldOffset(0)] public VREvent_Screenshot_t screenshot;
4143  [FieldOffset(0)] public VREvent_ScreenshotProgress_t screenshotProgress;
4144  [FieldOffset(0)] public VREvent_ApplicationLaunch_t applicationLaunch;
4145  [FieldOffset(0)] public VREvent_EditingCameraSurface_t cameraSurface;
4146  [FieldOffset(0)] public VREvent_MessageOverlay_t messageOverlay;
4147  [FieldOffset(0)] public VREvent_Property_t property;
4148  [FieldOffset(0)] public VREvent_DualAnalog_t dualAnalog;
4149  [FieldOffset(0)] public VREvent_HapticVibration_t hapticVibration;
4150  [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug
4151 }
4152 
4153 
4154 [StructLayout(LayoutKind.Explicit)] public struct VROverlayIntersectionMaskPrimitive_Data_t
4155 {
4156  [FieldOffset(0)] public IntersectionMaskRectangle_t m_Rectangle;
4157  [FieldOffset(0)] public IntersectionMaskCircle_t m_Circle;
4158 }
4159 
4160 [StructLayout(LayoutKind.Sequential)] public struct HmdMatrix34_t
4161 {
4162  public float m0; //float[3][4]
4163  public float m1;
4164  public float m2;
4165  public float m3;
4166  public float m4;
4167  public float m5;
4168  public float m6;
4169  public float m7;
4170  public float m8;
4171  public float m9;
4172  public float m10;
4173  public float m11;
4174 }
4175 [StructLayout(LayoutKind.Sequential)] public struct HmdMatrix44_t
4176 {
4177  public float m0; //float[4][4]
4178  public float m1;
4179  public float m2;
4180  public float m3;
4181  public float m4;
4182  public float m5;
4183  public float m6;
4184  public float m7;
4185  public float m8;
4186  public float m9;
4187  public float m10;
4188  public float m11;
4189  public float m12;
4190  public float m13;
4191  public float m14;
4192  public float m15;
4193 }
4194 [StructLayout(LayoutKind.Sequential)] public struct HmdVector3_t
4195 {
4196  public float v0; //float[3]
4197  public float v1;
4198  public float v2;
4199 }
4200 [StructLayout(LayoutKind.Sequential)] public struct HmdVector4_t
4201 {
4202  public float v0; //float[4]
4203  public float v1;
4204  public float v2;
4205  public float v3;
4206 }
4207 [StructLayout(LayoutKind.Sequential)] public struct HmdVector3d_t
4208 {
4209  public double v0; //double[3]
4210  public double v1;
4211  public double v2;
4212 }
4213 [StructLayout(LayoutKind.Sequential)] public struct HmdVector2_t
4214 {
4215  public float v0; //float[2]
4216  public float v1;
4217 }
4218 [StructLayout(LayoutKind.Sequential)] public struct HmdQuaternion_t
4219 {
4220  public double w;
4221  public double x;
4222  public double y;
4223  public double z;
4224 }
4225 [StructLayout(LayoutKind.Sequential)] public struct HmdColor_t
4226 {
4227  public float r;
4228  public float g;
4229  public float b;
4230  public float a;
4231 }
4232 [StructLayout(LayoutKind.Sequential)] public struct HmdQuad_t
4233 {
4234  public HmdVector3_t vCorners0; //HmdVector3_t[4]
4235  public HmdVector3_t vCorners1;
4236  public HmdVector3_t vCorners2;
4237  public HmdVector3_t vCorners3;
4238 }
4239 [StructLayout(LayoutKind.Sequential)] public struct HmdRect2_t
4240 {
4241  public HmdVector2_t vTopLeft;
4242  public HmdVector2_t vBottomRight;
4243 }
4244 [StructLayout(LayoutKind.Sequential)] public struct DistortionCoordinates_t
4245 {
4246  public float rfRed0; //float[2]
4247  public float rfRed1;
4248  public float rfGreen0; //float[2]
4249  public float rfGreen1;
4250  public float rfBlue0; //float[2]
4251  public float rfBlue1;
4252 }
4253 [StructLayout(LayoutKind.Sequential)] public struct Texture_t
4254 {
4255  public IntPtr handle; // void *
4256  public ETextureType eType;
4257  public EColorSpace eColorSpace;
4258 }
4259 [StructLayout(LayoutKind.Sequential)] public struct TrackedDevicePose_t
4260 {
4261  public HmdMatrix34_t mDeviceToAbsoluteTracking;
4262  public HmdVector3_t vVelocity;
4263  public HmdVector3_t vAngularVelocity;
4264  public ETrackingResult eTrackingResult;
4265  [MarshalAs(UnmanagedType.I1)]
4266  public bool bPoseIsValid;
4267  [MarshalAs(UnmanagedType.I1)]
4268  public bool bDeviceIsConnected;
4269 }
4270 [StructLayout(LayoutKind.Sequential)] public struct VRTextureBounds_t
4271 {
4272  public float uMin;
4273  public float vMin;
4274  public float uMax;
4275  public float vMax;
4276 }
4277 [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithPose_t
4278 {
4279  public HmdMatrix34_t mDeviceToAbsoluteTracking;
4280 }
4281 [StructLayout(LayoutKind.Sequential)] public struct VRTextureDepthInfo_t
4282 {
4283  public IntPtr handle; // void *
4284  public HmdMatrix44_t mProjection;
4285  public HmdVector2_t vRange;
4286 }
4287 [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithDepth_t
4288 {
4289  public VRTextureDepthInfo_t depth;
4290 }
4291 [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithPoseAndDepth_t
4292 {
4293  public VRTextureDepthInfo_t depth;
4294 }
4295 [StructLayout(LayoutKind.Sequential)] public struct VRVulkanTextureData_t
4296 {
4297  public ulong m_nImage;
4298  public IntPtr m_pDevice; // struct VkDevice_T *
4299  public IntPtr m_pPhysicalDevice; // struct VkPhysicalDevice_T *
4300  public IntPtr m_pInstance; // struct VkInstance_T *
4301  public IntPtr m_pQueue; // struct VkQueue_T *
4302  public uint m_nQueueFamilyIndex;
4303  public uint m_nWidth;
4304  public uint m_nHeight;
4305  public uint m_nFormat;
4306  public uint m_nSampleCount;
4307 }
4308 [StructLayout(LayoutKind.Sequential)] public struct D3D12TextureData_t
4309 {
4310  public IntPtr m_pResource; // struct ID3D12Resource *
4311  public IntPtr m_pCommandQueue; // struct ID3D12CommandQueue *
4312  public uint m_nNodeMask;
4313 }
4314 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Controller_t
4315 {
4316  public uint button;
4317 }
4318 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Mouse_t
4319 {
4320  public float x;
4321  public float y;
4322  public uint button;
4323 }
4324 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Scroll_t
4325 {
4326  public float xdelta;
4327  public float ydelta;
4328  public uint repeatCount;
4329 }
4330 [StructLayout(LayoutKind.Sequential)] public struct VREvent_TouchPadMove_t
4331 {
4332  [MarshalAs(UnmanagedType.I1)]
4333  public bool bFingerDown;
4334  public float flSecondsFingerDown;
4335  public float fValueXFirst;
4336  public float fValueYFirst;
4337  public float fValueXRaw;
4338  public float fValueYRaw;
4339 }
4340 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Notification_t
4341 {
4342  public ulong ulUserValue;
4343  public uint notificationId;
4344 }
4345 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Process_t
4346 {
4347  public uint pid;
4348  public uint oldPid;
4349  [MarshalAs(UnmanagedType.I1)]
4350  public bool bForced;
4351 }
4352 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Overlay_t
4353 {
4354  public ulong overlayHandle;
4355 }
4356 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Status_t
4357 {
4358  public uint statusState;
4359 }
4360 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Keyboard_t
4361 {
4362  public byte cNewInput0,cNewInput1,cNewInput2,cNewInput3,cNewInput4,cNewInput5,cNewInput6,cNewInput7;
4363  public ulong uUserValue;
4364 }
4365 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Ipd_t
4366 {
4367  public float ipdMeters;
4368 }
4369 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Chaperone_t
4370 {
4371  public ulong m_nPreviousUniverse;
4372  public ulong m_nCurrentUniverse;
4373 }
4374 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Reserved_t
4375 {
4376  public ulong reserved0;
4377  public ulong reserved1;
4378 }
4379 [StructLayout(LayoutKind.Sequential)] public struct VREvent_PerformanceTest_t
4380 {
4381  public uint m_nFidelityLevel;
4382 }
4383 [StructLayout(LayoutKind.Sequential)] public struct VREvent_SeatedZeroPoseReset_t
4384 {
4385  [MarshalAs(UnmanagedType.I1)]
4386  public bool bResetBySystemMenu;
4387 }
4388 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Screenshot_t
4389 {
4390  public uint handle;
4391  public uint type;
4392 }
4393 [StructLayout(LayoutKind.Sequential)] public struct VREvent_ScreenshotProgress_t
4394 {
4395  public float progress;
4396 }
4397 [StructLayout(LayoutKind.Sequential)] public struct VREvent_ApplicationLaunch_t
4398 {
4399  public uint pid;
4400  public uint unArgsHandle;
4401 }
4402 [StructLayout(LayoutKind.Sequential)] public struct VREvent_EditingCameraSurface_t
4403 {
4404  public ulong overlayHandle;
4405  public uint nVisualMode;
4406 }
4407 [StructLayout(LayoutKind.Sequential)] public struct VREvent_MessageOverlay_t
4408 {
4409  public uint unVRMessageOverlayResponse;
4410 }
4411 [StructLayout(LayoutKind.Sequential)] public struct VREvent_Property_t
4412 {
4413  public ulong container;
4414  public ETrackedDeviceProperty prop;
4415 }
4416 [StructLayout(LayoutKind.Sequential)] public struct VREvent_DualAnalog_t
4417 {
4418  public float x;
4419  public float y;
4420  public float transformedX;
4421  public float transformedY;
4422  public EDualAnalogWhich which;
4423 }
4424 [StructLayout(LayoutKind.Sequential)] public struct VREvent_HapticVibration_t
4425 {
4426  public ulong containerHandle;
4427  public ulong componentHandle;
4428  public float fDurationSeconds;
4429  public float fFrequency;
4430  public float fAmplitude;
4431 }
4432 [StructLayout(LayoutKind.Sequential)] public struct VREvent_t
4433 {
4434  public uint eventType;
4435  public uint trackedDeviceIndex;
4436  public float eventAgeSeconds;
4437  public VREvent_Data_t data;
4438 }
4439 // This structure is for backwards binary compatibility on Linux and OSX only
4440 [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct VREvent_t_Packed
4441 {
4442  public uint eventType;
4443  public uint trackedDeviceIndex;
4444  public float eventAgeSeconds;
4445  public VREvent_Data_t data;
4446  public VREvent_t_Packed(VREvent_t unpacked)
4447  {
4448  this.eventType = unpacked.eventType;
4449  this.trackedDeviceIndex = unpacked.trackedDeviceIndex;
4450  this.eventAgeSeconds = unpacked.eventAgeSeconds;
4451  this.data = unpacked.data;
4452  }
4453  public void Unpack(ref VREvent_t unpacked)
4454  {
4455  unpacked.eventType = this.eventType;
4456  unpacked.trackedDeviceIndex = this.trackedDeviceIndex;
4457  unpacked.eventAgeSeconds = this.eventAgeSeconds;
4458  unpacked.data = this.data;
4459  }
4460 }
4461 [StructLayout(LayoutKind.Sequential)] public struct HiddenAreaMesh_t
4462 {
4463  public IntPtr pVertexData; // const struct vr::HmdVector2_t *
4464  public uint unTriangleCount;
4465 }
4466 [StructLayout(LayoutKind.Sequential)] public struct VRControllerAxis_t
4467 {
4468  public float x;
4469  public float y;
4470 }
4471 [StructLayout(LayoutKind.Sequential)] public struct VRControllerState_t
4472 {
4473  public uint unPacketNum;
4474  public ulong ulButtonPressed;
4475  public ulong ulButtonTouched;
4476  public VRControllerAxis_t rAxis0; //VRControllerAxis_t[5]
4477  public VRControllerAxis_t rAxis1;
4478  public VRControllerAxis_t rAxis2;
4479  public VRControllerAxis_t rAxis3;
4480  public VRControllerAxis_t rAxis4;
4481 }
4482 // This structure is for backwards binary compatibility on Linux and OSX only
4483 [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct VRControllerState_t_Packed
4484 {
4485  public uint unPacketNum;
4486  public ulong ulButtonPressed;
4487  public ulong ulButtonTouched;
4488  public VRControllerAxis_t rAxis0; //VRControllerAxis_t[5]
4489  public VRControllerAxis_t rAxis1;
4490  public VRControllerAxis_t rAxis2;
4491  public VRControllerAxis_t rAxis3;
4492  public VRControllerAxis_t rAxis4;
4494  {
4495  this.unPacketNum = unpacked.unPacketNum;
4496  this.ulButtonPressed = unpacked.ulButtonPressed;
4497  this.ulButtonTouched = unpacked.ulButtonTouched;
4498  this.rAxis0 = unpacked.rAxis0;
4499  this.rAxis1 = unpacked.rAxis1;
4500  this.rAxis2 = unpacked.rAxis2;
4501  this.rAxis3 = unpacked.rAxis3;
4502  this.rAxis4 = unpacked.rAxis4;
4503  }
4504  public void Unpack(ref VRControllerState_t unpacked)
4505  {
4506  unpacked.unPacketNum = this.unPacketNum;
4507  unpacked.ulButtonPressed = this.ulButtonPressed;
4508  unpacked.ulButtonTouched = this.ulButtonTouched;
4509  unpacked.rAxis0 = this.rAxis0;
4510  unpacked.rAxis1 = this.rAxis1;
4511  unpacked.rAxis2 = this.rAxis2;
4512  unpacked.rAxis3 = this.rAxis3;
4513  unpacked.rAxis4 = this.rAxis4;
4514  }
4515 }
4516 [StructLayout(LayoutKind.Sequential)] public struct Compositor_OverlaySettings
4517 {
4518  public uint size;
4519  [MarshalAs(UnmanagedType.I1)]
4520  public bool curved;
4521  [MarshalAs(UnmanagedType.I1)]
4522  public bool antialias;
4523  public float scale;
4524  public float distance;
4525  public float alpha;
4526  public float uOffset;
4527  public float vOffset;
4528  public float uScale;
4529  public float vScale;
4530  public float gridDivs;
4531  public float gridWidth;
4532  public float gridScale;
4533  public HmdMatrix44_t transform;
4534 }
4535 [StructLayout(LayoutKind.Sequential)] public struct CameraVideoStreamFrameHeader_t
4536 {
4537  public EVRTrackedCameraFrameType eFrameType;
4538  public uint nWidth;
4539  public uint nHeight;
4540  public uint nBytesPerPixel;
4541  public uint nFrameSequence;
4542  public TrackedDevicePose_t standingTrackedDevicePose;
4543 }
4544 [StructLayout(LayoutKind.Sequential)] public struct DriverDirectMode_FrameTiming
4545 {
4546  public uint m_nSize;
4547  public uint m_nNumFramePresents;
4548  public uint m_nNumMisPresented;
4549  public uint m_nNumDroppedFrames;
4550  public uint m_nReprojectionFlags;
4551 }
4552 [StructLayout(LayoutKind.Sequential)] public struct AppOverrideKeys_t
4553 {
4554  public IntPtr pchKey; // const char *
4555  public IntPtr pchValue; // const char *
4556 }
4557 [StructLayout(LayoutKind.Sequential)] public struct Compositor_FrameTiming
4558 {
4559  public uint m_nSize;
4560  public uint m_nFrameIndex;
4561  public uint m_nNumFramePresents;
4562  public uint m_nNumMisPresented;
4563  public uint m_nNumDroppedFrames;
4564  public uint m_nReprojectionFlags;
4565  public double m_flSystemTimeInSeconds;
4566  public float m_flPreSubmitGpuMs;
4567  public float m_flPostSubmitGpuMs;
4568  public float m_flTotalRenderGpuMs;
4569  public float m_flCompositorRenderGpuMs;
4570  public float m_flCompositorRenderCpuMs;
4571  public float m_flCompositorIdleCpuMs;
4572  public float m_flClientFrameIntervalMs;
4573  public float m_flPresentCallCpuMs;
4574  public float m_flWaitForPresentCpuMs;
4575  public float m_flSubmitFrameMs;
4576  public float m_flWaitGetPosesCalledMs;
4577  public float m_flNewPosesReadyMs;
4578  public float m_flNewFrameReadyMs;
4579  public float m_flCompositorUpdateStartMs;
4580  public float m_flCompositorUpdateEndMs;
4581  public float m_flCompositorRenderStartMs;
4582  public TrackedDevicePose_t m_HmdPose;
4583 }
4584 [StructLayout(LayoutKind.Sequential)] public struct Compositor_CumulativeStats
4585 {
4586  public uint m_nPid;
4587  public uint m_nNumFramePresents;
4588  public uint m_nNumDroppedFrames;
4589  public uint m_nNumReprojectedFrames;
4590  public uint m_nNumFramePresentsOnStartup;
4591  public uint m_nNumDroppedFramesOnStartup;
4592  public uint m_nNumReprojectedFramesOnStartup;
4593  public uint m_nNumLoading;
4594  public uint m_nNumFramePresentsLoading;
4595  public uint m_nNumDroppedFramesLoading;
4596  public uint m_nNumReprojectedFramesLoading;
4597  public uint m_nNumTimedOut;
4598  public uint m_nNumFramePresentsTimedOut;
4599  public uint m_nNumDroppedFramesTimedOut;
4600  public uint m_nNumReprojectedFramesTimedOut;
4601 }
4602 [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionParams_t
4603 {
4604  public HmdVector3_t vSource;
4605  public HmdVector3_t vDirection;
4606  public ETrackingUniverseOrigin eOrigin;
4607 }
4608 [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionResults_t
4609 {
4610  public HmdVector3_t vPoint;
4611  public HmdVector3_t vNormal;
4612  public HmdVector2_t vUVs;
4613  public float fDistance;
4614 }
4615 [StructLayout(LayoutKind.Sequential)] public struct IntersectionMaskRectangle_t
4616 {
4617  public float m_flTopLeftX;
4618  public float m_flTopLeftY;
4619  public float m_flWidth;
4620  public float m_flHeight;
4621 }
4622 [StructLayout(LayoutKind.Sequential)] public struct IntersectionMaskCircle_t
4623 {
4624  public float m_flCenterX;
4625  public float m_flCenterY;
4626  public float m_flRadius;
4627 }
4628 [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionMaskPrimitive_t
4629 {
4630  public EVROverlayIntersectionMaskPrimitiveType m_nPrimitiveType;
4631  public VROverlayIntersectionMaskPrimitive_Data_t m_Primitive;
4632 }
4633 [StructLayout(LayoutKind.Sequential)] public struct RenderModel_ComponentState_t
4634 {
4635  public HmdMatrix34_t mTrackingToComponentRenderModel;
4636  public HmdMatrix34_t mTrackingToComponentLocal;
4637  public uint uProperties;
4638 }
4639 [StructLayout(LayoutKind.Sequential)] public struct RenderModel_Vertex_t
4640 {
4641  public HmdVector3_t vPosition;
4642  public HmdVector3_t vNormal;
4643  public float rfTextureCoord0; //float[2]
4644  public float rfTextureCoord1;
4645 }
4646 [StructLayout(LayoutKind.Sequential)] public struct RenderModel_TextureMap_t
4647 {
4648  public char unWidth;
4649  public char unHeight;
4650  public IntPtr rubTextureMapData; // const uint8_t *
4651 }
4652 // This structure is for backwards binary compatibility on Linux and OSX only
4653 [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_TextureMap_t_Packed
4654 {
4655  public char unWidth;
4656  public char unHeight;
4657  public IntPtr rubTextureMapData; // const uint8_t *
4659  {
4660  this.unWidth = unpacked.unWidth;
4661  this.unHeight = unpacked.unHeight;
4662  this.rubTextureMapData = unpacked.rubTextureMapData;
4663  }
4664  public void Unpack(ref RenderModel_TextureMap_t unpacked)
4665  {
4666  unpacked.unWidth = this.unWidth;
4667  unpacked.unHeight = this.unHeight;
4668  unpacked.rubTextureMapData = this.rubTextureMapData;
4669  }
4670 }
4671 [StructLayout(LayoutKind.Sequential)] public struct RenderModel_t
4672 {
4673  public IntPtr rVertexData; // const struct vr::RenderModel_Vertex_t *
4674  public uint unVertexCount;
4675  public IntPtr rIndexData; // const uint16_t *
4676  public uint unTriangleCount;
4677  public int diffuseTextureId;
4678 }
4679 // This structure is for backwards binary compatibility on Linux and OSX only
4680 [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_t_Packed
4681 {
4682  public IntPtr rVertexData; // const struct vr::RenderModel_Vertex_t *
4683  public uint unVertexCount;
4684  public IntPtr rIndexData; // const uint16_t *
4685  public uint unTriangleCount;
4686  public int diffuseTextureId;
4687  public RenderModel_t_Packed(RenderModel_t unpacked)
4688  {
4689  this.rVertexData = unpacked.rVertexData;
4690  this.unVertexCount = unpacked.unVertexCount;
4691  this.rIndexData = unpacked.rIndexData;
4692  this.unTriangleCount = unpacked.unTriangleCount;
4693  this.diffuseTextureId = unpacked.diffuseTextureId;
4694  }
4695  public void Unpack(ref RenderModel_t unpacked)
4696  {
4697  unpacked.rVertexData = this.rVertexData;
4698  unpacked.unVertexCount = this.unVertexCount;
4699  unpacked.rIndexData = this.rIndexData;
4700  unpacked.unTriangleCount = this.unTriangleCount;
4701  unpacked.diffuseTextureId = this.diffuseTextureId;
4702  }
4703 }
4704 [StructLayout(LayoutKind.Sequential)] public struct RenderModel_ControllerMode_State_t
4705 {
4706  [MarshalAs(UnmanagedType.I1)]
4707  public bool bScrollWheelVisible;
4708 }
4709 [StructLayout(LayoutKind.Sequential)] public struct NotificationBitmap_t
4710 {
4711  public IntPtr m_pImageData; // void *
4712  public int m_nWidth;
4713  public int m_nHeight;
4714  public int m_nBytesPerPixel;
4715 }
4716 [StructLayout(LayoutKind.Sequential)] public struct COpenVRContext
4717 {
4718  public IntPtr m_pVRSystem; // class vr::IVRSystem *
4719  public IntPtr m_pVRChaperone; // class vr::IVRChaperone *
4720  public IntPtr m_pVRChaperoneSetup; // class vr::IVRChaperoneSetup *
4721  public IntPtr m_pVRCompositor; // class vr::IVRCompositor *
4722  public IntPtr m_pVROverlay; // class vr::IVROverlay *
4723  public IntPtr m_pVRResources; // class vr::IVRResources *
4724  public IntPtr m_pVRRenderModels; // class vr::IVRRenderModels *
4725  public IntPtr m_pVRExtendedDisplay; // class vr::IVRExtendedDisplay *
4726  public IntPtr m_pVRSettings; // class vr::IVRSettings *
4727  public IntPtr m_pVRApplications; // class vr::IVRApplications *
4728  public IntPtr m_pVRTrackedCamera; // class vr::IVRTrackedCamera *
4729  public IntPtr m_pVRScreenshots; // class vr::IVRScreenshots *
4730  public IntPtr m_pVRDriverManager; // class vr::IVRDriverManager *
4731 }
4732 
4733 public class OpenVR
4734 {
4735 
4736  public static uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType)
4737  {
4738  return OpenVRInterop.InitInternal(ref peError, eApplicationType);
4739  }
4740 
4741  public static void ShutdownInternal()
4742  {
4743  OpenVRInterop.ShutdownInternal();
4744  }
4745 
4746  public static bool IsHmdPresent()
4747  {
4748  return OpenVRInterop.IsHmdPresent();
4749  }
4750 
4751  public static bool IsRuntimeInstalled()
4752  {
4753  return OpenVRInterop.IsRuntimeInstalled();
4754  }
4755 
4756  public static string GetStringForHmdError(EVRInitError error)
4757  {
4758  return Marshal.PtrToStringAnsi(OpenVRInterop.GetStringForHmdError(error));
4759  }
4760 
4761  public static IntPtr GetGenericInterface(string pchInterfaceVersion, ref EVRInitError peError)
4762  {
4763  return OpenVRInterop.GetGenericInterface(pchInterfaceVersion, ref peError);
4764  }
4765 
4766  public static bool IsInterfaceVersionValid(string pchInterfaceVersion)
4767  {
4768  return OpenVRInterop.IsInterfaceVersionValid(pchInterfaceVersion);
4769  }
4770 
4771  public static uint GetInitToken()
4772  {
4773  return OpenVRInterop.GetInitToken();
4774  }
4775 
4776  public const uint k_nDriverNone = 4294967295;
4777  public const uint k_unMaxDriverDebugResponseSize = 32768;
4778  public const uint k_unTrackedDeviceIndex_Hmd = 0;
4779  public const uint k_unMaxTrackedDeviceCount = 64;
4780  public const uint k_unTrackedDeviceIndexOther = 4294967294;
4781  public const uint k_unTrackedDeviceIndexInvalid = 4294967295;
4782  public const ulong k_ulInvalidPropertyContainer = 0;
4783  public const uint k_unInvalidPropertyTag = 0;
4784  public const uint k_unFloatPropertyTag = 1;
4785  public const uint k_unInt32PropertyTag = 2;
4786  public const uint k_unUint64PropertyTag = 3;
4787  public const uint k_unBoolPropertyTag = 4;
4788  public const uint k_unStringPropertyTag = 5;
4789  public const uint k_unHmdMatrix34PropertyTag = 20;
4790  public const uint k_unHmdMatrix44PropertyTag = 21;
4791  public const uint k_unHmdVector3PropertyTag = 22;
4792  public const uint k_unHmdVector4PropertyTag = 23;
4793  public const uint k_unHiddenAreaPropertyTag = 30;
4794  public const uint k_unPathHandleInfoTag = 31;
4795  public const uint k_unActionPropertyTag = 32;
4796  public const uint k_unInputValuePropertyTag = 33;
4797  public const uint k_unWildcardPropertyTag = 34;
4798  public const uint k_unHapticVibrationPropertyTag = 35;
4799  public const uint k_unOpenVRInternalReserved_Start = 1000;
4800  public const uint k_unOpenVRInternalReserved_End = 10000;
4801  public const uint k_unMaxPropertyStringSize = 32768;
4802  public const uint k_unControllerStateAxisCount = 5;
4803  public const ulong k_ulOverlayHandleInvalid = 0;
4804  public const uint k_unScreenshotHandleInvalid = 0;
4805  public const string IVRSystem_Version = "IVRSystem_019";
4806  public const string IVRExtendedDisplay_Version = "IVRExtendedDisplay_001";
4807  public const string IVRTrackedCamera_Version = "IVRTrackedCamera_003";
4808  public const uint k_unMaxApplicationKeyLength = 128;
4809  public const string k_pch_MimeType_HomeApp = "vr/home";
4810  public const string k_pch_MimeType_GameTheater = "vr/game_theater";
4811  public const string IVRApplications_Version = "IVRApplications_006";
4812  public const string IVRChaperone_Version = "IVRChaperone_003";
4813  public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_005";
4814  public const string IVRCompositor_Version = "IVRCompositor_022";
4815  public const uint k_unVROverlayMaxKeyLength = 128;
4816  public const uint k_unVROverlayMaxNameLength = 128;
4817  public const uint k_unMaxOverlayCount = 64;
4818  public const uint k_unMaxOverlayIntersectionMaskPrimitivesCount = 32;
4819  public const string IVROverlay_Version = "IVROverlay_018";
4820  public const string k_pch_Controller_Component_GDC2015 = "gdc2015";
4821  public const string k_pch_Controller_Component_Base = "base";
4822  public const string k_pch_Controller_Component_Tip = "tip";
4823  public const string k_pch_Controller_Component_HandGrip = "handgrip";
4824  public const string k_pch_Controller_Component_Status = "status";
4825  public const string IVRRenderModels_Version = "IVRRenderModels_005";
4826  public const uint k_unNotificationTextMaxSize = 256;
4827  public const string IVRNotifications_Version = "IVRNotifications_002";
4828  public const uint k_unMaxSettingsKeyLength = 128;
4829  public const string IVRSettings_Version = "IVRSettings_002";
4830  public const string k_pch_SteamVR_Section = "steamvr";
4831  public const string k_pch_SteamVR_RequireHmd_String = "requireHmd";
4832  public const string k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver";
4833  public const string k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
4834  public const string k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
4835  public const string k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
4836  public const string k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
4837  public const string k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
4838  public const string k_pch_SteamVR_SendSystemButtonToAllApps_Bool = "sendSystemButtonToAllApps";
4839  public const string k_pch_SteamVR_LogLevel_Int32 = "loglevel";
4840  public const string k_pch_SteamVR_IPD_Float = "ipd";
4841  public const string k_pch_SteamVR_Background_String = "background";
4842  public const string k_pch_SteamVR_BackgroundUseDomeProjection_Bool = "backgroundUseDomeProjection";
4843  public const string k_pch_SteamVR_BackgroundCameraHeight_Float = "backgroundCameraHeight";
4844  public const string k_pch_SteamVR_BackgroundDomeRadius_Float = "backgroundDomeRadius";
4845  public const string k_pch_SteamVR_GridColor_String = "gridColor";
4846  public const string k_pch_SteamVR_PlayAreaColor_String = "playAreaColor";
4847  public const string k_pch_SteamVR_ShowStage_Bool = "showStage";
4848  public const string k_pch_SteamVR_ActivateMultipleDrivers_Bool = "activateMultipleDrivers";
4849  public const string k_pch_SteamVR_DirectMode_Bool = "directMode";
4850  public const string k_pch_SteamVR_DirectModeEdidVid_Int32 = "directModeEdidVid";
4851  public const string k_pch_SteamVR_DirectModeEdidPid_Int32 = "directModeEdidPid";
4852  public const string k_pch_SteamVR_UsingSpeakers_Bool = "usingSpeakers";
4853  public const string k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = "speakersForwardYawOffsetDegrees";
4854  public const string k_pch_SteamVR_BaseStationPowerManagement_Bool = "basestationPowerManagement";
4855  public const string k_pch_SteamVR_NeverKillProcesses_Bool = "neverKillProcesses";
4856  public const string k_pch_SteamVR_SupersampleScale_Float = "supersampleScale";
4857  public const string k_pch_SteamVR_AllowAsyncReprojection_Bool = "allowAsyncReprojection";
4858  public const string k_pch_SteamVR_AllowReprojection_Bool = "allowInterleavedReprojection";
4859  public const string k_pch_SteamVR_ForceReprojection_Bool = "forceReprojection";
4860  public const string k_pch_SteamVR_ForceFadeOnBadTracking_Bool = "forceFadeOnBadTracking";
4861  public const string k_pch_SteamVR_DefaultMirrorView_Int32 = "defaultMirrorView";
4862  public const string k_pch_SteamVR_ShowMirrorView_Bool = "showMirrorView";
4863  public const string k_pch_SteamVR_MirrorViewGeometry_String = "mirrorViewGeometry";
4864  public const string k_pch_SteamVR_StartMonitorFromAppLaunch = "startMonitorFromAppLaunch";
4865  public const string k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = "startCompositorFromAppLaunch";
4866  public const string k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = "startDashboardFromAppLaunch";
4867  public const string k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = "startOverlayAppsFromDashboard";
4868  public const string k_pch_SteamVR_EnableHomeApp = "enableHomeApp";
4869  public const string k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBackgroundImageTimeSec";
4870  public const string k_pch_SteamVR_RetailDemo_Bool = "retailDemo";
4871  public const string k_pch_SteamVR_IpdOffset_Float = "ipdOffset";
4872  public const string k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering";
4873  public const string k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync";
4874  public const string k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode";
4875  public const string k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver";
4876  public const string k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor";
4877  public const string k_pch_Lighthouse_Section = "driver_lighthouse";
4878  public const string k_pch_Lighthouse_DisableIMU_Bool = "disableimu";
4879  public const string k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd";
4880  public const string k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation";
4881  public const string k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug";
4882  public const string k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation";
4883  public const string k_pch_Lighthouse_DBHistory_Bool = "dbhistory";
4884  public const string k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth";
4885  public const string k_pch_Null_Section = "driver_null";
4886  public const string k_pch_Null_SerialNumber_String = "serialNumber";
4887  public const string k_pch_Null_ModelNumber_String = "modelNumber";
4888  public const string k_pch_Null_WindowX_Int32 = "windowX";
4889  public const string k_pch_Null_WindowY_Int32 = "windowY";
4890  public const string k_pch_Null_WindowWidth_Int32 = "windowWidth";
4891  public const string k_pch_Null_WindowHeight_Int32 = "windowHeight";
4892  public const string k_pch_Null_RenderWidth_Int32 = "renderWidth";
4893  public const string k_pch_Null_RenderHeight_Int32 = "renderHeight";
4894  public const string k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons";
4895  public const string k_pch_Null_DisplayFrequency_Float = "displayFrequency";
4896  public const string k_pch_UserInterface_Section = "userinterface";
4897  public const string k_pch_UserInterface_StatusAlwaysOnTop_Bool = "StatusAlwaysOnTop";
4898  public const string k_pch_UserInterface_MinimizeToTray_Bool = "MinimizeToTray";
4899  public const string k_pch_UserInterface_Screenshots_Bool = "screenshots";
4900  public const string k_pch_UserInterface_ScreenshotType_Int = "screenshotType";
4901  public const string k_pch_Notifications_Section = "notifications";
4902  public const string k_pch_Notifications_DoNotDisturb_Bool = "DoNotDisturb";
4903  public const string k_pch_Keyboard_Section = "keyboard";
4904  public const string k_pch_Keyboard_TutorialCompletions = "TutorialCompletions";
4905  public const string k_pch_Keyboard_ScaleX = "ScaleX";
4906  public const string k_pch_Keyboard_ScaleY = "ScaleY";
4907  public const string k_pch_Keyboard_OffsetLeftX = "OffsetLeftX";
4908  public const string k_pch_Keyboard_OffsetRightX = "OffsetRightX";
4909  public const string k_pch_Keyboard_OffsetY = "OffsetY";
4910  public const string k_pch_Keyboard_Smoothing = "Smoothing";
4911  public const string k_pch_Perf_Section = "perfcheck";
4912  public const string k_pch_Perf_HeuristicActive_Bool = "heuristicActive";
4913  public const string k_pch_Perf_NotifyInHMD_Bool = "warnInHMD";
4914  public const string k_pch_Perf_NotifyOnlyOnce_Bool = "warnOnlyOnce";
4915  public const string k_pch_Perf_AllowTimingStore_Bool = "allowTimingStore";
4916  public const string k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit";
4917  public const string k_pch_Perf_TestData_Float = "perfTestData";
4918  public const string k_pch_Perf_LinuxGPUProfiling_Bool = "linuxGPUProfiling";
4919  public const string k_pch_CollisionBounds_Section = "collisionBounds";
4920  public const string k_pch_CollisionBounds_Style_Int32 = "CollisionBoundsStyle";
4921  public const string k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBoundsGroundPerimeterOn";
4922  public const string k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn";
4923  public const string k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn";
4924  public const string k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance";
4925  public const string k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR";
4926  public const string k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG";
4927  public const string k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB";
4928  public const string k_pch_CollisionBounds_ColorGammaA_Int32 = "CollisionBoundsColorGammaA";
4929  public const string k_pch_Camera_Section = "camera";
4930  public const string k_pch_Camera_EnableCamera_Bool = "enableCamera";
4931  public const string k_pch_Camera_EnableCameraInDashboard_Bool = "enableCameraInDashboard";
4932  public const string k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds";
4933  public const string k_pch_Camera_EnableCameraForRoomView_Bool = "enableCameraForRoomView";
4934  public const string k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR";
4935  public const string k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG";
4936  public const string k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB";
4937  public const string k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA";
4938  public const string k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength";
4939  public const string k_pch_audio_Section = "audio";
4940  public const string k_pch_audio_OnPlaybackDevice_String = "onPlaybackDevice";
4941  public const string k_pch_audio_OnRecordDevice_String = "onRecordDevice";
4942  public const string k_pch_audio_OnPlaybackMirrorDevice_String = "onPlaybackMirrorDevice";
4943  public const string k_pch_audio_OffPlaybackDevice_String = "offPlaybackDevice";
4944  public const string k_pch_audio_OffRecordDevice_String = "offRecordDevice";
4945  public const string k_pch_audio_VIVEHDMIGain = "viveHDMIGain";
4946  public const string k_pch_Power_Section = "power";
4947  public const string k_pch_Power_PowerOffOnExit_Bool = "powerOffOnExit";
4948  public const string k_pch_Power_TurnOffScreensTimeout_Float = "turnOffScreensTimeout";
4949  public const string k_pch_Power_TurnOffControllersTimeout_Float = "turnOffControllersTimeout";
4950  public const string k_pch_Power_ReturnToWatchdogTimeout_Float = "returnToWatchdogTimeout";
4951  public const string k_pch_Power_AutoLaunchSteamVROnButtonPress = "autoLaunchSteamVROnButtonPress";
4952  public const string k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositorOnStandby";
4953  public const string k_pch_Dashboard_Section = "dashboard";
4954  public const string k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard";
4955  public const string k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode";
4956  public const string k_pch_modelskin_Section = "modelskins";
4957  public const string k_pch_Driver_Enable_Bool = "enable";
4958  public const string IVRScreenshots_Version = "IVRScreenshots_001";
4959  public const string IVRResources_Version = "IVRResources_001";
4960  public const string IVRDriverManager_Version = "IVRDriverManager_001";
4961 
4962  static uint VRToken { get; set; }
4963 
4964  const string FnTable_Prefix = "FnTable:";
4965 
4966  class COpenVRContext
4967  {
4968  public COpenVRContext() { Clear(); }
4969 
4970  public void Clear()
4971  {
4972  m_pVRSystem = null;
4973  m_pVRChaperone = null;
4974  m_pVRChaperoneSetup = null;
4975  m_pVRCompositor = null;
4976  m_pVROverlay = null;
4977  m_pVRRenderModels = null;
4978  m_pVRExtendedDisplay = null;
4979  m_pVRSettings = null;
4980  m_pVRApplications = null;
4981  m_pVRScreenshots = null;
4982  m_pVRTrackedCamera = null;
4983  }
4984 
4985  void CheckClear()
4986  {
4987  if (VRToken != GetInitToken())
4988  {
4989  Clear();
4990  VRToken = GetInitToken();
4991  }
4992  }
4993 
4994  public CVRSystem VRSystem()
4995  {
4996  CheckClear();
4997  if (m_pVRSystem == null)
4998  {
4999  var eError = EVRInitError.None;
5000  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSystem_Version, ref eError);
5001  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5002  m_pVRSystem = new CVRSystem(pInterface);
5003  }
5004  return m_pVRSystem;
5005  }
5006 
5007  public CVRChaperone VRChaperone()
5008  {
5009  CheckClear();
5010  if (m_pVRChaperone == null)
5011  {
5012  var eError = EVRInitError.None;
5013  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperone_Version, ref eError);
5014  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5015  m_pVRChaperone = new CVRChaperone(pInterface);
5016  }
5017  return m_pVRChaperone;
5018  }
5019 
5020  public CVRChaperoneSetup VRChaperoneSetup()
5021  {
5022  CheckClear();
5023  if (m_pVRChaperoneSetup == null)
5024  {
5025  var eError = EVRInitError.None;
5026  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperoneSetup_Version, ref eError);
5027  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5028  m_pVRChaperoneSetup = new CVRChaperoneSetup(pInterface);
5029  }
5030  return m_pVRChaperoneSetup;
5031  }
5032 
5033  public CVRCompositor VRCompositor()
5034  {
5035  CheckClear();
5036  if (m_pVRCompositor == null)
5037  {
5038  var eError = EVRInitError.None;
5039  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRCompositor_Version, ref eError);
5040  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5041  m_pVRCompositor = new CVRCompositor(pInterface);
5042  }
5043  return m_pVRCompositor;
5044  }
5045 
5046  public CVROverlay VROverlay()
5047  {
5048  CheckClear();
5049  if (m_pVROverlay == null)
5050  {
5051  var eError = EVRInitError.None;
5052  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVROverlay_Version, ref eError);
5053  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5054  m_pVROverlay = new CVROverlay(pInterface);
5055  }
5056  return m_pVROverlay;
5057  }
5058 
5059  public CVRRenderModels VRRenderModels()
5060  {
5061  CheckClear();
5062  if (m_pVRRenderModels == null)
5063  {
5064  var eError = EVRInitError.None;
5065  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRRenderModels_Version, ref eError);
5066  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5067  m_pVRRenderModels = new CVRRenderModels(pInterface);
5068  }
5069  return m_pVRRenderModels;
5070  }
5071 
5072  public CVRExtendedDisplay VRExtendedDisplay()
5073  {
5074  CheckClear();
5075  if (m_pVRExtendedDisplay == null)
5076  {
5077  var eError = EVRInitError.None;
5078  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRExtendedDisplay_Version, ref eError);
5079  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5080  m_pVRExtendedDisplay = new CVRExtendedDisplay(pInterface);
5081  }
5082  return m_pVRExtendedDisplay;
5083  }
5084 
5085  public CVRSettings VRSettings()
5086  {
5087  CheckClear();
5088  if (m_pVRSettings == null)
5089  {
5090  var eError = EVRInitError.None;
5091  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSettings_Version, ref eError);
5092  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5093  m_pVRSettings = new CVRSettings(pInterface);
5094  }
5095  return m_pVRSettings;
5096  }
5097 
5098  public CVRApplications VRApplications()
5099  {
5100  CheckClear();
5101  if (m_pVRApplications == null)
5102  {
5103  var eError = EVRInitError.None;
5104  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRApplications_Version, ref eError);
5105  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5106  m_pVRApplications = new CVRApplications(pInterface);
5107  }
5108  return m_pVRApplications;
5109  }
5110 
5111  public CVRScreenshots VRScreenshots()
5112  {
5113  CheckClear();
5114  if (m_pVRScreenshots == null)
5115  {
5116  var eError = EVRInitError.None;
5117  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRScreenshots_Version, ref eError);
5118  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5119  m_pVRScreenshots = new CVRScreenshots(pInterface);
5120  }
5121  return m_pVRScreenshots;
5122  }
5123 
5124  public CVRTrackedCamera VRTrackedCamera()
5125  {
5126  CheckClear();
5127  if (m_pVRTrackedCamera == null)
5128  {
5129  var eError = EVRInitError.None;
5130  var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRTrackedCamera_Version, ref eError);
5131  if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
5132  m_pVRTrackedCamera = new CVRTrackedCamera(pInterface);
5133  }
5134  return m_pVRTrackedCamera;
5135  }
5136 
5137  private CVRSystem m_pVRSystem;
5138  private CVRChaperone m_pVRChaperone;
5139  private CVRChaperoneSetup m_pVRChaperoneSetup;
5140  private CVRCompositor m_pVRCompositor;
5141  private CVROverlay m_pVROverlay;
5142  private CVRRenderModels m_pVRRenderModels;
5143  private CVRExtendedDisplay m_pVRExtendedDisplay;
5144  private CVRSettings m_pVRSettings;
5145  private CVRApplications m_pVRApplications;
5146  private CVRScreenshots m_pVRScreenshots;
5147  private CVRTrackedCamera m_pVRTrackedCamera;
5148  };
5149 
5150  private static COpenVRContext _OpenVRInternal_ModuleContext = null;
5151  static COpenVRContext OpenVRInternal_ModuleContext
5152  {
5153  get
5154  {
5155  if (_OpenVRInternal_ModuleContext == null)
5156  _OpenVRInternal_ModuleContext = new COpenVRContext();
5157  return _OpenVRInternal_ModuleContext;
5158  }
5159  }
5160 
5161  public static CVRSystem System { get { return OpenVRInternal_ModuleContext.VRSystem(); } }
5162  public static CVRChaperone Chaperone { get { return OpenVRInternal_ModuleContext.VRChaperone(); } }
5163  public static CVRChaperoneSetup ChaperoneSetup { get { return OpenVRInternal_ModuleContext.VRChaperoneSetup(); } }
5164  public static CVRCompositor Compositor { get { return OpenVRInternal_ModuleContext.VRCompositor(); } }
5165  public static CVROverlay Overlay { get { return OpenVRInternal_ModuleContext.VROverlay(); } }
5166  public static CVRRenderModels RenderModels { get { return OpenVRInternal_ModuleContext.VRRenderModels(); } }
5167  public static CVRExtendedDisplay ExtendedDisplay { get { return OpenVRInternal_ModuleContext.VRExtendedDisplay(); } }
5168  public static CVRSettings Settings { get { return OpenVRInternal_ModuleContext.VRSettings(); } }
5169  public static CVRApplications Applications { get { return OpenVRInternal_ModuleContext.VRApplications(); } }
5170  public static CVRScreenshots Screenshots { get { return OpenVRInternal_ModuleContext.VRScreenshots(); } }
5171  public static CVRTrackedCamera TrackedCamera { get { return OpenVRInternal_ModuleContext.VRTrackedCamera(); } }
5172 
5174  public static CVRSystem Init(ref EVRInitError peError, EVRApplicationType eApplicationType = EVRApplicationType.VRApplication_Scene)
5175  {
5176  VRToken = InitInternal(ref peError, eApplicationType);
5177  OpenVRInternal_ModuleContext.Clear();
5178 
5179  if (peError != EVRInitError.None)
5180  return null;
5181 
5182  bool bInterfaceValid = IsInterfaceVersionValid(IVRSystem_Version);
5183  if (!bInterfaceValid)
5184  {
5185  ShutdownInternal();
5186  peError = EVRInitError.Init_InterfaceNotFound;
5187  return null;
5188  }
5189 
5190  return OpenVR.System;
5191  }
5192 
5195  public static void Shutdown()
5196  {
5197  ShutdownInternal();
5198  }
5199 
5200 }
5201 
5202 
5203 
5204 }
5205 
static CVRSystem Init(ref EVRInitError peError, EVRApplicationType eApplicationType=EVRApplicationType.VRApplication_Scene)
Definition: openvr_api.cs:5174
static void Shutdown()
Definition: openvr_api.cs:5195