[WebVR] Add OpenVR to the tree and to the build
[WebKit-https.git] / Source / ThirdParty / openvr / headers / 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 bool _IsDisplayOnDesktop();
60        [MarshalAs(UnmanagedType.FunctionPtr)]
61        internal _IsDisplayOnDesktop IsDisplayOnDesktop;
62
63        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
64        internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop);
65        [MarshalAs(UnmanagedType.FunctionPtr)]
66        internal _SetDisplayVisibility SetDisplayVisibility;
67
68        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
69        internal delegate void _GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, [In, Out] TrackedDevicePose_t[] pTrackedDevicePoseArray, uint unTrackedDevicePoseArrayCount);
70        [MarshalAs(UnmanagedType.FunctionPtr)]
71        internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose;
72
73        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
74        internal delegate void _ResetSeatedZeroPose();
75        [MarshalAs(UnmanagedType.FunctionPtr)]
76        internal _ResetSeatedZeroPose ResetSeatedZeroPose;
77
78        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79        internal delegate HmdMatrix34_t _GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
80        [MarshalAs(UnmanagedType.FunctionPtr)]
81        internal _GetSeatedZeroPoseToStandingAbsoluteTrackingPose GetSeatedZeroPoseToStandingAbsoluteTrackingPose;
82
83        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84        internal delegate HmdMatrix34_t _GetRawZeroPoseToStandingAbsoluteTrackingPose();
85        [MarshalAs(UnmanagedType.FunctionPtr)]
86        internal _GetRawZeroPoseToStandingAbsoluteTrackingPose GetRawZeroPoseToStandingAbsoluteTrackingPose;
87
88        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89        internal delegate uint _GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass, [In, Out] uint[] punTrackedDeviceIndexArray, uint unTrackedDeviceIndexArrayCount, uint unRelativeToTrackedDeviceIndex);
90        [MarshalAs(UnmanagedType.FunctionPtr)]
91        internal _GetSortedTrackedDeviceIndicesOfClass GetSortedTrackedDeviceIndicesOfClass;
92
93        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
94        internal delegate EDeviceActivityLevel _GetTrackedDeviceActivityLevel(uint unDeviceId);
95        [MarshalAs(UnmanagedType.FunctionPtr)]
96        internal _GetTrackedDeviceActivityLevel GetTrackedDeviceActivityLevel;
97
98        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
99        internal delegate void _ApplyTransform(ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pTrackedDevicePose, ref HmdMatrix34_t pTransform);
100        [MarshalAs(UnmanagedType.FunctionPtr)]
101        internal _ApplyTransform ApplyTransform;
102
103        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
104        internal delegate uint _GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType);
105        [MarshalAs(UnmanagedType.FunctionPtr)]
106        internal _GetTrackedDeviceIndexForControllerRole GetTrackedDeviceIndexForControllerRole;
107
108        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109        internal delegate ETrackedControllerRole _GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex);
110        [MarshalAs(UnmanagedType.FunctionPtr)]
111        internal _GetControllerRoleForTrackedDeviceIndex GetControllerRoleForTrackedDeviceIndex;
112
113        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
114        internal delegate ETrackedDeviceClass _GetTrackedDeviceClass(uint unDeviceIndex);
115        [MarshalAs(UnmanagedType.FunctionPtr)]
116        internal _GetTrackedDeviceClass GetTrackedDeviceClass;
117
118        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
119        internal delegate bool _IsTrackedDeviceConnected(uint unDeviceIndex);
120        [MarshalAs(UnmanagedType.FunctionPtr)]
121        internal _IsTrackedDeviceConnected IsTrackedDeviceConnected;
122
123        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124        internal delegate bool _GetBoolTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
125        [MarshalAs(UnmanagedType.FunctionPtr)]
126        internal _GetBoolTrackedDeviceProperty GetBoolTrackedDeviceProperty;
127
128        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
129        internal delegate float _GetFloatTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
130        [MarshalAs(UnmanagedType.FunctionPtr)]
131        internal _GetFloatTrackedDeviceProperty GetFloatTrackedDeviceProperty;
132
133        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
134        internal delegate int _GetInt32TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
135        [MarshalAs(UnmanagedType.FunctionPtr)]
136        internal _GetInt32TrackedDeviceProperty GetInt32TrackedDeviceProperty;
137
138        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
139        internal delegate ulong _GetUint64TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
140        [MarshalAs(UnmanagedType.FunctionPtr)]
141        internal _GetUint64TrackedDeviceProperty GetUint64TrackedDeviceProperty;
142
143        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
144        internal delegate HmdMatrix34_t _GetMatrix34TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
145        [MarshalAs(UnmanagedType.FunctionPtr)]
146        internal _GetMatrix34TrackedDeviceProperty GetMatrix34TrackedDeviceProperty;
147
148        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
149        internal delegate uint _GetStringTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, System.Text.StringBuilder pchValue, uint unBufferSize, ref ETrackedPropertyError pError);
150        [MarshalAs(UnmanagedType.FunctionPtr)]
151        internal _GetStringTrackedDeviceProperty GetStringTrackedDeviceProperty;
152
153        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
154        internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);
155        [MarshalAs(UnmanagedType.FunctionPtr)]
156        internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;
157
158        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
159        internal delegate bool _PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent);
160        [MarshalAs(UnmanagedType.FunctionPtr)]
161        internal _PollNextEvent PollNextEvent;
162
163        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
164        internal delegate bool _PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose);
165        [MarshalAs(UnmanagedType.FunctionPtr)]
166        internal _PollNextEventWithPose PollNextEventWithPose;
167
168        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
169        internal delegate IntPtr _GetEventTypeNameFromEnum(EVREventType eType);
170        [MarshalAs(UnmanagedType.FunctionPtr)]
171        internal _GetEventTypeNameFromEnum GetEventTypeNameFromEnum;
172
173        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
174        internal delegate HiddenAreaMesh_t _GetHiddenAreaMesh(EVREye eEye, EHiddenAreaMeshType type);
175        [MarshalAs(UnmanagedType.FunctionPtr)]
176        internal _GetHiddenAreaMesh GetHiddenAreaMesh;
177
178        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
179        internal delegate bool _GetControllerState(uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize);
180        [MarshalAs(UnmanagedType.FunctionPtr)]
181        internal _GetControllerState GetControllerState;
182
183        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
184        internal delegate bool _GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin, uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize, ref TrackedDevicePose_t pTrackedDevicePose);
185        [MarshalAs(UnmanagedType.FunctionPtr)]
186        internal _GetControllerStateWithPose GetControllerStateWithPose;
187
188        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
189        internal delegate void _TriggerHapticPulse(uint unControllerDeviceIndex, uint unAxisId, char usDurationMicroSec);
190        [MarshalAs(UnmanagedType.FunctionPtr)]
191        internal _TriggerHapticPulse TriggerHapticPulse;
192
193        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
194        internal delegate IntPtr _GetButtonIdNameFromEnum(EVRButtonId eButtonId);
195        [MarshalAs(UnmanagedType.FunctionPtr)]
196        internal _GetButtonIdNameFromEnum GetButtonIdNameFromEnum;
197
198        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
199        internal delegate IntPtr _GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType);
200        [MarshalAs(UnmanagedType.FunctionPtr)]
201        internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum;
202
203        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
204        internal delegate bool _CaptureInputFocus();
205        [MarshalAs(UnmanagedType.FunctionPtr)]
206        internal _CaptureInputFocus CaptureInputFocus;
207
208        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
209        internal delegate void _ReleaseInputFocus();
210        [MarshalAs(UnmanagedType.FunctionPtr)]
211        internal _ReleaseInputFocus ReleaseInputFocus;
212
213        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
214        internal delegate bool _IsInputFocusCapturedByAnotherProcess();
215        [MarshalAs(UnmanagedType.FunctionPtr)]
216        internal _IsInputFocusCapturedByAnotherProcess IsInputFocusCapturedByAnotherProcess;
217
218        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
219        internal delegate uint _DriverDebugRequest(uint unDeviceIndex, string pchRequest, string pchResponseBuffer, uint unResponseBufferSize);
220        [MarshalAs(UnmanagedType.FunctionPtr)]
221        internal _DriverDebugRequest DriverDebugRequest;
222
223        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
224        internal delegate EVRFirmwareError _PerformFirmwareUpdate(uint unDeviceIndex);
225        [MarshalAs(UnmanagedType.FunctionPtr)]
226        internal _PerformFirmwareUpdate PerformFirmwareUpdate;
227
228        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
229        internal delegate void _AcknowledgeQuit_Exiting();
230        [MarshalAs(UnmanagedType.FunctionPtr)]
231        internal _AcknowledgeQuit_Exiting AcknowledgeQuit_Exiting;
232
233        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
234        internal delegate void _AcknowledgeQuit_UserPrompt();
235        [MarshalAs(UnmanagedType.FunctionPtr)]
236        internal _AcknowledgeQuit_UserPrompt AcknowledgeQuit_UserPrompt;
237
238 }
239
240 [StructLayout(LayoutKind.Sequential)]
241 public struct IVRExtendedDisplay
242 {
243        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
244        internal delegate void _GetWindowBounds(ref int pnX, ref int pnY, ref uint pnWidth, ref uint pnHeight);
245        [MarshalAs(UnmanagedType.FunctionPtr)]
246        internal _GetWindowBounds GetWindowBounds;
247
248        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
249        internal delegate void _GetEyeOutputViewport(EVREye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
250        [MarshalAs(UnmanagedType.FunctionPtr)]
251        internal _GetEyeOutputViewport GetEyeOutputViewport;
252
253        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
254        internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex, ref int pnAdapterOutputIndex);
255        [MarshalAs(UnmanagedType.FunctionPtr)]
256        internal _GetDXGIOutputInfo GetDXGIOutputInfo;
257
258 }
259
260 [StructLayout(LayoutKind.Sequential)]
261 public struct IVRTrackedCamera
262 {
263        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
264        internal delegate IntPtr _GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError);
265        [MarshalAs(UnmanagedType.FunctionPtr)]
266        internal _GetCameraErrorNameFromEnum GetCameraErrorNameFromEnum;
267
268        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
269        internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, ref bool pHasCamera);
270        [MarshalAs(UnmanagedType.FunctionPtr)]
271        internal _HasCamera HasCamera;
272
273        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
274        internal delegate EVRTrackedCameraError _GetCameraFrameSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref uint pnWidth, ref uint pnHeight, ref uint pnFrameBufferSize);
275        [MarshalAs(UnmanagedType.FunctionPtr)]
276        internal _GetCameraFrameSize GetCameraFrameSize;
277
278        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
279        internal delegate EVRTrackedCameraError _GetCameraIntrinsics(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter);
280        [MarshalAs(UnmanagedType.FunctionPtr)]
281        internal _GetCameraIntrinsics GetCameraIntrinsics;
282
283        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
284        internal delegate EVRTrackedCameraError _GetCameraProjection(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, ref HmdMatrix44_t pProjection);
285        [MarshalAs(UnmanagedType.FunctionPtr)]
286        internal _GetCameraProjection GetCameraProjection;
287
288        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
289        internal delegate EVRTrackedCameraError _AcquireVideoStreamingService(uint nDeviceIndex, ref ulong pHandle);
290        [MarshalAs(UnmanagedType.FunctionPtr)]
291        internal _AcquireVideoStreamingService AcquireVideoStreamingService;
292
293        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
294        internal delegate EVRTrackedCameraError _ReleaseVideoStreamingService(ulong hTrackedCamera);
295        [MarshalAs(UnmanagedType.FunctionPtr)]
296        internal _ReleaseVideoStreamingService ReleaseVideoStreamingService;
297
298        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
299        internal delegate EVRTrackedCameraError _GetVideoStreamFrameBuffer(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pFrameBuffer, uint nFrameBufferSize, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
300        [MarshalAs(UnmanagedType.FunctionPtr)]
301        internal _GetVideoStreamFrameBuffer GetVideoStreamFrameBuffer;
302
303        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
304        internal delegate EVRTrackedCameraError _GetVideoStreamTextureSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref VRTextureBounds_t pTextureBounds, ref uint pnWidth, ref uint pnHeight);
305        [MarshalAs(UnmanagedType.FunctionPtr)]
306        internal _GetVideoStreamTextureSize GetVideoStreamTextureSize;
307
308        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
309        internal delegate EVRTrackedCameraError _GetVideoStreamTextureD3D11(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
310        [MarshalAs(UnmanagedType.FunctionPtr)]
311        internal _GetVideoStreamTextureD3D11 GetVideoStreamTextureD3D11;
312
313        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
314        internal delegate EVRTrackedCameraError _GetVideoStreamTextureGL(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, ref uint pglTextureId, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
315        [MarshalAs(UnmanagedType.FunctionPtr)]
316        internal _GetVideoStreamTextureGL GetVideoStreamTextureGL;
317
318        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
319        internal delegate EVRTrackedCameraError _ReleaseVideoStreamTextureGL(ulong hTrackedCamera, uint glTextureId);
320        [MarshalAs(UnmanagedType.FunctionPtr)]
321        internal _ReleaseVideoStreamTextureGL ReleaseVideoStreamTextureGL;
322
323 }
324
325 [StructLayout(LayoutKind.Sequential)]
326 public struct IVRApplications
327 {
328        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
329        internal delegate EVRApplicationError _AddApplicationManifest(string pchApplicationManifestFullPath, bool bTemporary);
330        [MarshalAs(UnmanagedType.FunctionPtr)]
331        internal _AddApplicationManifest AddApplicationManifest;
332
333        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
334        internal delegate EVRApplicationError _RemoveApplicationManifest(string pchApplicationManifestFullPath);
335        [MarshalAs(UnmanagedType.FunctionPtr)]
336        internal _RemoveApplicationManifest RemoveApplicationManifest;
337
338        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
339        internal delegate bool _IsApplicationInstalled(string pchAppKey);
340        [MarshalAs(UnmanagedType.FunctionPtr)]
341        internal _IsApplicationInstalled IsApplicationInstalled;
342
343        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
344        internal delegate uint _GetApplicationCount();
345        [MarshalAs(UnmanagedType.FunctionPtr)]
346        internal _GetApplicationCount GetApplicationCount;
347
348        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
349        internal delegate EVRApplicationError _GetApplicationKeyByIndex(uint unApplicationIndex, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
350        [MarshalAs(UnmanagedType.FunctionPtr)]
351        internal _GetApplicationKeyByIndex GetApplicationKeyByIndex;
352
353        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
354        internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, string pchAppKeyBuffer, uint unAppKeyBufferLen);
355        [MarshalAs(UnmanagedType.FunctionPtr)]
356        internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId;
357
358        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
359        internal delegate EVRApplicationError _LaunchApplication(string pchAppKey);
360        [MarshalAs(UnmanagedType.FunctionPtr)]
361        internal _LaunchApplication LaunchApplication;
362
363        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
364        internal delegate EVRApplicationError _LaunchTemplateApplication(string pchTemplateAppKey, string pchNewAppKey, [In, Out] AppOverrideKeys_t[] pKeys, uint unKeys);
365        [MarshalAs(UnmanagedType.FunctionPtr)]
366        internal _LaunchTemplateApplication LaunchTemplateApplication;
367
368        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
369        internal delegate EVRApplicationError _LaunchApplicationFromMimeType(string pchMimeType, string pchArgs);
370        [MarshalAs(UnmanagedType.FunctionPtr)]
371        internal _LaunchApplicationFromMimeType LaunchApplicationFromMimeType;
372
373        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
374        internal delegate EVRApplicationError _LaunchDashboardOverlay(string pchAppKey);
375        [MarshalAs(UnmanagedType.FunctionPtr)]
376        internal _LaunchDashboardOverlay LaunchDashboardOverlay;
377
378        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
379        internal delegate bool _CancelApplicationLaunch(string pchAppKey);
380        [MarshalAs(UnmanagedType.FunctionPtr)]
381        internal _CancelApplicationLaunch CancelApplicationLaunch;
382
383        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
384        internal delegate EVRApplicationError _IdentifyApplication(uint unProcessId, string pchAppKey);
385        [MarshalAs(UnmanagedType.FunctionPtr)]
386        internal _IdentifyApplication IdentifyApplication;
387
388        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
389        internal delegate uint _GetApplicationProcessId(string pchAppKey);
390        [MarshalAs(UnmanagedType.FunctionPtr)]
391        internal _GetApplicationProcessId GetApplicationProcessId;
392
393        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
394        internal delegate IntPtr _GetApplicationsErrorNameFromEnum(EVRApplicationError error);
395        [MarshalAs(UnmanagedType.FunctionPtr)]
396        internal _GetApplicationsErrorNameFromEnum GetApplicationsErrorNameFromEnum;
397
398        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
399        internal delegate uint _GetApplicationPropertyString(string pchAppKey, EVRApplicationProperty eProperty, System.Text.StringBuilder pchPropertyValueBuffer, uint unPropertyValueBufferLen, ref EVRApplicationError peError);
400        [MarshalAs(UnmanagedType.FunctionPtr)]
401        internal _GetApplicationPropertyString GetApplicationPropertyString;
402
403        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
404        internal delegate bool _GetApplicationPropertyBool(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
405        [MarshalAs(UnmanagedType.FunctionPtr)]
406        internal _GetApplicationPropertyBool GetApplicationPropertyBool;
407
408        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
409        internal delegate ulong _GetApplicationPropertyUint64(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
410        [MarshalAs(UnmanagedType.FunctionPtr)]
411        internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64;
412
413        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
414        internal delegate EVRApplicationError _SetApplicationAutoLaunch(string pchAppKey, bool bAutoLaunch);
415        [MarshalAs(UnmanagedType.FunctionPtr)]
416        internal _SetApplicationAutoLaunch SetApplicationAutoLaunch;
417
418        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
419        internal delegate bool _GetApplicationAutoLaunch(string pchAppKey);
420        [MarshalAs(UnmanagedType.FunctionPtr)]
421        internal _GetApplicationAutoLaunch GetApplicationAutoLaunch;
422
423        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
424        internal delegate EVRApplicationError _SetDefaultApplicationForMimeType(string pchAppKey, string pchMimeType);
425        [MarshalAs(UnmanagedType.FunctionPtr)]
426        internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType;
427
428        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
429        internal delegate bool _GetDefaultApplicationForMimeType(string pchMimeType, string pchAppKeyBuffer, uint unAppKeyBufferLen);
430        [MarshalAs(UnmanagedType.FunctionPtr)]
431        internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType;
432
433        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
434        internal delegate bool _GetApplicationSupportedMimeTypes(string pchAppKey, string pchMimeTypesBuffer, uint unMimeTypesBuffer);
435        [MarshalAs(UnmanagedType.FunctionPtr)]
436        internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes;
437
438        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
439        internal delegate uint _GetApplicationsThatSupportMimeType(string pchMimeType, string pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer);
440        [MarshalAs(UnmanagedType.FunctionPtr)]
441        internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType;
442
443        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
444        internal delegate uint _GetApplicationLaunchArguments(uint unHandle, string pchArgs, uint unArgs);
445        [MarshalAs(UnmanagedType.FunctionPtr)]
446        internal _GetApplicationLaunchArguments GetApplicationLaunchArguments;
447
448        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
449        internal delegate EVRApplicationError _GetStartingApplication(string pchAppKeyBuffer, uint unAppKeyBufferLen);
450        [MarshalAs(UnmanagedType.FunctionPtr)]
451        internal _GetStartingApplication GetStartingApplication;
452
453        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
454        internal delegate EVRApplicationTransitionState _GetTransitionState();
455        [MarshalAs(UnmanagedType.FunctionPtr)]
456        internal _GetTransitionState GetTransitionState;
457
458        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
459        internal delegate EVRApplicationError _PerformApplicationPrelaunchCheck(string pchAppKey);
460        [MarshalAs(UnmanagedType.FunctionPtr)]
461        internal _PerformApplicationPrelaunchCheck PerformApplicationPrelaunchCheck;
462
463        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
464        internal delegate IntPtr _GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state);
465        [MarshalAs(UnmanagedType.FunctionPtr)]
466        internal _GetApplicationsTransitionStateNameFromEnum GetApplicationsTransitionStateNameFromEnum;
467
468        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
469        internal delegate bool _IsQuitUserPromptRequested();
470        [MarshalAs(UnmanagedType.FunctionPtr)]
471        internal _IsQuitUserPromptRequested IsQuitUserPromptRequested;
472
473        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
474        internal delegate EVRApplicationError _LaunchInternalProcess(string pchBinaryPath, string pchArguments, string pchWorkingDirectory);
475        [MarshalAs(UnmanagedType.FunctionPtr)]
476        internal _LaunchInternalProcess LaunchInternalProcess;
477
478        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
479        internal delegate uint _GetCurrentSceneProcessId();
480        [MarshalAs(UnmanagedType.FunctionPtr)]
481        internal _GetCurrentSceneProcessId GetCurrentSceneProcessId;
482
483 }
484
485 [StructLayout(LayoutKind.Sequential)]
486 public struct IVRChaperone
487 {
488        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
489        internal delegate ChaperoneCalibrationState _GetCalibrationState();
490        [MarshalAs(UnmanagedType.FunctionPtr)]
491        internal _GetCalibrationState GetCalibrationState;
492
493        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
494        internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ);
495        [MarshalAs(UnmanagedType.FunctionPtr)]
496        internal _GetPlayAreaSize GetPlayAreaSize;
497
498        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
499        internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect);
500        [MarshalAs(UnmanagedType.FunctionPtr)]
501        internal _GetPlayAreaRect GetPlayAreaRect;
502
503        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
504        internal delegate void _ReloadInfo();
505        [MarshalAs(UnmanagedType.FunctionPtr)]
506        internal _ReloadInfo ReloadInfo;
507
508        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
509        internal delegate void _SetSceneColor(HmdColor_t color);
510        [MarshalAs(UnmanagedType.FunctionPtr)]
511        internal _SetSceneColor SetSceneColor;
512
513        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
514        internal delegate void _GetBoundsColor(ref HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, ref HmdColor_t pOutputCameraColor);
515        [MarshalAs(UnmanagedType.FunctionPtr)]
516        internal _GetBoundsColor GetBoundsColor;
517
518        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
519        internal delegate bool _AreBoundsVisible();
520        [MarshalAs(UnmanagedType.FunctionPtr)]
521        internal _AreBoundsVisible AreBoundsVisible;
522
523        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
524        internal delegate void _ForceBoundsVisible(bool bForce);
525        [MarshalAs(UnmanagedType.FunctionPtr)]
526        internal _ForceBoundsVisible ForceBoundsVisible;
527
528 }
529
530 [StructLayout(LayoutKind.Sequential)]
531 public struct IVRChaperoneSetup
532 {
533        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
534        internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile);
535        [MarshalAs(UnmanagedType.FunctionPtr)]
536        internal _CommitWorkingCopy CommitWorkingCopy;
537
538        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
539        internal delegate void _RevertWorkingCopy();
540        [MarshalAs(UnmanagedType.FunctionPtr)]
541        internal _RevertWorkingCopy RevertWorkingCopy;
542
543        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
544        internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ);
545        [MarshalAs(UnmanagedType.FunctionPtr)]
546        internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize;
547
548        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
549        internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect);
550        [MarshalAs(UnmanagedType.FunctionPtr)]
551        internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect;
552
553        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
554        internal delegate bool _GetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
555        [MarshalAs(UnmanagedType.FunctionPtr)]
556        internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo;
557
558        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
559        internal delegate bool _GetLiveCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
560        [MarshalAs(UnmanagedType.FunctionPtr)]
561        internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo;
562
563        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
564        internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
565        [MarshalAs(UnmanagedType.FunctionPtr)]
566        internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose;
567
568        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
569        internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);
570        [MarshalAs(UnmanagedType.FunctionPtr)]
571        internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose;
572
573        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
574        internal delegate void _SetWorkingPlayAreaSize(float sizeX, float sizeZ);
575        [MarshalAs(UnmanagedType.FunctionPtr)]
576        internal _SetWorkingPlayAreaSize SetWorkingPlayAreaSize;
577
578        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
579        internal delegate void _SetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
580        [MarshalAs(UnmanagedType.FunctionPtr)]
581        internal _SetWorkingCollisionBoundsInfo SetWorkingCollisionBoundsInfo;
582
583        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
584        internal delegate void _SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);
585        [MarshalAs(UnmanagedType.FunctionPtr)]
586        internal _SetWorkingSeatedZeroPoseToRawTrackingPose SetWorkingSeatedZeroPoseToRawTrackingPose;
587
588        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
589        internal delegate void _SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
590        [MarshalAs(UnmanagedType.FunctionPtr)]
591        internal _SetWorkingStandingZeroPoseToRawTrackingPose SetWorkingStandingZeroPoseToRawTrackingPose;
592
593        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
594        internal delegate void _ReloadFromDisk(EChaperoneConfigFile configFile);
595        [MarshalAs(UnmanagedType.FunctionPtr)]
596        internal _ReloadFromDisk ReloadFromDisk;
597
598        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
599        internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
600        [MarshalAs(UnmanagedType.FunctionPtr)]
601        internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose;
602
603        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
604        internal delegate void _SetWorkingCollisionBoundsTagsInfo([In, Out] byte[] pTagsBuffer, uint unTagCount);
605        [MarshalAs(UnmanagedType.FunctionPtr)]
606        internal _SetWorkingCollisionBoundsTagsInfo SetWorkingCollisionBoundsTagsInfo;
607
608        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
609        internal delegate bool _GetLiveCollisionBoundsTagsInfo([In, Out] byte[] pTagsBuffer, ref uint punTagCount);
610        [MarshalAs(UnmanagedType.FunctionPtr)]
611        internal _GetLiveCollisionBoundsTagsInfo GetLiveCollisionBoundsTagsInfo;
612
613        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
614        internal delegate bool _SetWorkingPhysicalBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
615        [MarshalAs(UnmanagedType.FunctionPtr)]
616        internal _SetWorkingPhysicalBoundsInfo SetWorkingPhysicalBoundsInfo;
617
618        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
619        internal delegate bool _GetLivePhysicalBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
620        [MarshalAs(UnmanagedType.FunctionPtr)]
621        internal _GetLivePhysicalBoundsInfo GetLivePhysicalBoundsInfo;
622
623        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
624        internal delegate bool _ExportLiveToBuffer(System.Text.StringBuilder pBuffer, ref uint pnBufferLength);
625        [MarshalAs(UnmanagedType.FunctionPtr)]
626        internal _ExportLiveToBuffer ExportLiveToBuffer;
627
628        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
629        internal delegate bool _ImportFromBufferToWorking(string pBuffer, uint nImportFlags);
630        [MarshalAs(UnmanagedType.FunctionPtr)]
631        internal _ImportFromBufferToWorking ImportFromBufferToWorking;
632
633 }
634
635 [StructLayout(LayoutKind.Sequential)]
636 public struct IVRCompositor
637 {
638        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
639        internal delegate void _SetTrackingSpace(ETrackingUniverseOrigin eOrigin);
640        [MarshalAs(UnmanagedType.FunctionPtr)]
641        internal _SetTrackingSpace SetTrackingSpace;
642
643        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
644        internal delegate ETrackingUniverseOrigin _GetTrackingSpace();
645        [MarshalAs(UnmanagedType.FunctionPtr)]
646        internal _GetTrackingSpace GetTrackingSpace;
647
648        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
649        internal delegate EVRCompositorError _WaitGetPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
650        [MarshalAs(UnmanagedType.FunctionPtr)]
651        internal _WaitGetPoses WaitGetPoses;
652
653        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
654        internal delegate EVRCompositorError _GetLastPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
655        [MarshalAs(UnmanagedType.FunctionPtr)]
656        internal _GetLastPoses GetLastPoses;
657
658        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
659        internal delegate EVRCompositorError _GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex, ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pOutputGamePose);
660        [MarshalAs(UnmanagedType.FunctionPtr)]
661        internal _GetLastPoseForTrackedDeviceIndex GetLastPoseForTrackedDeviceIndex;
662
663        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
664        internal delegate EVRCompositorError _Submit(EVREye eEye, ref Texture_t pTexture, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags);
665        [MarshalAs(UnmanagedType.FunctionPtr)]
666        internal _Submit Submit;
667
668        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
669        internal delegate void _ClearLastSubmittedFrame();
670        [MarshalAs(UnmanagedType.FunctionPtr)]
671        internal _ClearLastSubmittedFrame ClearLastSubmittedFrame;
672
673        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
674        internal delegate void _PostPresentHandoff();
675        [MarshalAs(UnmanagedType.FunctionPtr)]
676        internal _PostPresentHandoff PostPresentHandoff;
677
678        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
679        internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo);
680        [MarshalAs(UnmanagedType.FunctionPtr)]
681        internal _GetFrameTiming GetFrameTiming;
682
683        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
684        internal delegate uint _GetFrameTimings(ref Compositor_FrameTiming pTiming, uint nFrames);
685        [MarshalAs(UnmanagedType.FunctionPtr)]
686        internal _GetFrameTimings GetFrameTimings;
687
688        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
689        internal delegate float _GetFrameTimeRemaining();
690        [MarshalAs(UnmanagedType.FunctionPtr)]
691        internal _GetFrameTimeRemaining GetFrameTimeRemaining;
692
693        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
694        internal delegate void _GetCumulativeStats(ref Compositor_CumulativeStats pStats, uint nStatsSizeInBytes);
695        [MarshalAs(UnmanagedType.FunctionPtr)]
696        internal _GetCumulativeStats GetCumulativeStats;
697
698        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
699        internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground);
700        [MarshalAs(UnmanagedType.FunctionPtr)]
701        internal _FadeToColor FadeToColor;
702
703        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
704        internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground);
705        [MarshalAs(UnmanagedType.FunctionPtr)]
706        internal _GetCurrentFadeColor GetCurrentFadeColor;
707
708        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
709        internal delegate void _FadeGrid(float fSeconds, bool bFadeIn);
710        [MarshalAs(UnmanagedType.FunctionPtr)]
711        internal _FadeGrid FadeGrid;
712
713        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
714        internal delegate float _GetCurrentGridAlpha();
715        [MarshalAs(UnmanagedType.FunctionPtr)]
716        internal _GetCurrentGridAlpha GetCurrentGridAlpha;
717
718        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
719        internal delegate EVRCompositorError _SetSkyboxOverride([In, Out] Texture_t[] pTextures, uint unTextureCount);
720        [MarshalAs(UnmanagedType.FunctionPtr)]
721        internal _SetSkyboxOverride SetSkyboxOverride;
722
723        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
724        internal delegate void _ClearSkyboxOverride();
725        [MarshalAs(UnmanagedType.FunctionPtr)]
726        internal _ClearSkyboxOverride ClearSkyboxOverride;
727
728        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
729        internal delegate void _CompositorBringToFront();
730        [MarshalAs(UnmanagedType.FunctionPtr)]
731        internal _CompositorBringToFront CompositorBringToFront;
732
733        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
734        internal delegate void _CompositorGoToBack();
735        [MarshalAs(UnmanagedType.FunctionPtr)]
736        internal _CompositorGoToBack CompositorGoToBack;
737
738        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
739        internal delegate void _CompositorQuit();
740        [MarshalAs(UnmanagedType.FunctionPtr)]
741        internal _CompositorQuit CompositorQuit;
742
743        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
744        internal delegate bool _IsFullscreen();
745        [MarshalAs(UnmanagedType.FunctionPtr)]
746        internal _IsFullscreen IsFullscreen;
747
748        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
749        internal delegate uint _GetCurrentSceneFocusProcess();
750        [MarshalAs(UnmanagedType.FunctionPtr)]
751        internal _GetCurrentSceneFocusProcess GetCurrentSceneFocusProcess;
752
753        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
754        internal delegate uint _GetLastFrameRenderer();
755        [MarshalAs(UnmanagedType.FunctionPtr)]
756        internal _GetLastFrameRenderer GetLastFrameRenderer;
757
758        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
759        internal delegate bool _CanRenderScene();
760        [MarshalAs(UnmanagedType.FunctionPtr)]
761        internal _CanRenderScene CanRenderScene;
762
763        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
764        internal delegate void _ShowMirrorWindow();
765        [MarshalAs(UnmanagedType.FunctionPtr)]
766        internal _ShowMirrorWindow ShowMirrorWindow;
767
768        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
769        internal delegate void _HideMirrorWindow();
770        [MarshalAs(UnmanagedType.FunctionPtr)]
771        internal _HideMirrorWindow HideMirrorWindow;
772
773        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
774        internal delegate bool _IsMirrorWindowVisible();
775        [MarshalAs(UnmanagedType.FunctionPtr)]
776        internal _IsMirrorWindowVisible IsMirrorWindowVisible;
777
778        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
779        internal delegate void _CompositorDumpImages();
780        [MarshalAs(UnmanagedType.FunctionPtr)]
781        internal _CompositorDumpImages CompositorDumpImages;
782
783        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
784        internal delegate bool _ShouldAppRenderWithLowResources();
785        [MarshalAs(UnmanagedType.FunctionPtr)]
786        internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources;
787
788        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
789        internal delegate void _ForceInterleavedReprojectionOn(bool bOverride);
790        [MarshalAs(UnmanagedType.FunctionPtr)]
791        internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn;
792
793        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
794        internal delegate void _ForceReconnectProcess();
795        [MarshalAs(UnmanagedType.FunctionPtr)]
796        internal _ForceReconnectProcess ForceReconnectProcess;
797
798        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
799        internal delegate void _SuspendRendering(bool bSuspend);
800        [MarshalAs(UnmanagedType.FunctionPtr)]
801        internal _SuspendRendering SuspendRendering;
802
803        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
804        internal delegate EVRCompositorError _GetMirrorTextureD3D11(EVREye eEye, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView);
805        [MarshalAs(UnmanagedType.FunctionPtr)]
806        internal _GetMirrorTextureD3D11 GetMirrorTextureD3D11;
807
808        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
809        internal delegate void _ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView);
810        [MarshalAs(UnmanagedType.FunctionPtr)]
811        internal _ReleaseMirrorTextureD3D11 ReleaseMirrorTextureD3D11;
812
813        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
814        internal delegate EVRCompositorError _GetMirrorTextureGL(EVREye eEye, ref uint pglTextureId, IntPtr pglSharedTextureHandle);
815        [MarshalAs(UnmanagedType.FunctionPtr)]
816        internal _GetMirrorTextureGL GetMirrorTextureGL;
817
818        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
819        internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle);
820        [MarshalAs(UnmanagedType.FunctionPtr)]
821        internal _ReleaseSharedGLTexture ReleaseSharedGLTexture;
822
823        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
824        internal delegate void _LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
825        [MarshalAs(UnmanagedType.FunctionPtr)]
826        internal _LockGLSharedTextureForAccess LockGLSharedTextureForAccess;
827
828        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
829        internal delegate void _UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
830        [MarshalAs(UnmanagedType.FunctionPtr)]
831        internal _UnlockGLSharedTextureForAccess UnlockGLSharedTextureForAccess;
832
833        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
834        internal delegate uint _GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue, uint unBufferSize);
835        [MarshalAs(UnmanagedType.FunctionPtr)]
836        internal _GetVulkanInstanceExtensionsRequired GetVulkanInstanceExtensionsRequired;
837
838        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
839        internal delegate uint _GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice, System.Text.StringBuilder pchValue, uint unBufferSize);
840        [MarshalAs(UnmanagedType.FunctionPtr)]
841        internal _GetVulkanDeviceExtensionsRequired GetVulkanDeviceExtensionsRequired;
842
843 }
844
845 [StructLayout(LayoutKind.Sequential)]
846 public struct IVROverlay
847 {
848        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
849        internal delegate EVROverlayError _FindOverlay(string pchOverlayKey, ref ulong pOverlayHandle);
850        [MarshalAs(UnmanagedType.FunctionPtr)]
851        internal _FindOverlay FindOverlay;
852
853        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
854        internal delegate EVROverlayError _CreateOverlay(string pchOverlayKey, string pchOverlayFriendlyName, ref ulong pOverlayHandle);
855        [MarshalAs(UnmanagedType.FunctionPtr)]
856        internal _CreateOverlay CreateOverlay;
857
858        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
859        internal delegate EVROverlayError _DestroyOverlay(ulong ulOverlayHandle);
860        [MarshalAs(UnmanagedType.FunctionPtr)]
861        internal _DestroyOverlay DestroyOverlay;
862
863        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
864        internal delegate EVROverlayError _SetHighQualityOverlay(ulong ulOverlayHandle);
865        [MarshalAs(UnmanagedType.FunctionPtr)]
866        internal _SetHighQualityOverlay SetHighQualityOverlay;
867
868        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
869        internal delegate ulong _GetHighQualityOverlay();
870        [MarshalAs(UnmanagedType.FunctionPtr)]
871        internal _GetHighQualityOverlay GetHighQualityOverlay;
872
873        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
874        internal delegate uint _GetOverlayKey(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
875        [MarshalAs(UnmanagedType.FunctionPtr)]
876        internal _GetOverlayKey GetOverlayKey;
877
878        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
879        internal delegate uint _GetOverlayName(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
880        [MarshalAs(UnmanagedType.FunctionPtr)]
881        internal _GetOverlayName GetOverlayName;
882
883        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
884        internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);
885        [MarshalAs(UnmanagedType.FunctionPtr)]
886        internal _GetOverlayImageData GetOverlayImageData;
887
888        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
889        internal delegate IntPtr _GetOverlayErrorNameFromEnum(EVROverlayError error);
890        [MarshalAs(UnmanagedType.FunctionPtr)]
891        internal _GetOverlayErrorNameFromEnum GetOverlayErrorNameFromEnum;
892
893        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
894        internal delegate EVROverlayError _SetOverlayRenderingPid(ulong ulOverlayHandle, uint unPID);
895        [MarshalAs(UnmanagedType.FunctionPtr)]
896        internal _SetOverlayRenderingPid SetOverlayRenderingPid;
897
898        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
899        internal delegate uint _GetOverlayRenderingPid(ulong ulOverlayHandle);
900        [MarshalAs(UnmanagedType.FunctionPtr)]
901        internal _GetOverlayRenderingPid GetOverlayRenderingPid;
902
903        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
904        internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled);
905        [MarshalAs(UnmanagedType.FunctionPtr)]
906        internal _SetOverlayFlag SetOverlayFlag;
907
908        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
909        internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled);
910        [MarshalAs(UnmanagedType.FunctionPtr)]
911        internal _GetOverlayFlag GetOverlayFlag;
912
913        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
914        internal delegate EVROverlayError _SetOverlayColor(ulong ulOverlayHandle, float fRed, float fGreen, float fBlue);
915        [MarshalAs(UnmanagedType.FunctionPtr)]
916        internal _SetOverlayColor SetOverlayColor;
917
918        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
919        internal delegate EVROverlayError _GetOverlayColor(ulong ulOverlayHandle, ref float pfRed, ref float pfGreen, ref float pfBlue);
920        [MarshalAs(UnmanagedType.FunctionPtr)]
921        internal _GetOverlayColor GetOverlayColor;
922
923        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
924        internal delegate EVROverlayError _SetOverlayAlpha(ulong ulOverlayHandle, float fAlpha);
925        [MarshalAs(UnmanagedType.FunctionPtr)]
926        internal _SetOverlayAlpha SetOverlayAlpha;
927
928        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
929        internal delegate EVROverlayError _GetOverlayAlpha(ulong ulOverlayHandle, ref float pfAlpha);
930        [MarshalAs(UnmanagedType.FunctionPtr)]
931        internal _GetOverlayAlpha GetOverlayAlpha;
932
933        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
934        internal delegate EVROverlayError _SetOverlayTexelAspect(ulong ulOverlayHandle, float fTexelAspect);
935        [MarshalAs(UnmanagedType.FunctionPtr)]
936        internal _SetOverlayTexelAspect SetOverlayTexelAspect;
937
938        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
939        internal delegate EVROverlayError _GetOverlayTexelAspect(ulong ulOverlayHandle, ref float pfTexelAspect);
940        [MarshalAs(UnmanagedType.FunctionPtr)]
941        internal _GetOverlayTexelAspect GetOverlayTexelAspect;
942
943        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
944        internal delegate EVROverlayError _SetOverlaySortOrder(ulong ulOverlayHandle, uint unSortOrder);
945        [MarshalAs(UnmanagedType.FunctionPtr)]
946        internal _SetOverlaySortOrder SetOverlaySortOrder;
947
948        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
949        internal delegate EVROverlayError _GetOverlaySortOrder(ulong ulOverlayHandle, ref uint punSortOrder);
950        [MarshalAs(UnmanagedType.FunctionPtr)]
951        internal _GetOverlaySortOrder GetOverlaySortOrder;
952
953        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
954        internal delegate EVROverlayError _SetOverlayWidthInMeters(ulong ulOverlayHandle, float fWidthInMeters);
955        [MarshalAs(UnmanagedType.FunctionPtr)]
956        internal _SetOverlayWidthInMeters SetOverlayWidthInMeters;
957
958        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
959        internal delegate EVROverlayError _GetOverlayWidthInMeters(ulong ulOverlayHandle, ref float pfWidthInMeters);
960        [MarshalAs(UnmanagedType.FunctionPtr)]
961        internal _GetOverlayWidthInMeters GetOverlayWidthInMeters;
962
963        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
964        internal delegate EVROverlayError _SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters);
965        [MarshalAs(UnmanagedType.FunctionPtr)]
966        internal _SetOverlayAutoCurveDistanceRangeInMeters SetOverlayAutoCurveDistanceRangeInMeters;
967
968        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
969        internal delegate EVROverlayError _GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, ref float pfMinDistanceInMeters, ref float pfMaxDistanceInMeters);
970        [MarshalAs(UnmanagedType.FunctionPtr)]
971        internal _GetOverlayAutoCurveDistanceRangeInMeters GetOverlayAutoCurveDistanceRangeInMeters;
972
973        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
974        internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace);
975        [MarshalAs(UnmanagedType.FunctionPtr)]
976        internal _SetOverlayTextureColorSpace SetOverlayTextureColorSpace;
977
978        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
979        internal delegate EVROverlayError _GetOverlayTextureColorSpace(ulong ulOverlayHandle, ref EColorSpace peTextureColorSpace);
980        [MarshalAs(UnmanagedType.FunctionPtr)]
981        internal _GetOverlayTextureColorSpace GetOverlayTextureColorSpace;
982
983        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
984        internal delegate EVROverlayError _SetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
985        [MarshalAs(UnmanagedType.FunctionPtr)]
986        internal _SetOverlayTextureBounds SetOverlayTextureBounds;
987
988        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
989        internal delegate EVROverlayError _GetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
990        [MarshalAs(UnmanagedType.FunctionPtr)]
991        internal _GetOverlayTextureBounds GetOverlayTextureBounds;
992
993        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
994        internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
995        [MarshalAs(UnmanagedType.FunctionPtr)]
996        internal _GetOverlayTransformType GetOverlayTransformType;
997
998        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
999        internal delegate EVROverlayError _SetOverlayTransformAbsolute(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
1000        [MarshalAs(UnmanagedType.FunctionPtr)]
1001        internal _SetOverlayTransformAbsolute SetOverlayTransformAbsolute;
1002
1003        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1004        internal delegate EVROverlayError _GetOverlayTransformAbsolute(ulong ulOverlayHandle, ref ETrackingUniverseOrigin peTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
1005        [MarshalAs(UnmanagedType.FunctionPtr)]
1006        internal _GetOverlayTransformAbsolute GetOverlayTransformAbsolute;
1007
1008        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1009        internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, uint unTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
1010        [MarshalAs(UnmanagedType.FunctionPtr)]
1011        internal _SetOverlayTransformTrackedDeviceRelative SetOverlayTransformTrackedDeviceRelative;
1012
1013        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1014        internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, ref uint punTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
1015        [MarshalAs(UnmanagedType.FunctionPtr)]
1016        internal _GetOverlayTransformTrackedDeviceRelative GetOverlayTransformTrackedDeviceRelative;
1017
1018        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1019        internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, uint unDeviceIndex, string pchComponentName);
1020        [MarshalAs(UnmanagedType.FunctionPtr)]
1021        internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent;
1022
1023        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1024        internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, string pchComponentName, uint unComponentNameSize);
1025        [MarshalAs(UnmanagedType.FunctionPtr)]
1026        internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;
1027
1028        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1029        internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);
1030        [MarshalAs(UnmanagedType.FunctionPtr)]
1031        internal _ShowOverlay ShowOverlay;
1032
1033        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1034        internal delegate EVROverlayError _HideOverlay(ulong ulOverlayHandle);
1035        [MarshalAs(UnmanagedType.FunctionPtr)]
1036        internal _HideOverlay HideOverlay;
1037
1038        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1039        internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle);
1040        [MarshalAs(UnmanagedType.FunctionPtr)]
1041        internal _IsOverlayVisible IsOverlayVisible;
1042
1043        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1044        internal delegate EVROverlayError _GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);
1045        [MarshalAs(UnmanagedType.FunctionPtr)]
1046        internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates;
1047
1048        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1049        internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent);
1050        [MarshalAs(UnmanagedType.FunctionPtr)]
1051        internal _PollNextOverlayEvent PollNextOverlayEvent;
1052
1053        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1054        internal delegate EVROverlayError _GetOverlayInputMethod(ulong ulOverlayHandle, ref VROverlayInputMethod peInputMethod);
1055        [MarshalAs(UnmanagedType.FunctionPtr)]
1056        internal _GetOverlayInputMethod GetOverlayInputMethod;
1057
1058        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1059        internal delegate EVROverlayError _SetOverlayInputMethod(ulong ulOverlayHandle, VROverlayInputMethod eInputMethod);
1060        [MarshalAs(UnmanagedType.FunctionPtr)]
1061        internal _SetOverlayInputMethod SetOverlayInputMethod;
1062
1063        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1064        internal delegate EVROverlayError _GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
1065        [MarshalAs(UnmanagedType.FunctionPtr)]
1066        internal _GetOverlayMouseScale GetOverlayMouseScale;
1067
1068        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1069        internal delegate EVROverlayError _SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
1070        [MarshalAs(UnmanagedType.FunctionPtr)]
1071        internal _SetOverlayMouseScale SetOverlayMouseScale;
1072
1073        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1074        internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);
1075        [MarshalAs(UnmanagedType.FunctionPtr)]
1076        internal _ComputeOverlayIntersection ComputeOverlayIntersection;
1077
1078        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1079        internal delegate bool _HandleControllerOverlayInteractionAsMouse(ulong ulOverlayHandle, uint unControllerDeviceIndex);
1080        [MarshalAs(UnmanagedType.FunctionPtr)]
1081        internal _HandleControllerOverlayInteractionAsMouse HandleControllerOverlayInteractionAsMouse;
1082
1083        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1084        internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle);
1085        [MarshalAs(UnmanagedType.FunctionPtr)]
1086        internal _IsHoverTargetOverlay IsHoverTargetOverlay;
1087
1088        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1089        internal delegate ulong _GetGamepadFocusOverlay();
1090        [MarshalAs(UnmanagedType.FunctionPtr)]
1091        internal _GetGamepadFocusOverlay GetGamepadFocusOverlay;
1092
1093        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1094        internal delegate EVROverlayError _SetGamepadFocusOverlay(ulong ulNewFocusOverlay);
1095        [MarshalAs(UnmanagedType.FunctionPtr)]
1096        internal _SetGamepadFocusOverlay SetGamepadFocusOverlay;
1097
1098        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1099        internal delegate EVROverlayError _SetOverlayNeighbor(EOverlayDirection eDirection, ulong ulFrom, ulong ulTo);
1100        [MarshalAs(UnmanagedType.FunctionPtr)]
1101        internal _SetOverlayNeighbor SetOverlayNeighbor;
1102
1103        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1104        internal delegate EVROverlayError _MoveGamepadFocusToNeighbor(EOverlayDirection eDirection, ulong ulFrom);
1105        [MarshalAs(UnmanagedType.FunctionPtr)]
1106        internal _MoveGamepadFocusToNeighbor MoveGamepadFocusToNeighbor;
1107
1108        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1109        internal delegate EVROverlayError _SetOverlayTexture(ulong ulOverlayHandle, ref Texture_t pTexture);
1110        [MarshalAs(UnmanagedType.FunctionPtr)]
1111        internal _SetOverlayTexture SetOverlayTexture;
1112
1113        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1114        internal delegate EVROverlayError _ClearOverlayTexture(ulong ulOverlayHandle);
1115        [MarshalAs(UnmanagedType.FunctionPtr)]
1116        internal _ClearOverlayTexture ClearOverlayTexture;
1117
1118        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1119        internal delegate EVROverlayError _SetOverlayRaw(ulong ulOverlayHandle, IntPtr pvBuffer, uint unWidth, uint unHeight, uint unDepth);
1120        [MarshalAs(UnmanagedType.FunctionPtr)]
1121        internal _SetOverlayRaw SetOverlayRaw;
1122
1123        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1124        internal delegate EVROverlayError _SetOverlayFromFile(ulong ulOverlayHandle, string pchFilePath);
1125        [MarshalAs(UnmanagedType.FunctionPtr)]
1126        internal _SetOverlayFromFile SetOverlayFromFile;
1127
1128        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1129        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);
1130        [MarshalAs(UnmanagedType.FunctionPtr)]
1131        internal _GetOverlayTexture GetOverlayTexture;
1132
1133        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1134        internal delegate EVROverlayError _ReleaseNativeOverlayHandle(ulong ulOverlayHandle, IntPtr pNativeTextureHandle);
1135        [MarshalAs(UnmanagedType.FunctionPtr)]
1136        internal _ReleaseNativeOverlayHandle ReleaseNativeOverlayHandle;
1137
1138        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1139        internal delegate EVROverlayError _GetOverlayTextureSize(ulong ulOverlayHandle, ref uint pWidth, ref uint pHeight);
1140        [MarshalAs(UnmanagedType.FunctionPtr)]
1141        internal _GetOverlayTextureSize GetOverlayTextureSize;
1142
1143        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1144        internal delegate EVROverlayError _CreateDashboardOverlay(string pchOverlayKey, string pchOverlayFriendlyName, ref ulong pMainHandle, ref ulong pThumbnailHandle);
1145        [MarshalAs(UnmanagedType.FunctionPtr)]
1146        internal _CreateDashboardOverlay CreateDashboardOverlay;
1147
1148        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1149        internal delegate bool _IsDashboardVisible();
1150        [MarshalAs(UnmanagedType.FunctionPtr)]
1151        internal _IsDashboardVisible IsDashboardVisible;
1152
1153        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1154        internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle);
1155        [MarshalAs(UnmanagedType.FunctionPtr)]
1156        internal _IsActiveDashboardOverlay IsActiveDashboardOverlay;
1157
1158        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1159        internal delegate EVROverlayError _SetDashboardOverlaySceneProcess(ulong ulOverlayHandle, uint unProcessId);
1160        [MarshalAs(UnmanagedType.FunctionPtr)]
1161        internal _SetDashboardOverlaySceneProcess SetDashboardOverlaySceneProcess;
1162
1163        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1164        internal delegate EVROverlayError _GetDashboardOverlaySceneProcess(ulong ulOverlayHandle, ref uint punProcessId);
1165        [MarshalAs(UnmanagedType.FunctionPtr)]
1166        internal _GetDashboardOverlaySceneProcess GetDashboardOverlaySceneProcess;
1167
1168        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1169        internal delegate void _ShowDashboard(string pchOverlayToShow);
1170        [MarshalAs(UnmanagedType.FunctionPtr)]
1171        internal _ShowDashboard ShowDashboard;
1172
1173        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1174        internal delegate uint _GetPrimaryDashboardDevice();
1175        [MarshalAs(UnmanagedType.FunctionPtr)]
1176        internal _GetPrimaryDashboardDevice GetPrimaryDashboardDevice;
1177
1178        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1179        internal delegate EVROverlayError _ShowKeyboard(int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
1180        [MarshalAs(UnmanagedType.FunctionPtr)]
1181        internal _ShowKeyboard ShowKeyboard;
1182
1183        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1184        internal delegate EVROverlayError _ShowKeyboardForOverlay(ulong ulOverlayHandle, int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
1185        [MarshalAs(UnmanagedType.FunctionPtr)]
1186        internal _ShowKeyboardForOverlay ShowKeyboardForOverlay;
1187
1188        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1189        internal delegate uint _GetKeyboardText(System.Text.StringBuilder pchText, uint cchText);
1190        [MarshalAs(UnmanagedType.FunctionPtr)]
1191        internal _GetKeyboardText GetKeyboardText;
1192
1193        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1194        internal delegate void _HideKeyboard();
1195        [MarshalAs(UnmanagedType.FunctionPtr)]
1196        internal _HideKeyboard HideKeyboard;
1197
1198        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1199        internal delegate void _SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);
1200        [MarshalAs(UnmanagedType.FunctionPtr)]
1201        internal _SetKeyboardTransformAbsolute SetKeyboardTransformAbsolute;
1202
1203        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1204        internal delegate void _SetKeyboardPositionForOverlay(ulong ulOverlayHandle, HmdRect2_t avoidRect);
1205        [MarshalAs(UnmanagedType.FunctionPtr)]
1206        internal _SetKeyboardPositionForOverlay SetKeyboardPositionForOverlay;
1207
1208        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1209        internal delegate EVROverlayError _SetOverlayIntersectionMask(ulong ulOverlayHandle, ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, uint unNumMaskPrimitives, uint unPrimitiveSize);
1210        [MarshalAs(UnmanagedType.FunctionPtr)]
1211        internal _SetOverlayIntersectionMask SetOverlayIntersectionMask;
1212
1213        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1214        internal delegate EVROverlayError _GetOverlayFlags(ulong ulOverlayHandle, ref uint pFlags);
1215        [MarshalAs(UnmanagedType.FunctionPtr)]
1216        internal _GetOverlayFlags GetOverlayFlags;
1217
1218        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1219        internal delegate VRMessageOverlayResponse _ShowMessageOverlay(string pchText, string pchCaption, string pchButton0Text, string pchButton1Text, string pchButton2Text, string pchButton3Text);
1220        [MarshalAs(UnmanagedType.FunctionPtr)]
1221        internal _ShowMessageOverlay ShowMessageOverlay;
1222
1223 }
1224
1225 [StructLayout(LayoutKind.Sequential)]
1226 public struct IVRRenderModels
1227 {
1228        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1229        internal delegate EVRRenderModelError _LoadRenderModel_Async(string pchRenderModelName, ref IntPtr ppRenderModel);
1230        [MarshalAs(UnmanagedType.FunctionPtr)]
1231        internal _LoadRenderModel_Async LoadRenderModel_Async;
1232
1233        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1234        internal delegate void _FreeRenderModel(IntPtr pRenderModel);
1235        [MarshalAs(UnmanagedType.FunctionPtr)]
1236        internal _FreeRenderModel FreeRenderModel;
1237
1238        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1239        internal delegate EVRRenderModelError _LoadTexture_Async(int textureId, ref IntPtr ppTexture);
1240        [MarshalAs(UnmanagedType.FunctionPtr)]
1241        internal _LoadTexture_Async LoadTexture_Async;
1242
1243        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1244        internal delegate void _FreeTexture(IntPtr pTexture);
1245        [MarshalAs(UnmanagedType.FunctionPtr)]
1246        internal _FreeTexture FreeTexture;
1247
1248        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1249        internal delegate EVRRenderModelError _LoadTextureD3D11_Async(int textureId, IntPtr pD3D11Device, ref IntPtr ppD3D11Texture2D);
1250        [MarshalAs(UnmanagedType.FunctionPtr)]
1251        internal _LoadTextureD3D11_Async LoadTextureD3D11_Async;
1252
1253        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1254        internal delegate EVRRenderModelError _LoadIntoTextureD3D11_Async(int textureId, IntPtr pDstTexture);
1255        [MarshalAs(UnmanagedType.FunctionPtr)]
1256        internal _LoadIntoTextureD3D11_Async LoadIntoTextureD3D11_Async;
1257
1258        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1259        internal delegate void _FreeTextureD3D11(IntPtr pD3D11Texture2D);
1260        [MarshalAs(UnmanagedType.FunctionPtr)]
1261        internal _FreeTextureD3D11 FreeTextureD3D11;
1262
1263        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1264        internal delegate uint _GetRenderModelName(uint unRenderModelIndex, System.Text.StringBuilder pchRenderModelName, uint unRenderModelNameLen);
1265        [MarshalAs(UnmanagedType.FunctionPtr)]
1266        internal _GetRenderModelName GetRenderModelName;
1267
1268        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1269        internal delegate uint _GetRenderModelCount();
1270        [MarshalAs(UnmanagedType.FunctionPtr)]
1271        internal _GetRenderModelCount GetRenderModelCount;
1272
1273        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1274        internal delegate uint _GetComponentCount(string pchRenderModelName);
1275        [MarshalAs(UnmanagedType.FunctionPtr)]
1276        internal _GetComponentCount GetComponentCount;
1277
1278        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1279        internal delegate uint _GetComponentName(string pchRenderModelName, uint unComponentIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameLen);
1280        [MarshalAs(UnmanagedType.FunctionPtr)]
1281        internal _GetComponentName GetComponentName;
1282
1283        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1284        internal delegate ulong _GetComponentButtonMask(string pchRenderModelName, string pchComponentName);
1285        [MarshalAs(UnmanagedType.FunctionPtr)]
1286        internal _GetComponentButtonMask GetComponentButtonMask;
1287
1288        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1289        internal delegate uint _GetComponentRenderModelName(string pchRenderModelName, string pchComponentName, System.Text.StringBuilder pchComponentRenderModelName, uint unComponentRenderModelNameLen);
1290        [MarshalAs(UnmanagedType.FunctionPtr)]
1291        internal _GetComponentRenderModelName GetComponentRenderModelName;
1292
1293        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1294        internal delegate bool _GetComponentState(string pchRenderModelName, string pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
1295        [MarshalAs(UnmanagedType.FunctionPtr)]
1296        internal _GetComponentState GetComponentState;
1297
1298        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1299        internal delegate bool _RenderModelHasComponent(string pchRenderModelName, string pchComponentName);
1300        [MarshalAs(UnmanagedType.FunctionPtr)]
1301        internal _RenderModelHasComponent RenderModelHasComponent;
1302
1303        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1304        internal delegate uint _GetRenderModelThumbnailURL(string pchRenderModelName, System.Text.StringBuilder pchThumbnailURL, uint unThumbnailURLLen, ref EVRRenderModelError peError);
1305        [MarshalAs(UnmanagedType.FunctionPtr)]
1306        internal _GetRenderModelThumbnailURL GetRenderModelThumbnailURL;
1307
1308        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1309        internal delegate uint _GetRenderModelOriginalPath(string pchRenderModelName, System.Text.StringBuilder pchOriginalPath, uint unOriginalPathLen, ref EVRRenderModelError peError);
1310        [MarshalAs(UnmanagedType.FunctionPtr)]
1311        internal _GetRenderModelOriginalPath GetRenderModelOriginalPath;
1312
1313        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1314        internal delegate IntPtr _GetRenderModelErrorNameFromEnum(EVRRenderModelError error);
1315        [MarshalAs(UnmanagedType.FunctionPtr)]
1316        internal _GetRenderModelErrorNameFromEnum GetRenderModelErrorNameFromEnum;
1317
1318 }
1319
1320 [StructLayout(LayoutKind.Sequential)]
1321 public struct IVRNotifications
1322 {
1323        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1324        internal delegate EVRNotificationError _CreateNotification(ulong ulOverlayHandle, ulong ulUserValue, EVRNotificationType type, string pchText, EVRNotificationStyle style, ref NotificationBitmap_t pImage, ref uint pNotificationId);
1325        [MarshalAs(UnmanagedType.FunctionPtr)]
1326        internal _CreateNotification CreateNotification;
1327
1328        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1329        internal delegate EVRNotificationError _RemoveNotification(uint notificationId);
1330        [MarshalAs(UnmanagedType.FunctionPtr)]
1331        internal _RemoveNotification RemoveNotification;
1332
1333 }
1334
1335 [StructLayout(LayoutKind.Sequential)]
1336 public struct IVRSettings
1337 {
1338        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1339        internal delegate IntPtr _GetSettingsErrorNameFromEnum(EVRSettingsError eError);
1340        [MarshalAs(UnmanagedType.FunctionPtr)]
1341        internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum;
1342
1343        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1344        internal delegate bool _Sync(bool bForce, ref EVRSettingsError peError);
1345        [MarshalAs(UnmanagedType.FunctionPtr)]
1346        internal _Sync Sync;
1347
1348        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1349        internal delegate void _SetBool(string pchSection, string pchSettingsKey, bool bValue, ref EVRSettingsError peError);
1350        [MarshalAs(UnmanagedType.FunctionPtr)]
1351        internal _SetBool SetBool;
1352
1353        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1354        internal delegate void _SetInt32(string pchSection, string pchSettingsKey, int nValue, ref EVRSettingsError peError);
1355        [MarshalAs(UnmanagedType.FunctionPtr)]
1356        internal _SetInt32 SetInt32;
1357
1358        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1359        internal delegate void _SetFloat(string pchSection, string pchSettingsKey, float flValue, ref EVRSettingsError peError);
1360        [MarshalAs(UnmanagedType.FunctionPtr)]
1361        internal _SetFloat SetFloat;
1362
1363        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1364        internal delegate void _SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError);
1365        [MarshalAs(UnmanagedType.FunctionPtr)]
1366        internal _SetString SetString;
1367
1368        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1369        internal delegate bool _GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1370        [MarshalAs(UnmanagedType.FunctionPtr)]
1371        internal _GetBool GetBool;
1372
1373        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1374        internal delegate int _GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1375        [MarshalAs(UnmanagedType.FunctionPtr)]
1376        internal _GetInt32 GetInt32;
1377
1378        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1379        internal delegate float _GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1380        [MarshalAs(UnmanagedType.FunctionPtr)]
1381        internal _GetFloat GetFloat;
1382
1383        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1384        internal delegate void _GetString(string pchSection, string pchSettingsKey, System.Text.StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError);
1385        [MarshalAs(UnmanagedType.FunctionPtr)]
1386        internal _GetString GetString;
1387
1388        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1389        internal delegate void _RemoveSection(string pchSection, ref EVRSettingsError peError);
1390        [MarshalAs(UnmanagedType.FunctionPtr)]
1391        internal _RemoveSection RemoveSection;
1392
1393        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1394        internal delegate void _RemoveKeyInSection(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
1395        [MarshalAs(UnmanagedType.FunctionPtr)]
1396        internal _RemoveKeyInSection RemoveKeyInSection;
1397
1398 }
1399
1400 [StructLayout(LayoutKind.Sequential)]
1401 public struct IVRScreenshots
1402 {
1403        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1404        internal delegate EVRScreenshotError _RequestScreenshot(ref uint pOutScreenshotHandle, EVRScreenshotType type, string pchPreviewFilename, string pchVRFilename);
1405        [MarshalAs(UnmanagedType.FunctionPtr)]
1406        internal _RequestScreenshot RequestScreenshot;
1407
1408        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1409        internal delegate EVRScreenshotError _HookScreenshot([In, Out] EVRScreenshotType[] pSupportedTypes, int numTypes);
1410        [MarshalAs(UnmanagedType.FunctionPtr)]
1411        internal _HookScreenshot HookScreenshot;
1412
1413        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1414        internal delegate EVRScreenshotType _GetScreenshotPropertyType(uint screenshotHandle, ref EVRScreenshotError pError);
1415        [MarshalAs(UnmanagedType.FunctionPtr)]
1416        internal _GetScreenshotPropertyType GetScreenshotPropertyType;
1417
1418        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1419        internal delegate uint _GetScreenshotPropertyFilename(uint screenshotHandle, EVRScreenshotPropertyFilenames filenameType, System.Text.StringBuilder pchFilename, uint cchFilename, ref EVRScreenshotError pError);
1420        [MarshalAs(UnmanagedType.FunctionPtr)]
1421        internal _GetScreenshotPropertyFilename GetScreenshotPropertyFilename;
1422
1423        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1424        internal delegate EVRScreenshotError _UpdateScreenshotProgress(uint screenshotHandle, float flProgress);
1425        [MarshalAs(UnmanagedType.FunctionPtr)]
1426        internal _UpdateScreenshotProgress UpdateScreenshotProgress;
1427
1428        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1429        internal delegate EVRScreenshotError _TakeStereoScreenshot(ref uint pOutScreenshotHandle, string pchPreviewFilename, string pchVRFilename);
1430        [MarshalAs(UnmanagedType.FunctionPtr)]
1431        internal _TakeStereoScreenshot TakeStereoScreenshot;
1432
1433        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1434        internal delegate EVRScreenshotError _SubmitScreenshot(uint screenshotHandle, EVRScreenshotType type, string pchSourcePreviewFilename, string pchSourceVRFilename);
1435        [MarshalAs(UnmanagedType.FunctionPtr)]
1436        internal _SubmitScreenshot SubmitScreenshot;
1437
1438 }
1439
1440 [StructLayout(LayoutKind.Sequential)]
1441 public struct IVRResources
1442 {
1443        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1444        internal delegate uint _LoadSharedResource(string pchResourceName, string pchBuffer, uint unBufferLen);
1445        [MarshalAs(UnmanagedType.FunctionPtr)]
1446        internal _LoadSharedResource LoadSharedResource;
1447
1448        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1449        internal delegate uint _GetResourceFullPath(string pchResourceName, string pchResourceTypeDirectory, string pchPathBuffer, uint unBufferLen);
1450        [MarshalAs(UnmanagedType.FunctionPtr)]
1451        internal _GetResourceFullPath GetResourceFullPath;
1452
1453 }
1454
1455
1456 public class CVRSystem
1457 {
1458        IVRSystem FnTable;
1459        internal CVRSystem(IntPtr pInterface)
1460        {
1461               FnTable = (IVRSystem)Marshal.PtrToStructure(pInterface, typeof(IVRSystem));
1462        }
1463        public void GetRecommendedRenderTargetSize(ref uint pnWidth,ref uint pnHeight)
1464        {
1465               pnWidth = 0;
1466               pnHeight = 0;
1467               FnTable.GetRecommendedRenderTargetSize(ref pnWidth,ref pnHeight);
1468        }
1469        public HmdMatrix44_t GetProjectionMatrix(EVREye eEye,float fNearZ,float fFarZ)
1470        {
1471               HmdMatrix44_t result = FnTable.GetProjectionMatrix(eEye,fNearZ,fFarZ);
1472               return result;
1473        }
1474        public void GetProjectionRaw(EVREye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom)
1475        {
1476               pfLeft = 0;
1477               pfRight = 0;
1478               pfTop = 0;
1479               pfBottom = 0;
1480               FnTable.GetProjectionRaw(eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom);
1481        }
1482        public bool ComputeDistortion(EVREye eEye,float fU,float fV,ref DistortionCoordinates_t pDistortionCoordinates)
1483        {
1484               bool result = FnTable.ComputeDistortion(eEye,fU,fV,ref pDistortionCoordinates);
1485               return result;
1486        }
1487        public HmdMatrix34_t GetEyeToHeadTransform(EVREye eEye)
1488        {
1489               HmdMatrix34_t result = FnTable.GetEyeToHeadTransform(eEye);
1490               return result;
1491        }
1492        public bool GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync,ref ulong pulFrameCounter)
1493        {
1494               pfSecondsSinceLastVsync = 0;
1495               pulFrameCounter = 0;
1496               bool result = FnTable.GetTimeSinceLastVsync(ref pfSecondsSinceLastVsync,ref pulFrameCounter);
1497               return result;
1498        }
1499        public int GetD3D9AdapterIndex()
1500        {
1501               int result = FnTable.GetD3D9AdapterIndex();
1502               return result;
1503        }
1504        public void GetDXGIOutputInfo(ref int pnAdapterIndex)
1505        {
1506               pnAdapterIndex = 0;
1507               FnTable.GetDXGIOutputInfo(ref pnAdapterIndex);
1508        }
1509        public bool IsDisplayOnDesktop()
1510        {
1511               bool result = FnTable.IsDisplayOnDesktop();
1512               return result;
1513        }
1514        public bool SetDisplayVisibility(bool bIsVisibleOnDesktop)
1515        {
1516               bool result = FnTable.SetDisplayVisibility(bIsVisibleOnDesktop);
1517               return result;
1518        }
1519        public void GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,float fPredictedSecondsToPhotonsFromNow,TrackedDevicePose_t [] pTrackedDevicePoseArray)
1520        {
1521               FnTable.GetDeviceToAbsoluteTrackingPose(eOrigin,fPredictedSecondsToPhotonsFromNow,pTrackedDevicePoseArray,(uint) pTrackedDevicePoseArray.Length);
1522        }
1523        public void ResetSeatedZeroPose()
1524        {
1525               FnTable.ResetSeatedZeroPose();
1526        }
1527        public HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose()
1528        {
1529               HmdMatrix34_t result = FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
1530               return result;
1531        }
1532        public HmdMatrix34_t GetRawZeroPoseToStandingAbsoluteTrackingPose()
1533        {
1534               HmdMatrix34_t result = FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose();
1535               return result;
1536        }
1537        public uint GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass,uint [] punTrackedDeviceIndexArray,uint unRelativeToTrackedDeviceIndex)
1538        {
1539               uint result = FnTable.GetSortedTrackedDeviceIndicesOfClass(eTrackedDeviceClass,punTrackedDeviceIndexArray,(uint) punTrackedDeviceIndexArray.Length,unRelativeToTrackedDeviceIndex);
1540               return result;
1541        }
1542        public EDeviceActivityLevel GetTrackedDeviceActivityLevel(uint unDeviceId)
1543        {
1544               EDeviceActivityLevel result = FnTable.GetTrackedDeviceActivityLevel(unDeviceId);
1545               return result;
1546        }
1547        public void ApplyTransform(ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pTrackedDevicePose,ref HmdMatrix34_t pTransform)
1548        {
1549               FnTable.ApplyTransform(ref pOutputPose,ref pTrackedDevicePose,ref pTransform);
1550        }
1551        public uint GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType)
1552        {
1553               uint result = FnTable.GetTrackedDeviceIndexForControllerRole(unDeviceType);
1554               return result;
1555        }
1556        public ETrackedControllerRole GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex)
1557        {
1558               ETrackedControllerRole result = FnTable.GetControllerRoleForTrackedDeviceIndex(unDeviceIndex);
1559               return result;
1560        }
1561        public ETrackedDeviceClass GetTrackedDeviceClass(uint unDeviceIndex)
1562        {
1563               ETrackedDeviceClass result = FnTable.GetTrackedDeviceClass(unDeviceIndex);
1564               return result;
1565        }
1566        public bool IsTrackedDeviceConnected(uint unDeviceIndex)
1567        {
1568               bool result = FnTable.IsTrackedDeviceConnected(unDeviceIndex);
1569               return result;
1570        }
1571        public bool GetBoolTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1572        {
1573               bool result = FnTable.GetBoolTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1574               return result;
1575        }
1576        public float GetFloatTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1577        {
1578               float result = FnTable.GetFloatTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1579               return result;
1580        }
1581        public int GetInt32TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1582        {
1583               int result = FnTable.GetInt32TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1584               return result;
1585        }
1586        public ulong GetUint64TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1587        {
1588               ulong result = FnTable.GetUint64TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1589               return result;
1590        }
1591        public HmdMatrix34_t GetMatrix34TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
1592        {
1593               HmdMatrix34_t result = FnTable.GetMatrix34TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
1594               return result;
1595        }
1596        public uint GetStringTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,System.Text.StringBuilder pchValue,uint unBufferSize,ref ETrackedPropertyError pError)
1597        {
1598               uint result = FnTable.GetStringTrackedDeviceProperty(unDeviceIndex,prop,pchValue,unBufferSize,ref pError);
1599               return result;
1600        }
1601        public string GetPropErrorNameFromEnum(ETrackedPropertyError error)
1602        {
1603               IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
1604               return Marshal.PtrToStringAnsi(result);
1605        }
1606        public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
1607        {
1608               bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
1609               return result;
1610        }
1611        public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
1612        {
1613               bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
1614               return result;
1615        }
1616        public string GetEventTypeNameFromEnum(EVREventType eType)
1617        {
1618               IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
1619               return Marshal.PtrToStringAnsi(result);
1620        }
1621        public HiddenAreaMesh_t GetHiddenAreaMesh(EVREye eEye,EHiddenAreaMeshType type)
1622        {
1623               HiddenAreaMesh_t result = FnTable.GetHiddenAreaMesh(eEye,type);
1624               return result;
1625        }
1626 // This is a terrible hack to workaround the fact that VRControllerState_t was
1627 // originally mis-compiled with the wrong packing for Linux and OSX.
1628        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1629        internal delegate bool _GetControllerStatePacked(uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize);
1630        [StructLayout(LayoutKind.Explicit)]
1631        struct GetControllerStateUnion
1632        {
1633               [FieldOffset(0)]
1634               public IVRSystem._GetControllerState pGetControllerState;
1635               [FieldOffset(0)]
1636               public _GetControllerStatePacked pGetControllerStatePacked;
1637        }
1638        public bool GetControllerState(uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize)
1639        {
1640               if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
1641                             (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
1642               {
1643                      GetControllerStateUnion u;
1644                      VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
1645                      u.pGetControllerStatePacked = null;
1646                      u.pGetControllerState = FnTable.GetControllerState;
1647                      bool packed_result = u.pGetControllerStatePacked(unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)));
1648
1649                      state_packed.Unpack(ref pControllerState);
1650                      return packed_result;
1651               }
1652               bool result = FnTable.GetControllerState(unControllerDeviceIndex,ref pControllerState,unControllerStateSize);
1653               return result;
1654        }
1655 // This is a terrible hack to workaround the fact that VRControllerState_t was
1656 // originally mis-compiled with the wrong packing for Linux and OSX.
1657        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1658        internal delegate bool _GetControllerStateWithPosePacked(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose);
1659        [StructLayout(LayoutKind.Explicit)]
1660        struct GetControllerStateWithPoseUnion
1661        {
1662               [FieldOffset(0)]
1663               public IVRSystem._GetControllerStateWithPose pGetControllerStateWithPose;
1664               [FieldOffset(0)]
1665               public _GetControllerStateWithPosePacked pGetControllerStateWithPosePacked;
1666        }
1667        public bool GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose)
1668        {
1669               if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
1670                             (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
1671               {
1672                      GetControllerStateWithPoseUnion u;
1673                      VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
1674                      u.pGetControllerStateWithPosePacked = null;
1675                      u.pGetControllerStateWithPose = FnTable.GetControllerStateWithPose;
1676                      bool packed_result = u.pGetControllerStateWithPosePacked(eOrigin,unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)),ref pTrackedDevicePose);
1677
1678                      state_packed.Unpack(ref pControllerState);
1679                      return packed_result;
1680               }
1681               bool result = FnTable.GetControllerStateWithPose(eOrigin,unControllerDeviceIndex,ref pControllerState,unControllerStateSize,ref pTrackedDevicePose);
1682               return result;
1683        }
1684        public void TriggerHapticPulse(uint unControllerDeviceIndex,uint unAxisId,char usDurationMicroSec)
1685        {
1686               FnTable.TriggerHapticPulse(unControllerDeviceIndex,unAxisId,usDurationMicroSec);
1687        }
1688        public string GetButtonIdNameFromEnum(EVRButtonId eButtonId)
1689        {
1690               IntPtr result = FnTable.GetButtonIdNameFromEnum(eButtonId);
1691               return Marshal.PtrToStringAnsi(result);
1692        }
1693        public string GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType)
1694        {
1695               IntPtr result = FnTable.GetControllerAxisTypeNameFromEnum(eAxisType);
1696               return Marshal.PtrToStringAnsi(result);
1697        }
1698        public bool CaptureInputFocus()
1699        {
1700               bool result = FnTable.CaptureInputFocus();
1701               return result;
1702        }
1703        public void ReleaseInputFocus()
1704        {
1705               FnTable.ReleaseInputFocus();
1706        }
1707        public bool IsInputFocusCapturedByAnotherProcess()
1708        {
1709               bool result = FnTable.IsInputFocusCapturedByAnotherProcess();
1710               return result;
1711        }
1712        public uint DriverDebugRequest(uint unDeviceIndex,string pchRequest,string pchResponseBuffer,uint unResponseBufferSize)
1713        {
1714               uint result = FnTable.DriverDebugRequest(unDeviceIndex,pchRequest,pchResponseBuffer,unResponseBufferSize);
1715               return result;
1716        }
1717        public EVRFirmwareError PerformFirmwareUpdate(uint unDeviceIndex)
1718        {
1719               EVRFirmwareError result = FnTable.PerformFirmwareUpdate(unDeviceIndex);
1720               return result;
1721        }
1722        public void AcknowledgeQuit_Exiting()
1723        {
1724               FnTable.AcknowledgeQuit_Exiting();
1725        }
1726        public void AcknowledgeQuit_UserPrompt()
1727        {
1728               FnTable.AcknowledgeQuit_UserPrompt();
1729        }
1730 }
1731
1732
1733 public class CVRExtendedDisplay
1734 {
1735        IVRExtendedDisplay FnTable;
1736        internal CVRExtendedDisplay(IntPtr pInterface)
1737        {
1738               FnTable = (IVRExtendedDisplay)Marshal.PtrToStructure(pInterface, typeof(IVRExtendedDisplay));
1739        }
1740        public void GetWindowBounds(ref int pnX,ref int pnY,ref uint pnWidth,ref uint pnHeight)
1741        {
1742               pnX = 0;
1743               pnY = 0;
1744               pnWidth = 0;
1745               pnHeight = 0;
1746               FnTable.GetWindowBounds(ref pnX,ref pnY,ref pnWidth,ref pnHeight);
1747        }
1748        public void GetEyeOutputViewport(EVREye eEye,ref uint pnX,ref uint pnY,ref uint pnWidth,ref uint pnHeight)
1749        {
1750               pnX = 0;
1751               pnY = 0;
1752               pnWidth = 0;
1753               pnHeight = 0;
1754               FnTable.GetEyeOutputViewport(eEye,ref pnX,ref pnY,ref pnWidth,ref pnHeight);
1755        }
1756        public void GetDXGIOutputInfo(ref int pnAdapterIndex,ref int pnAdapterOutputIndex)
1757        {
1758               pnAdapterIndex = 0;
1759               pnAdapterOutputIndex = 0;
1760               FnTable.GetDXGIOutputInfo(ref pnAdapterIndex,ref pnAdapterOutputIndex);
1761        }
1762 }
1763
1764
1765 public class CVRTrackedCamera
1766 {
1767        IVRTrackedCamera FnTable;
1768        internal CVRTrackedCamera(IntPtr pInterface)
1769        {
1770               FnTable = (IVRTrackedCamera)Marshal.PtrToStructure(pInterface, typeof(IVRTrackedCamera));
1771        }
1772        public string GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError)
1773        {
1774               IntPtr result = FnTable.GetCameraErrorNameFromEnum(eCameraError);
1775               return Marshal.PtrToStringAnsi(result);
1776        }
1777        public EVRTrackedCameraError HasCamera(uint nDeviceIndex,ref bool pHasCamera)
1778        {
1779               pHasCamera = false;
1780               EVRTrackedCameraError result = FnTable.HasCamera(nDeviceIndex,ref pHasCamera);
1781               return result;
1782        }
1783        public EVRTrackedCameraError GetCameraFrameSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref uint pnWidth,ref uint pnHeight,ref uint pnFrameBufferSize)
1784        {
1785               pnWidth = 0;
1786               pnHeight = 0;
1787               pnFrameBufferSize = 0;
1788               EVRTrackedCameraError result = FnTable.GetCameraFrameSize(nDeviceIndex,eFrameType,ref pnWidth,ref pnHeight,ref pnFrameBufferSize);
1789               return result;
1790        }
1791        public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref HmdVector2_t pFocalLength,ref HmdVector2_t pCenter)
1792        {
1793               EVRTrackedCameraError result = FnTable.GetCameraIntrinsics(nDeviceIndex,eFrameType,ref pFocalLength,ref pCenter);
1794               return result;
1795        }
1796        public EVRTrackedCameraError GetCameraProjection(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,float flZNear,float flZFar,ref HmdMatrix44_t pProjection)
1797        {
1798               EVRTrackedCameraError result = FnTable.GetCameraProjection(nDeviceIndex,eFrameType,flZNear,flZFar,ref pProjection);
1799               return result;
1800        }
1801        public EVRTrackedCameraError AcquireVideoStreamingService(uint nDeviceIndex,ref ulong pHandle)
1802        {
1803               pHandle = 0;
1804               EVRTrackedCameraError result = FnTable.AcquireVideoStreamingService(nDeviceIndex,ref pHandle);
1805               return result;
1806        }
1807        public EVRTrackedCameraError ReleaseVideoStreamingService(ulong hTrackedCamera)
1808        {
1809               EVRTrackedCameraError result = FnTable.ReleaseVideoStreamingService(hTrackedCamera);
1810               return result;
1811        }
1812        public EVRTrackedCameraError GetVideoStreamFrameBuffer(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pFrameBuffer,uint nFrameBufferSize,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1813        {
1814               EVRTrackedCameraError result = FnTable.GetVideoStreamFrameBuffer(hTrackedCamera,eFrameType,pFrameBuffer,nFrameBufferSize,ref pFrameHeader,nFrameHeaderSize);
1815               return result;
1816        }
1817        public EVRTrackedCameraError GetVideoStreamTextureSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref VRTextureBounds_t pTextureBounds,ref uint pnWidth,ref uint pnHeight)
1818        {
1819               pnWidth = 0;
1820               pnHeight = 0;
1821               EVRTrackedCameraError result = FnTable.GetVideoStreamTextureSize(nDeviceIndex,eFrameType,ref pTextureBounds,ref pnWidth,ref pnHeight);
1822               return result;
1823        }
1824        public EVRTrackedCameraError GetVideoStreamTextureD3D11(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1825        {
1826               EVRTrackedCameraError result = FnTable.GetVideoStreamTextureD3D11(hTrackedCamera,eFrameType,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView,ref pFrameHeader,nFrameHeaderSize);
1827               return result;
1828        }
1829        public EVRTrackedCameraError GetVideoStreamTextureGL(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,ref uint pglTextureId,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
1830        {
1831               pglTextureId = 0;
1832               EVRTrackedCameraError result = FnTable.GetVideoStreamTextureGL(hTrackedCamera,eFrameType,ref pglTextureId,ref pFrameHeader,nFrameHeaderSize);
1833               return result;
1834        }
1835        public EVRTrackedCameraError ReleaseVideoStreamTextureGL(ulong hTrackedCamera,uint glTextureId)
1836        {
1837               EVRTrackedCameraError result = FnTable.ReleaseVideoStreamTextureGL(hTrackedCamera,glTextureId);
1838               return result;
1839        }
1840 }
1841
1842
1843 public class CVRApplications
1844 {
1845        IVRApplications FnTable;
1846        internal CVRApplications(IntPtr pInterface)
1847        {
1848               FnTable = (IVRApplications)Marshal.PtrToStructure(pInterface, typeof(IVRApplications));
1849        }
1850        public EVRApplicationError AddApplicationManifest(string pchApplicationManifestFullPath,bool bTemporary)
1851        {
1852               EVRApplicationError result = FnTable.AddApplicationManifest(pchApplicationManifestFullPath,bTemporary);
1853               return result;
1854        }
1855        public EVRApplicationError RemoveApplicationManifest(string pchApplicationManifestFullPath)
1856        {
1857               EVRApplicationError result = FnTable.RemoveApplicationManifest(pchApplicationManifestFullPath);
1858               return result;
1859        }
1860        public bool IsApplicationInstalled(string pchAppKey)
1861        {
1862               bool result = FnTable.IsApplicationInstalled(pchAppKey);
1863               return result;
1864        }
1865        public uint GetApplicationCount()
1866        {
1867               uint result = FnTable.GetApplicationCount();
1868               return result;
1869        }
1870        public EVRApplicationError GetApplicationKeyByIndex(uint unApplicationIndex,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
1871        {
1872               EVRApplicationError result = FnTable.GetApplicationKeyByIndex(unApplicationIndex,pchAppKeyBuffer,unAppKeyBufferLen);
1873               return result;
1874        }
1875        public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,string pchAppKeyBuffer,uint unAppKeyBufferLen)
1876        {
1877               EVRApplicationError result = FnTable.GetApplicationKeyByProcessId(unProcessId,pchAppKeyBuffer,unAppKeyBufferLen);
1878               return result;
1879        }
1880        public EVRApplicationError LaunchApplication(string pchAppKey)
1881        {
1882               EVRApplicationError result = FnTable.LaunchApplication(pchAppKey);
1883               return result;
1884        }
1885        public EVRApplicationError LaunchTemplateApplication(string pchTemplateAppKey,string pchNewAppKey,AppOverrideKeys_t [] pKeys)
1886        {
1887               EVRApplicationError result = FnTable.LaunchTemplateApplication(pchTemplateAppKey,pchNewAppKey,pKeys,(uint) pKeys.Length);
1888               return result;
1889        }
1890        public EVRApplicationError LaunchApplicationFromMimeType(string pchMimeType,string pchArgs)
1891        {
1892               EVRApplicationError result = FnTable.LaunchApplicationFromMimeType(pchMimeType,pchArgs);
1893               return result;
1894        }
1895        public EVRApplicationError LaunchDashboardOverlay(string pchAppKey)
1896        {
1897               EVRApplicationError result = FnTable.LaunchDashboardOverlay(pchAppKey);
1898               return result;
1899        }
1900        public bool CancelApplicationLaunch(string pchAppKey)
1901        {
1902               bool result = FnTable.CancelApplicationLaunch(pchAppKey);
1903               return result;
1904        }
1905        public EVRApplicationError IdentifyApplication(uint unProcessId,string pchAppKey)
1906        {
1907               EVRApplicationError result = FnTable.IdentifyApplication(unProcessId,pchAppKey);
1908               return result;
1909        }
1910        public uint GetApplicationProcessId(string pchAppKey)
1911        {
1912               uint result = FnTable.GetApplicationProcessId(pchAppKey);
1913               return result;
1914        }
1915        public string GetApplicationsErrorNameFromEnum(EVRApplicationError error)
1916        {
1917               IntPtr result = FnTable.GetApplicationsErrorNameFromEnum(error);
1918               return Marshal.PtrToStringAnsi(result);
1919        }
1920        public uint GetApplicationPropertyString(string pchAppKey,EVRApplicationProperty eProperty,System.Text.StringBuilder pchPropertyValueBuffer,uint unPropertyValueBufferLen,ref EVRApplicationError peError)
1921        {
1922               uint result = FnTable.GetApplicationPropertyString(pchAppKey,eProperty,pchPropertyValueBuffer,unPropertyValueBufferLen,ref peError);
1923               return result;
1924        }
1925        public bool GetApplicationPropertyBool(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
1926        {
1927               bool result = FnTable.GetApplicationPropertyBool(pchAppKey,eProperty,ref peError);
1928               return result;
1929        }
1930        public ulong GetApplicationPropertyUint64(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
1931        {
1932               ulong result = FnTable.GetApplicationPropertyUint64(pchAppKey,eProperty,ref peError);
1933               return result;
1934        }
1935        public EVRApplicationError SetApplicationAutoLaunch(string pchAppKey,bool bAutoLaunch)
1936        {
1937               EVRApplicationError result = FnTable.SetApplicationAutoLaunch(pchAppKey,bAutoLaunch);
1938               return result;
1939        }
1940        public bool GetApplicationAutoLaunch(string pchAppKey)
1941        {
1942               bool result = FnTable.GetApplicationAutoLaunch(pchAppKey);
1943               return result;
1944        }
1945        public EVRApplicationError SetDefaultApplicationForMimeType(string pchAppKey,string pchMimeType)
1946        {
1947               EVRApplicationError result = FnTable.SetDefaultApplicationForMimeType(pchAppKey,pchMimeType);
1948               return result;
1949        }
1950        public bool GetDefaultApplicationForMimeType(string pchMimeType,string pchAppKeyBuffer,uint unAppKeyBufferLen)
1951        {
1952               bool result = FnTable.GetDefaultApplicationForMimeType(pchMimeType,pchAppKeyBuffer,unAppKeyBufferLen);
1953               return result;
1954        }
1955        public bool GetApplicationSupportedMimeTypes(string pchAppKey,string pchMimeTypesBuffer,uint unMimeTypesBuffer)
1956        {
1957               bool result = FnTable.GetApplicationSupportedMimeTypes(pchAppKey,pchMimeTypesBuffer,unMimeTypesBuffer);
1958               return result;
1959        }
1960        public uint GetApplicationsThatSupportMimeType(string pchMimeType,string pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer)
1961        {
1962               uint result = FnTable.GetApplicationsThatSupportMimeType(pchMimeType,pchAppKeysThatSupportBuffer,unAppKeysThatSupportBuffer);
1963               return result;
1964        }
1965        public uint GetApplicationLaunchArguments(uint unHandle,string pchArgs,uint unArgs)
1966        {
1967               uint result = FnTable.GetApplicationLaunchArguments(unHandle,pchArgs,unArgs);
1968               return result;
1969        }
1970        public EVRApplicationError GetStartingApplication(string pchAppKeyBuffer,uint unAppKeyBufferLen)
1971        {
1972               EVRApplicationError result = FnTable.GetStartingApplication(pchAppKeyBuffer,unAppKeyBufferLen);
1973               return result;
1974        }
1975        public EVRApplicationTransitionState GetTransitionState()
1976        {
1977               EVRApplicationTransitionState result = FnTable.GetTransitionState();
1978               return result;
1979        }
1980        public EVRApplicationError PerformApplicationPrelaunchCheck(string pchAppKey)
1981        {
1982               EVRApplicationError result = FnTable.PerformApplicationPrelaunchCheck(pchAppKey);
1983               return result;
1984        }
1985        public string GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state)
1986        {
1987               IntPtr result = FnTable.GetApplicationsTransitionStateNameFromEnum(state);
1988               return Marshal.PtrToStringAnsi(result);
1989        }
1990        public bool IsQuitUserPromptRequested()
1991        {
1992               bool result = FnTable.IsQuitUserPromptRequested();
1993               return result;
1994        }
1995        public EVRApplicationError LaunchInternalProcess(string pchBinaryPath,string pchArguments,string pchWorkingDirectory)
1996        {
1997               EVRApplicationError result = FnTable.LaunchInternalProcess(pchBinaryPath,pchArguments,pchWorkingDirectory);
1998               return result;
1999        }
2000        public uint GetCurrentSceneProcessId()
2001        {
2002               uint result = FnTable.GetCurrentSceneProcessId();
2003               return result;
2004        }
2005 }
2006
2007
2008 public class CVRChaperone
2009 {
2010        IVRChaperone FnTable;
2011        internal CVRChaperone(IntPtr pInterface)
2012        {
2013               FnTable = (IVRChaperone)Marshal.PtrToStructure(pInterface, typeof(IVRChaperone));
2014        }
2015        public ChaperoneCalibrationState GetCalibrationState()
2016        {
2017               ChaperoneCalibrationState result = FnTable.GetCalibrationState();
2018               return result;
2019        }
2020        public bool GetPlayAreaSize(ref float pSizeX,ref float pSizeZ)
2021        {
2022               pSizeX = 0;
2023               pSizeZ = 0;
2024               bool result = FnTable.GetPlayAreaSize(ref pSizeX,ref pSizeZ);
2025               return result;
2026        }
2027        public bool GetPlayAreaRect(ref HmdQuad_t rect)
2028        {
2029               bool result = FnTable.GetPlayAreaRect(ref rect);
2030               return result;
2031        }
2032        public void ReloadInfo()
2033        {
2034               FnTable.ReloadInfo();
2035        }
2036        public void SetSceneColor(HmdColor_t color)
2037        {
2038               FnTable.SetSceneColor(color);
2039        }
2040        public void GetBoundsColor(ref HmdColor_t pOutputColorArray,int nNumOutputColors,float flCollisionBoundsFadeDistance,ref HmdColor_t pOutputCameraColor)
2041        {
2042               FnTable.GetBoundsColor(ref pOutputColorArray,nNumOutputColors,flCollisionBoundsFadeDistance,ref pOutputCameraColor);
2043        }
2044        public bool AreBoundsVisible()
2045        {
2046               bool result = FnTable.AreBoundsVisible();
2047               return result;
2048        }
2049        public void ForceBoundsVisible(bool bForce)
2050        {
2051               FnTable.ForceBoundsVisible(bForce);
2052        }
2053 }
2054
2055
2056 public class CVRChaperoneSetup
2057 {
2058        IVRChaperoneSetup FnTable;
2059        internal CVRChaperoneSetup(IntPtr pInterface)
2060        {
2061               FnTable = (IVRChaperoneSetup)Marshal.PtrToStructure(pInterface, typeof(IVRChaperoneSetup));
2062        }
2063        public bool CommitWorkingCopy(EChaperoneConfigFile configFile)
2064        {
2065               bool result = FnTable.CommitWorkingCopy(configFile);
2066               return result;
2067        }
2068        public void RevertWorkingCopy()
2069        {
2070               FnTable.RevertWorkingCopy();
2071        }
2072        public bool GetWorkingPlayAreaSize(ref float pSizeX,ref float pSizeZ)
2073        {
2074               pSizeX = 0;
2075               pSizeZ = 0;
2076               bool result = FnTable.GetWorkingPlayAreaSize(ref pSizeX,ref pSizeZ);
2077               return result;
2078        }
2079        public bool GetWorkingPlayAreaRect(ref HmdQuad_t rect)
2080        {
2081               bool result = FnTable.GetWorkingPlayAreaRect(ref rect);
2082               return result;
2083        }
2084        public bool GetWorkingCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2085        {
2086               uint punQuadsCount = 0;
2087               bool result = FnTable.GetWorkingCollisionBoundsInfo(null,ref punQuadsCount);
2088               pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2089               result = FnTable.GetWorkingCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2090               return result;
2091        }
2092        public bool GetLiveCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2093        {
2094               uint punQuadsCount = 0;
2095               bool result = FnTable.GetLiveCollisionBoundsInfo(null,ref punQuadsCount);
2096               pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2097               result = FnTable.GetLiveCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2098               return result;
2099        }
2100        public bool GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
2101        {
2102               bool result = FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
2103               return result;
2104        }
2105        public bool GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose)
2106        {
2107               bool result = FnTable.GetWorkingStandingZeroPoseToRawTrackingPose(ref pmatStandingZeroPoseToRawTrackingPose);
2108               return result;
2109        }
2110        public void SetWorkingPlayAreaSize(float sizeX,float sizeZ)
2111        {
2112               FnTable.SetWorkingPlayAreaSize(sizeX,sizeZ);
2113        }
2114        public void SetWorkingCollisionBoundsInfo(HmdQuad_t [] pQuadsBuffer)
2115        {
2116               FnTable.SetWorkingCollisionBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
2117        }
2118        public void SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose)
2119        {
2120               FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose(ref pMatSeatedZeroPoseToRawTrackingPose);
2121        }
2122        public void SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose)
2123        {
2124               FnTable.SetWorkingStandingZeroPoseToRawTrackingPose(ref pMatStandingZeroPoseToRawTrackingPose);
2125        }
2126        public void ReloadFromDisk(EChaperoneConfigFile configFile)
2127        {
2128               FnTable.ReloadFromDisk(configFile);
2129        }
2130        public bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
2131        {
2132               bool result = FnTable.GetLiveSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
2133               return result;
2134        }
2135        public void SetWorkingCollisionBoundsTagsInfo(byte [] pTagsBuffer)
2136        {
2137               FnTable.SetWorkingCollisionBoundsTagsInfo(pTagsBuffer,(uint) pTagsBuffer.Length);
2138        }
2139        public bool GetLiveCollisionBoundsTagsInfo(out byte [] pTagsBuffer)
2140        {
2141               uint punTagCount = 0;
2142               bool result = FnTable.GetLiveCollisionBoundsTagsInfo(null,ref punTagCount);
2143               pTagsBuffer= new byte[punTagCount];
2144               result = FnTable.GetLiveCollisionBoundsTagsInfo(pTagsBuffer,ref punTagCount);
2145               return result;
2146        }
2147        public bool SetWorkingPhysicalBoundsInfo(HmdQuad_t [] pQuadsBuffer)
2148        {
2149               bool result = FnTable.SetWorkingPhysicalBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
2150               return result;
2151        }
2152        public bool GetLivePhysicalBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
2153        {
2154               uint punQuadsCount = 0;
2155               bool result = FnTable.GetLivePhysicalBoundsInfo(null,ref punQuadsCount);
2156               pQuadsBuffer= new HmdQuad_t[punQuadsCount];
2157               result = FnTable.GetLivePhysicalBoundsInfo(pQuadsBuffer,ref punQuadsCount);
2158               return result;
2159        }
2160        public bool ExportLiveToBuffer(System.Text.StringBuilder pBuffer,ref uint pnBufferLength)
2161        {
2162               pnBufferLength = 0;
2163               bool result = FnTable.ExportLiveToBuffer(pBuffer,ref pnBufferLength);
2164               return result;
2165        }
2166        public bool ImportFromBufferToWorking(string pBuffer,uint nImportFlags)
2167        {
2168               bool result = FnTable.ImportFromBufferToWorking(pBuffer,nImportFlags);
2169               return result;
2170        }
2171 }
2172
2173
2174 public class CVRCompositor
2175 {
2176        IVRCompositor FnTable;
2177        internal CVRCompositor(IntPtr pInterface)
2178        {
2179               FnTable = (IVRCompositor)Marshal.PtrToStructure(pInterface, typeof(IVRCompositor));
2180        }
2181        public void SetTrackingSpace(ETrackingUniverseOrigin eOrigin)
2182        {
2183               FnTable.SetTrackingSpace(eOrigin);
2184        }
2185        public ETrackingUniverseOrigin GetTrackingSpace()
2186        {
2187               ETrackingUniverseOrigin result = FnTable.GetTrackingSpace();
2188               return result;
2189        }
2190        public EVRCompositorError WaitGetPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
2191        {
2192               EVRCompositorError result = FnTable.WaitGetPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
2193               return result;
2194        }
2195        public EVRCompositorError GetLastPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
2196        {
2197               EVRCompositorError result = FnTable.GetLastPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
2198               return result;
2199        }
2200        public EVRCompositorError GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex,ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pOutputGamePose)
2201        {
2202               EVRCompositorError result = FnTable.GetLastPoseForTrackedDeviceIndex(unDeviceIndex,ref pOutputPose,ref pOutputGamePose);
2203               return result;
2204        }
2205        public EVRCompositorError Submit(EVREye eEye,ref Texture_t pTexture,ref VRTextureBounds_t pBounds,EVRSubmitFlags nSubmitFlags)
2206        {
2207               EVRCompositorError result = FnTable.Submit(eEye,ref pTexture,ref pBounds,nSubmitFlags);
2208               return result;
2209        }
2210        public void ClearLastSubmittedFrame()
2211        {
2212               FnTable.ClearLastSubmittedFrame();
2213        }
2214        public void PostPresentHandoff()
2215        {
2216               FnTable.PostPresentHandoff();
2217        }
2218        public bool GetFrameTiming(ref Compositor_FrameTiming pTiming,uint unFramesAgo)
2219        {
2220               bool result = FnTable.GetFrameTiming(ref pTiming,unFramesAgo);
2221               return result;
2222        }
2223        public uint GetFrameTimings(ref Compositor_FrameTiming pTiming,uint nFrames)
2224        {
2225               uint result = FnTable.GetFrameTimings(ref pTiming,nFrames);
2226               return result;
2227        }
2228        public float GetFrameTimeRemaining()
2229        {
2230               float result = FnTable.GetFrameTimeRemaining();
2231               return result;
2232        }
2233        public void GetCumulativeStats(ref Compositor_CumulativeStats pStats,uint nStatsSizeInBytes)
2234        {
2235               FnTable.GetCumulativeStats(ref pStats,nStatsSizeInBytes);
2236        }
2237        public void FadeToColor(float fSeconds,float fRed,float fGreen,float fBlue,float fAlpha,bool bBackground)
2238        {
2239               FnTable.FadeToColor(fSeconds,fRed,fGreen,fBlue,fAlpha,bBackground);
2240        }
2241        public HmdColor_t GetCurrentFadeColor(bool bBackground)
2242        {
2243               HmdColor_t result = FnTable.GetCurrentFadeColor(bBackground);
2244               return result;
2245        }
2246        public void FadeGrid(float fSeconds,bool bFadeIn)
2247        {
2248               FnTable.FadeGrid(fSeconds,bFadeIn);
2249        }
2250        public float GetCurrentGridAlpha()
2251        {
2252               float result = FnTable.GetCurrentGridAlpha();
2253               return result;
2254        }
2255        public EVRCompositorError SetSkyboxOverride(Texture_t [] pTextures)
2256        {
2257               EVRCompositorError result = FnTable.SetSkyboxOverride(pTextures,(uint) pTextures.Length);
2258               return result;
2259        }
2260        public void ClearSkyboxOverride()
2261        {
2262               FnTable.ClearSkyboxOverride();
2263        }
2264        public void CompositorBringToFront()
2265        {
2266               FnTable.CompositorBringToFront();
2267        }
2268        public void CompositorGoToBack()
2269        {
2270               FnTable.CompositorGoToBack();
2271        }
2272        public void CompositorQuit()
2273        {
2274               FnTable.CompositorQuit();
2275        }
2276        public bool IsFullscreen()
2277        {
2278               bool result = FnTable.IsFullscreen();
2279               return result;
2280        }
2281        public uint GetCurrentSceneFocusProcess()
2282        {
2283               uint result = FnTable.GetCurrentSceneFocusProcess();
2284               return result;
2285        }
2286        public uint GetLastFrameRenderer()
2287        {
2288               uint result = FnTable.GetLastFrameRenderer();
2289               return result;
2290        }
2291        public bool CanRenderScene()
2292        {
2293               bool result = FnTable.CanRenderScene();
2294               return result;
2295        }
2296        public void ShowMirrorWindow()
2297        {
2298               FnTable.ShowMirrorWindow();
2299        }
2300        public void HideMirrorWindow()
2301        {
2302               FnTable.HideMirrorWindow();
2303        }
2304        public bool IsMirrorWindowVisible()
2305        {
2306               bool result = FnTable.IsMirrorWindowVisible();
2307               return result;
2308        }
2309        public void CompositorDumpImages()
2310        {
2311               FnTable.CompositorDumpImages();
2312        }
2313        public bool ShouldAppRenderWithLowResources()
2314        {
2315               bool result = FnTable.ShouldAppRenderWithLowResources();
2316               return result;
2317        }
2318        public void ForceInterleavedReprojectionOn(bool bOverride)
2319        {
2320               FnTable.ForceInterleavedReprojectionOn(bOverride);
2321        }
2322        public void ForceReconnectProcess()
2323        {
2324               FnTable.ForceReconnectProcess();
2325        }
2326        public void SuspendRendering(bool bSuspend)
2327        {
2328               FnTable.SuspendRendering(bSuspend);
2329        }
2330        public EVRCompositorError GetMirrorTextureD3D11(EVREye eEye,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView)
2331        {
2332               EVRCompositorError result = FnTable.GetMirrorTextureD3D11(eEye,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView);
2333               return result;
2334        }
2335        public void ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView)
2336        {
2337               FnTable.ReleaseMirrorTextureD3D11(pD3D11ShaderResourceView);
2338        }
2339        public EVRCompositorError GetMirrorTextureGL(EVREye eEye,ref uint pglTextureId,IntPtr pglSharedTextureHandle)
2340        {
2341               pglTextureId = 0;
2342               EVRCompositorError result = FnTable.GetMirrorTextureGL(eEye,ref pglTextureId,pglSharedTextureHandle);
2343               return result;
2344        }
2345        public bool ReleaseSharedGLTexture(uint glTextureId,IntPtr glSharedTextureHandle)
2346        {
2347               bool result = FnTable.ReleaseSharedGLTexture(glTextureId,glSharedTextureHandle);
2348               return result;
2349        }
2350        public void LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
2351        {
2352               FnTable.LockGLSharedTextureForAccess(glSharedTextureHandle);
2353        }
2354        public void UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
2355        {
2356               FnTable.UnlockGLSharedTextureForAccess(glSharedTextureHandle);
2357        }
2358        public uint GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue,uint unBufferSize)
2359        {
2360               uint result = FnTable.GetVulkanInstanceExtensionsRequired(pchValue,unBufferSize);
2361               return result;
2362        }
2363        public uint GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice,System.Text.StringBuilder pchValue,uint unBufferSize)
2364        {
2365               uint result = FnTable.GetVulkanDeviceExtensionsRequired(pPhysicalDevice,pchValue,unBufferSize);
2366               return result;
2367        }
2368 }
2369
2370
2371 public class CVROverlay
2372 {
2373        IVROverlay FnTable;
2374        internal CVROverlay(IntPtr pInterface)
2375        {
2376               FnTable = (IVROverlay)Marshal.PtrToStructure(pInterface, typeof(IVROverlay));
2377        }
2378        public EVROverlayError FindOverlay(string pchOverlayKey,ref ulong pOverlayHandle)
2379        {
2380               pOverlayHandle = 0;
2381               EVROverlayError result = FnTable.FindOverlay(pchOverlayKey,ref pOverlayHandle);
2382               return result;
2383        }
2384        public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayFriendlyName,ref ulong pOverlayHandle)
2385        {
2386               pOverlayHandle = 0;
2387               EVROverlayError result = FnTable.CreateOverlay(pchOverlayKey,pchOverlayFriendlyName,ref pOverlayHandle);
2388               return result;
2389        }
2390        public EVROverlayError DestroyOverlay(ulong ulOverlayHandle)
2391        {
2392               EVROverlayError result = FnTable.DestroyOverlay(ulOverlayHandle);
2393               return result;
2394        }
2395        public EVROverlayError SetHighQualityOverlay(ulong ulOverlayHandle)
2396        {
2397               EVROverlayError result = FnTable.SetHighQualityOverlay(ulOverlayHandle);
2398               return result;
2399        }
2400        public ulong GetHighQualityOverlay()
2401        {
2402               ulong result = FnTable.GetHighQualityOverlay();
2403               return result;
2404        }
2405        public uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
2406        {
2407               uint result = FnTable.GetOverlayKey(ulOverlayHandle,pchValue,unBufferSize,ref pError);
2408               return result;
2409        }
2410        public uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
2411        {
2412               uint result = FnTable.GetOverlayName(ulOverlayHandle,pchValue,unBufferSize,ref pError);
2413               return result;
2414        }
2415        public EVROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight)
2416        {
2417               punWidth = 0;
2418               punHeight = 0;
2419               EVROverlayError result = FnTable.GetOverlayImageData(ulOverlayHandle,pvBuffer,unBufferSize,ref punWidth,ref punHeight);
2420               return result;
2421        }
2422        public string GetOverlayErrorNameFromEnum(EVROverlayError error)
2423        {
2424               IntPtr result = FnTable.GetOverlayErrorNameFromEnum(error);
2425               return Marshal.PtrToStringAnsi(result);
2426        }
2427        public EVROverlayError SetOverlayRenderingPid(ulong ulOverlayHandle,uint unPID)
2428        {
2429               EVROverlayError result = FnTable.SetOverlayRenderingPid(ulOverlayHandle,unPID);
2430               return result;
2431        }
2432        public uint GetOverlayRenderingPid(ulong ulOverlayHandle)
2433        {
2434               uint result = FnTable.GetOverlayRenderingPid(ulOverlayHandle);
2435               return result;
2436        }
2437        public EVROverlayError SetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,bool bEnabled)
2438        {
2439               EVROverlayError result = FnTable.SetOverlayFlag(ulOverlayHandle,eOverlayFlag,bEnabled);
2440               return result;
2441        }
2442        public EVROverlayError GetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,ref bool pbEnabled)
2443        {
2444               pbEnabled = false;
2445               EVROverlayError result = FnTable.GetOverlayFlag(ulOverlayHandle,eOverlayFlag,ref pbEnabled);
2446               return result;
2447        }
2448        public EVROverlayError SetOverlayColor(ulong ulOverlayHandle,float fRed,float fGreen,float fBlue)
2449        {
2450               EVROverlayError result = FnTable.SetOverlayColor(ulOverlayHandle,fRed,fGreen,fBlue);
2451               return result;
2452        }
2453        public EVROverlayError GetOverlayColor(ulong ulOverlayHandle,ref float pfRed,ref float pfGreen,ref float pfBlue)
2454        {
2455               pfRed = 0;
2456               pfGreen = 0;
2457               pfBlue = 0;
2458               EVROverlayError result = FnTable.GetOverlayColor(ulOverlayHandle,ref pfRed,ref pfGreen,ref pfBlue);
2459               return result;
2460        }
2461        public EVROverlayError SetOverlayAlpha(ulong ulOverlayHandle,float fAlpha)
2462        {
2463               EVROverlayError result = FnTable.SetOverlayAlpha(ulOverlayHandle,fAlpha);
2464               return result;
2465        }
2466        public EVROverlayError GetOverlayAlpha(ulong ulOverlayHandle,ref float pfAlpha)
2467        {
2468               pfAlpha = 0;
2469               EVROverlayError result = FnTable.GetOverlayAlpha(ulOverlayHandle,ref pfAlpha);
2470               return result;
2471        }
2472        public EVROverlayError SetOverlayTexelAspect(ulong ulOverlayHandle,float fTexelAspect)
2473        {
2474               EVROverlayError result = FnTable.SetOverlayTexelAspect(ulOverlayHandle,fTexelAspect);
2475               return result;
2476        }
2477        public EVROverlayError GetOverlayTexelAspect(ulong ulOverlayHandle,ref float pfTexelAspect)
2478        {
2479               pfTexelAspect = 0;
2480               EVROverlayError result = FnTable.GetOverlayTexelAspect(ulOverlayHandle,ref pfTexelAspect);
2481               return result;
2482        }
2483        public EVROverlayError SetOverlaySortOrder(ulong ulOverlayHandle,uint unSortOrder)
2484        {
2485               EVROverlayError result = FnTable.SetOverlaySortOrder(ulOverlayHandle,unSortOrder);
2486               return result;
2487        }
2488        public EVROverlayError GetOverlaySortOrder(ulong ulOverlayHandle,ref uint punSortOrder)
2489        {
2490               punSortOrder = 0;
2491               EVROverlayError result = FnTable.GetOverlaySortOrder(ulOverlayHandle,ref punSortOrder);
2492               return result;
2493        }
2494        public EVROverlayError SetOverlayWidthInMeters(ulong ulOverlayHandle,float fWidthInMeters)
2495        {
2496               EVROverlayError result = FnTable.SetOverlayWidthInMeters(ulOverlayHandle,fWidthInMeters);
2497               return result;
2498        }
2499        public EVROverlayError GetOverlayWidthInMeters(ulong ulOverlayHandle,ref float pfWidthInMeters)
2500        {
2501               pfWidthInMeters = 0;
2502               EVROverlayError result = FnTable.GetOverlayWidthInMeters(ulOverlayHandle,ref pfWidthInMeters);
2503               return result;
2504        }
2505        public EVROverlayError SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,float fMinDistanceInMeters,float fMaxDistanceInMeters)
2506        {
2507               EVROverlayError result = FnTable.SetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,fMinDistanceInMeters,fMaxDistanceInMeters);
2508               return result;
2509        }
2510        public EVROverlayError GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,ref float pfMinDistanceInMeters,ref float pfMaxDistanceInMeters)
2511        {
2512               pfMinDistanceInMeters = 0;
2513               pfMaxDistanceInMeters = 0;
2514               EVROverlayError result = FnTable.GetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,ref pfMinDistanceInMeters,ref pfMaxDistanceInMeters);
2515               return result;
2516        }
2517        public EVROverlayError SetOverlayTextureColorSpace(ulong ulOverlayHandle,EColorSpace eTextureColorSpace)
2518        {
2519               EVROverlayError result = FnTable.SetOverlayTextureColorSpace(ulOverlayHandle,eTextureColorSpace);
2520               return result;
2521        }
2522        public EVROverlayError GetOverlayTextureColorSpace(ulong ulOverlayHandle,ref EColorSpace peTextureColorSpace)
2523        {
2524               EVROverlayError result = FnTable.GetOverlayTextureColorSpace(ulOverlayHandle,ref peTextureColorSpace);
2525               return result;
2526        }
2527        public EVROverlayError SetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
2528        {
2529               EVROverlayError result = FnTable.SetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
2530               return result;
2531        }
2532        public EVROverlayError GetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
2533        {
2534               EVROverlayError result = FnTable.GetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
2535               return result;
2536        }
2537        public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
2538        {
2539               EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
2540               return result;
2541        }
2542        public EVROverlayError SetOverlayTransformAbsolute(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
2543        {
2544               EVROverlayError result = FnTable.SetOverlayTransformAbsolute(ulOverlayHandle,eTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
2545               return result;
2546        }
2547        public EVROverlayError GetOverlayTransformAbsolute(ulong ulOverlayHandle,ref ETrackingUniverseOrigin peTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
2548        {
2549               EVROverlayError result = FnTable.GetOverlayTransformAbsolute(ulOverlayHandle,ref peTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
2550               return result;
2551        }
2552        public EVROverlayError SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,uint unTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
2553        {
2554               EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,unTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
2555               return result;
2556        }
2557        public EVROverlayError GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,ref uint punTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
2558        {
2559               punTrackedDevice = 0;
2560               EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,ref punTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
2561               return result;
2562        }
2563        public EVROverlayError SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,uint unDeviceIndex,string pchComponentName)
2564        {
2565               EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,unDeviceIndex,pchComponentName);
2566               return result;
2567        }
2568        public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,string pchComponentName,uint unComponentNameSize)
2569        {
2570               punDeviceIndex = 0;
2571               EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize);
2572               return result;
2573        }
2574        public EVROverlayError ShowOverlay(ulong ulOverlayHandle)
2575        {
2576               EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle);
2577               return result;
2578        }
2579        public EVROverlayError HideOverlay(ulong ulOverlayHandle)
2580        {
2581               EVROverlayError result = FnTable.HideOverlay(ulOverlayHandle);
2582               return result;
2583        }
2584        public bool IsOverlayVisible(ulong ulOverlayHandle)
2585        {
2586               bool result = FnTable.IsOverlayVisible(ulOverlayHandle);
2587               return result;
2588        }
2589        public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
2590        {
2591               EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
2592               return result;
2593        }
2594        public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
2595        {
2596               bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
2597               return result;
2598        }
2599        public EVROverlayError GetOverlayInputMethod(ulong ulOverlayHandle,ref VROverlayInputMethod peInputMethod)
2600        {
2601               EVROverlayError result = FnTable.GetOverlayInputMethod(ulOverlayHandle,ref peInputMethod);
2602               return result;
2603        }
2604        public EVROverlayError SetOverlayInputMethod(ulong ulOverlayHandle,VROverlayInputMethod eInputMethod)
2605        {
2606               EVROverlayError result = FnTable.SetOverlayInputMethod(ulOverlayHandle,eInputMethod);
2607               return result;
2608        }
2609        public EVROverlayError GetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
2610        {
2611               EVROverlayError result = FnTable.GetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
2612               return result;
2613        }
2614        public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
2615        {
2616               EVROverlayError result = FnTable.SetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
2617               return result;
2618        }
2619        public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
2620        {
2621               bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults);
2622               return result;
2623        }
2624        public bool HandleControllerOverlayInteractionAsMouse(ulong ulOverlayHandle,uint unControllerDeviceIndex)
2625        {
2626               bool result = FnTable.HandleControllerOverlayInteractionAsMouse(ulOverlayHandle,unControllerDeviceIndex);
2627               return result;
2628        }
2629        public bool IsHoverTargetOverlay(ulong ulOverlayHandle)
2630        {
2631               bool result = FnTable.IsHoverTargetOverlay(ulOverlayHandle);
2632               return result;
2633        }
2634        public ulong GetGamepadFocusOverlay()
2635        {
2636               ulong result = FnTable.GetGamepadFocusOverlay();
2637               return result;
2638        }
2639        public EVROverlayError SetGamepadFocusOverlay(ulong ulNewFocusOverlay)
2640        {
2641               EVROverlayError result = FnTable.SetGamepadFocusOverlay(ulNewFocusOverlay);
2642               return result;
2643        }
2644        public EVROverlayError SetOverlayNeighbor(EOverlayDirection eDirection,ulong ulFrom,ulong ulTo)
2645        {
2646               EVROverlayError result = FnTable.SetOverlayNeighbor(eDirection,ulFrom,ulTo);
2647               return result;
2648        }
2649        public EVROverlayError MoveGamepadFocusToNeighbor(EOverlayDirection eDirection,ulong ulFrom)
2650        {
2651               EVROverlayError result = FnTable.MoveGamepadFocusToNeighbor(eDirection,ulFrom);
2652               return result;
2653        }
2654        public EVROverlayError SetOverlayTexture(ulong ulOverlayHandle,ref Texture_t pTexture)
2655        {
2656               EVROverlayError result = FnTable.SetOverlayTexture(ulOverlayHandle,ref pTexture);
2657               return result;
2658        }
2659        public EVROverlayError ClearOverlayTexture(ulong ulOverlayHandle)
2660        {
2661               EVROverlayError result = FnTable.ClearOverlayTexture(ulOverlayHandle);
2662               return result;
2663        }
2664        public EVROverlayError SetOverlayRaw(ulong ulOverlayHandle,IntPtr pvBuffer,uint unWidth,uint unHeight,uint unDepth)
2665        {
2666               EVROverlayError result = FnTable.SetOverlayRaw(ulOverlayHandle,pvBuffer,unWidth,unHeight,unDepth);
2667               return result;
2668        }
2669        public EVROverlayError SetOverlayFromFile(ulong ulOverlayHandle,string pchFilePath)
2670        {
2671               EVROverlayError result = FnTable.SetOverlayFromFile(ulOverlayHandle,pchFilePath);
2672               return result;
2673        }
2674        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)
2675        {
2676               pWidth = 0;
2677               pHeight = 0;
2678               pNativeFormat = 0;
2679               EVROverlayError result = FnTable.GetOverlayTexture(ulOverlayHandle,ref pNativeTextureHandle,pNativeTextureRef,ref pWidth,ref pHeight,ref pNativeFormat,ref pAPIType,ref pColorSpace,ref pTextureBounds);
2680               return result;
2681        }
2682        public EVROverlayError ReleaseNativeOverlayHandle(ulong ulOverlayHandle,IntPtr pNativeTextureHandle)
2683        {
2684               EVROverlayError result = FnTable.ReleaseNativeOverlayHandle(ulOverlayHandle,pNativeTextureHandle);
2685               return result;
2686        }
2687        public EVROverlayError GetOverlayTextureSize(ulong ulOverlayHandle,ref uint pWidth,ref uint pHeight)
2688        {
2689               pWidth = 0;
2690               pHeight = 0;
2691               EVROverlayError result = FnTable.GetOverlayTextureSize(ulOverlayHandle,ref pWidth,ref pHeight);
2692               return result;
2693        }
2694        public EVROverlayError CreateDashboardOverlay(string pchOverlayKey,string pchOverlayFriendlyName,ref ulong pMainHandle,ref ulong pThumbnailHandle)
2695        {
2696               pMainHandle = 0;
2697               pThumbnailHandle = 0;
2698               EVROverlayError result = FnTable.CreateDashboardOverlay(pchOverlayKey,pchOverlayFriendlyName,ref pMainHandle,ref pThumbnailHandle);
2699               return result;
2700        }
2701        public bool IsDashboardVisible()
2702        {
2703               bool result = FnTable.IsDashboardVisible();
2704               return result;
2705        }
2706        public bool IsActiveDashboardOverlay(ulong ulOverlayHandle)
2707        {
2708               bool result = FnTable.IsActiveDashboardOverlay(ulOverlayHandle);
2709               return result;
2710        }
2711        public EVROverlayError SetDashboardOverlaySceneProcess(ulong ulOverlayHandle,uint unProcessId)
2712        {
2713               EVROverlayError result = FnTable.SetDashboardOverlaySceneProcess(ulOverlayHandle,unProcessId);
2714               return result;
2715        }
2716        public EVROverlayError GetDashboardOverlaySceneProcess(ulong ulOverlayHandle,ref uint punProcessId)
2717        {
2718               punProcessId = 0;
2719               EVROverlayError result = FnTable.GetDashboardOverlaySceneProcess(ulOverlayHandle,ref punProcessId);
2720               return result;
2721        }
2722        public void ShowDashboard(string pchOverlayToShow)
2723        {
2724               FnTable.ShowDashboard(pchOverlayToShow);
2725        }
2726        public uint GetPrimaryDashboardDevice()
2727        {
2728               uint result = FnTable.GetPrimaryDashboardDevice();
2729               return result;
2730        }
2731        public EVROverlayError ShowKeyboard(int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText,bool bUseMinimalMode,ulong uUserValue)
2732        {
2733               EVROverlayError result = FnTable.ShowKeyboard(eInputMode,eLineInputMode,pchDescription,unCharMax,pchExistingText,bUseMinimalMode,uUserValue);
2734               return result;
2735        }
2736        public EVROverlayError ShowKeyboardForOverlay(ulong ulOverlayHandle,int eInputMode,int eLineInputMode,string pchDescription,uint unCharMax,string pchExistingText,bool bUseMinimalMode,ulong uUserValue)
2737        {
2738               EVROverlayError result = FnTable.ShowKeyboardForOverlay(ulOverlayHandle,eInputMode,eLineInputMode,pchDescription,unCharMax,pchExistingText,bUseMinimalMode,uUserValue);
2739               return result;
2740        }
2741        public uint GetKeyboardText(System.Text.StringBuilder pchText,uint cchText)
2742        {
2743               uint result = FnTable.GetKeyboardText(pchText,cchText);
2744               return result;
2745        }
2746        public void HideKeyboard()
2747        {
2748               FnTable.HideKeyboard();
2749        }
2750        public void SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform)
2751        {
2752               FnTable.SetKeyboardTransformAbsolute(eTrackingOrigin,ref pmatTrackingOriginToKeyboardTransform);
2753        }
2754        public void SetKeyboardPositionForOverlay(ulong ulOverlayHandle,HmdRect2_t avoidRect)
2755        {
2756               FnTable.SetKeyboardPositionForOverlay(ulOverlayHandle,avoidRect);
2757        }
2758        public EVROverlayError SetOverlayIntersectionMask(ulong ulOverlayHandle,ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives,uint unNumMaskPrimitives,uint unPrimitiveSize)
2759        {
2760               EVROverlayError result = FnTable.SetOverlayIntersectionMask(ulOverlayHandle,ref pMaskPrimitives,unNumMaskPrimitives,unPrimitiveSize);
2761               return result;
2762        }
2763        public EVROverlayError GetOverlayFlags(ulong ulOverlayHandle,ref uint pFlags)
2764        {
2765               pFlags = 0;
2766               EVROverlayError result = FnTable.GetOverlayFlags(ulOverlayHandle,ref pFlags);
2767               return result;
2768        }
2769        public VRMessageOverlayResponse ShowMessageOverlay(string pchText,string pchCaption,string pchButton0Text,string pchButton1Text,string pchButton2Text,string pchButton3Text)
2770        {
2771               VRMessageOverlayResponse result = FnTable.ShowMessageOverlay(pchText,pchCaption,pchButton0Text,pchButton1Text,pchButton2Text,pchButton3Text);
2772               return result;
2773        }
2774 }
2775
2776
2777 public class CVRRenderModels
2778 {
2779        IVRRenderModels FnTable;
2780        internal CVRRenderModels(IntPtr pInterface)
2781        {
2782               FnTable = (IVRRenderModels)Marshal.PtrToStructure(pInterface, typeof(IVRRenderModels));
2783        }
2784        public EVRRenderModelError LoadRenderModel_Async(string pchRenderModelName,ref IntPtr ppRenderModel)
2785        {
2786               EVRRenderModelError result = FnTable.LoadRenderModel_Async(pchRenderModelName,ref ppRenderModel);
2787               return result;
2788        }
2789        public void FreeRenderModel(IntPtr pRenderModel)
2790        {
2791               FnTable.FreeRenderModel(pRenderModel);
2792        }
2793        public EVRRenderModelError LoadTexture_Async(int textureId,ref IntPtr ppTexture)
2794        {
2795               EVRRenderModelError result = FnTable.LoadTexture_Async(textureId,ref ppTexture);
2796               return result;
2797        }
2798        public void FreeTexture(IntPtr pTexture)
2799        {
2800               FnTable.FreeTexture(pTexture);
2801        }
2802        public EVRRenderModelError LoadTextureD3D11_Async(int textureId,IntPtr pD3D11Device,ref IntPtr ppD3D11Texture2D)
2803        {
2804               EVRRenderModelError result = FnTable.LoadTextureD3D11_Async(textureId,pD3D11Device,ref ppD3D11Texture2D);
2805               return result;
2806        }
2807        public EVRRenderModelError LoadIntoTextureD3D11_Async(int textureId,IntPtr pDstTexture)
2808        {
2809               EVRRenderModelError result = FnTable.LoadIntoTextureD3D11_Async(textureId,pDstTexture);
2810               return result;
2811        }
2812        public void FreeTextureD3D11(IntPtr pD3D11Texture2D)
2813        {
2814               FnTable.FreeTextureD3D11(pD3D11Texture2D);
2815        }
2816        public uint GetRenderModelName(uint unRenderModelIndex,System.Text.StringBuilder pchRenderModelName,uint unRenderModelNameLen)
2817        {
2818               uint result = FnTable.GetRenderModelName(unRenderModelIndex,pchRenderModelName,unRenderModelNameLen);
2819               return result;
2820        }
2821        public uint GetRenderModelCount()
2822        {
2823               uint result = FnTable.GetRenderModelCount();
2824               return result;
2825        }
2826        public uint GetComponentCount(string pchRenderModelName)
2827        {
2828               uint result = FnTable.GetComponentCount(pchRenderModelName);
2829               return result;
2830        }
2831        public uint GetComponentName(string pchRenderModelName,uint unComponentIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameLen)
2832        {
2833               uint result = FnTable.GetComponentName(pchRenderModelName,unComponentIndex,pchComponentName,unComponentNameLen);
2834               return result;
2835        }
2836        public ulong GetComponentButtonMask(string pchRenderModelName,string pchComponentName)
2837        {
2838               ulong result = FnTable.GetComponentButtonMask(pchRenderModelName,pchComponentName);
2839               return result;
2840        }
2841        public uint GetComponentRenderModelName(string pchRenderModelName,string pchComponentName,System.Text.StringBuilder pchComponentRenderModelName,uint unComponentRenderModelNameLen)
2842        {
2843               uint result = FnTable.GetComponentRenderModelName(pchRenderModelName,pchComponentName,pchComponentRenderModelName,unComponentRenderModelNameLen);
2844               return result;
2845        }
2846 // This is a terrible hack to workaround the fact that VRControllerState_t was
2847 // originally mis-compiled with the wrong packing for Linux and OSX.
2848        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
2849        internal delegate bool _GetComponentStatePacked(string pchRenderModelName,string pchComponentName,ref VRControllerState_t_Packed pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState);
2850        [StructLayout(LayoutKind.Explicit)]
2851        struct GetComponentStateUnion
2852        {
2853               [FieldOffset(0)]
2854               public IVRRenderModels._GetComponentState pGetComponentState;
2855               [FieldOffset(0)]
2856               public _GetComponentStatePacked pGetComponentStatePacked;
2857        }
2858        public bool GetComponentState(string pchRenderModelName,string pchComponentName,ref VRControllerState_t pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)
2859        {
2860               if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
2861                             (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
2862               {
2863                      GetComponentStateUnion u;
2864                      VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed();
2865                      u.pGetComponentStatePacked = null;
2866                      u.pGetComponentState = FnTable.GetComponentState;
2867                      bool packed_result = u.pGetComponentStatePacked(pchRenderModelName,pchComponentName,ref state_packed,ref pState,ref pComponentState);
2868
2869                      state_packed.Unpack(ref pControllerState);
2870                      return packed_result;
2871               }
2872               bool result = FnTable.GetComponentState(pchRenderModelName,pchComponentName,ref pControllerState,ref pState,ref pComponentState);
2873               return result;
2874        }
2875        public bool RenderModelHasComponent(string pchRenderModelName,string pchComponentName)
2876        {
2877               bool result = FnTable.RenderModelHasComponent(pchRenderModelName,pchComponentName);
2878               return result;
2879        }
2880        public uint GetRenderModelThumbnailURL(string pchRenderModelName,System.Text.StringBuilder pchThumbnailURL,uint unThumbnailURLLen,ref EVRRenderModelError peError)
2881        {
2882               uint result = FnTable.GetRenderModelThumbnailURL(pchRenderModelName,pchThumbnailURL,unThumbnailURLLen,ref peError);
2883               return result;
2884        }
2885        public uint GetRenderModelOriginalPath(string pchRenderModelName,System.Text.StringBuilder pchOriginalPath,uint unOriginalPathLen,ref EVRRenderModelError peError)
2886        {
2887               uint result = FnTable.GetRenderModelOriginalPath(pchRenderModelName,pchOriginalPath,unOriginalPathLen,ref peError);
2888               return result;
2889        }
2890        public string GetRenderModelErrorNameFromEnum(EVRRenderModelError error)
2891        {
2892               IntPtr result = FnTable.GetRenderModelErrorNameFromEnum(error);
2893               return Marshal.PtrToStringAnsi(result);
2894        }
2895 }
2896
2897
2898 public class CVRNotifications
2899 {
2900        IVRNotifications FnTable;
2901        internal CVRNotifications(IntPtr pInterface)
2902        {
2903               FnTable = (IVRNotifications)Marshal.PtrToStructure(pInterface, typeof(IVRNotifications));
2904        }
2905        public EVRNotificationError CreateNotification(ulong ulOverlayHandle,ulong ulUserValue,EVRNotificationType type,string pchText,EVRNotificationStyle style,ref NotificationBitmap_t pImage,ref uint pNotificationId)
2906        {
2907               pNotificationId = 0;
2908               EVRNotificationError result = FnTable.CreateNotification(ulOverlayHandle,ulUserValue,type,pchText,style,ref pImage,ref pNotificationId);
2909               return result;
2910        }
2911        public EVRNotificationError RemoveNotification(uint notificationId)
2912        {
2913               EVRNotificationError result = FnTable.RemoveNotification(notificationId);
2914               return result;
2915        }
2916 }
2917
2918
2919 public class CVRSettings
2920 {
2921        IVRSettings FnTable;
2922        internal CVRSettings(IntPtr pInterface)
2923        {
2924               FnTable = (IVRSettings)Marshal.PtrToStructure(pInterface, typeof(IVRSettings));
2925        }
2926        public string GetSettingsErrorNameFromEnum(EVRSettingsError eError)
2927        {
2928               IntPtr result = FnTable.GetSettingsErrorNameFromEnum(eError);
2929               return Marshal.PtrToStringAnsi(result);
2930        }
2931        public bool Sync(bool bForce,ref EVRSettingsError peError)
2932        {
2933               bool result = FnTable.Sync(bForce,ref peError);
2934               return result;
2935        }
2936        public void SetBool(string pchSection,string pchSettingsKey,bool bValue,ref EVRSettingsError peError)
2937        {
2938               FnTable.SetBool(pchSection,pchSettingsKey,bValue,ref peError);
2939        }
2940        public void SetInt32(string pchSection,string pchSettingsKey,int nValue,ref EVRSettingsError peError)
2941        {
2942               FnTable.SetInt32(pchSection,pchSettingsKey,nValue,ref peError);
2943        }
2944        public void SetFloat(string pchSection,string pchSettingsKey,float flValue,ref EVRSettingsError peError)
2945        {
2946               FnTable.SetFloat(pchSection,pchSettingsKey,flValue,ref peError);
2947        }
2948        public void SetString(string pchSection,string pchSettingsKey,string pchValue,ref EVRSettingsError peError)
2949        {
2950               FnTable.SetString(pchSection,pchSettingsKey,pchValue,ref peError);
2951        }
2952        public bool GetBool(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
2953        {
2954               bool result = FnTable.GetBool(pchSection,pchSettingsKey,ref peError);
2955               return result;
2956        }
2957        public int GetInt32(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
2958        {
2959               int result = FnTable.GetInt32(pchSection,pchSettingsKey,ref peError);
2960               return result;
2961        }
2962        public float GetFloat(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
2963        {
2964               float result = FnTable.GetFloat(pchSection,pchSettingsKey,ref peError);
2965               return result;
2966        }
2967        public void GetString(string pchSection,string pchSettingsKey,System.Text.StringBuilder pchValue,uint unValueLen,ref EVRSettingsError peError)
2968        {
2969               FnTable.GetString(pchSection,pchSettingsKey,pchValue,unValueLen,ref peError);
2970        }
2971        public void RemoveSection(string pchSection,ref EVRSettingsError peError)
2972        {
2973               FnTable.RemoveSection(pchSection,ref peError);
2974        }
2975        public void RemoveKeyInSection(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
2976        {
2977               FnTable.RemoveKeyInSection(pchSection,pchSettingsKey,ref peError);
2978        }
2979 }
2980
2981
2982 public class CVRScreenshots
2983 {
2984        IVRScreenshots FnTable;
2985        internal CVRScreenshots(IntPtr pInterface)
2986        {
2987               FnTable = (IVRScreenshots)Marshal.PtrToStructure(pInterface, typeof(IVRScreenshots));
2988        }
2989        public EVRScreenshotError RequestScreenshot(ref uint pOutScreenshotHandle,EVRScreenshotType type,string pchPreviewFilename,string pchVRFilename)
2990        {
2991               pOutScreenshotHandle = 0;
2992               EVRScreenshotError result = FnTable.RequestScreenshot(ref pOutScreenshotHandle,type,pchPreviewFilename,pchVRFilename);
2993               return result;
2994        }
2995        public EVRScreenshotError HookScreenshot(EVRScreenshotType [] pSupportedTypes)
2996        {
2997               EVRScreenshotError result = FnTable.HookScreenshot(pSupportedTypes,(int) pSupportedTypes.Length);
2998               return result;
2999        }
3000        public EVRScreenshotType GetScreenshotPropertyType(uint screenshotHandle,ref EVRScreenshotError pError)
3001        {
3002               EVRScreenshotType result = FnTable.GetScreenshotPropertyType(screenshotHandle,ref pError);
3003               return result;
3004        }
3005        public uint GetScreenshotPropertyFilename(uint screenshotHandle,EVRScreenshotPropertyFilenames filenameType,System.Text.StringBuilder pchFilename,uint cchFilename,ref EVRScreenshotError pError)
3006        {
3007               uint result = FnTable.GetScreenshotPropertyFilename(screenshotHandle,filenameType,pchFilename,cchFilename,ref pError);
3008               return result;
3009        }
3010        public EVRScreenshotError UpdateScreenshotProgress(uint screenshotHandle,float flProgress)
3011        {
3012               EVRScreenshotError result = FnTable.UpdateScreenshotProgress(screenshotHandle,flProgress);
3013               return result;
3014        }
3015        public EVRScreenshotError TakeStereoScreenshot(ref uint pOutScreenshotHandle,string pchPreviewFilename,string pchVRFilename)
3016        {
3017               pOutScreenshotHandle = 0;
3018               EVRScreenshotError result = FnTable.TakeStereoScreenshot(ref pOutScreenshotHandle,pchPreviewFilename,pchVRFilename);
3019               return result;
3020        }
3021        public EVRScreenshotError SubmitScreenshot(uint screenshotHandle,EVRScreenshotType type,string pchSourcePreviewFilename,string pchSourceVRFilename)
3022        {
3023               EVRScreenshotError result = FnTable.SubmitScreenshot(screenshotHandle,type,pchSourcePreviewFilename,pchSourceVRFilename);
3024               return result;
3025        }
3026 }
3027
3028
3029 public class CVRResources
3030 {
3031        IVRResources FnTable;
3032        internal CVRResources(IntPtr pInterface)
3033        {
3034               FnTable = (IVRResources)Marshal.PtrToStructure(pInterface, typeof(IVRResources));
3035        }
3036        public uint LoadSharedResource(string pchResourceName,string pchBuffer,uint unBufferLen)
3037        {
3038               uint result = FnTable.LoadSharedResource(pchResourceName,pchBuffer,unBufferLen);
3039               return result;
3040        }
3041        public uint GetResourceFullPath(string pchResourceName,string pchResourceTypeDirectory,string pchPathBuffer,uint unBufferLen)
3042        {
3043               uint result = FnTable.GetResourceFullPath(pchResourceName,pchResourceTypeDirectory,pchPathBuffer,unBufferLen);
3044               return result;
3045        }
3046 }
3047
3048
3049 public class OpenVRInterop
3050 {
3051        [DllImportAttribute("openvr_api", EntryPoint = "VR_InitInternal", CallingConvention = CallingConvention.Cdecl)]
3052        internal static extern uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType);
3053        [DllImportAttribute("openvr_api", EntryPoint = "VR_ShutdownInternal", CallingConvention = CallingConvention.Cdecl)]
3054        internal static extern void ShutdownInternal();
3055        [DllImportAttribute("openvr_api", EntryPoint = "VR_IsHmdPresent", CallingConvention = CallingConvention.Cdecl)]
3056        internal static extern bool IsHmdPresent();
3057        [DllImportAttribute("openvr_api", EntryPoint = "VR_IsRuntimeInstalled", CallingConvention = CallingConvention.Cdecl)]
3058        internal static extern bool IsRuntimeInstalled();
3059        [DllImportAttribute("openvr_api", EntryPoint = "VR_GetStringForHmdError", CallingConvention = CallingConvention.Cdecl)]
3060        internal static extern IntPtr GetStringForHmdError(EVRInitError error);
3061        [DllImportAttribute("openvr_api", EntryPoint = "VR_GetGenericInterface", CallingConvention = CallingConvention.Cdecl)]
3062        internal static extern IntPtr GetGenericInterface([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion, ref EVRInitError peError);
3063        [DllImportAttribute("openvr_api", EntryPoint = "VR_IsInterfaceVersionValid", CallingConvention = CallingConvention.Cdecl)]
3064        internal static extern bool IsInterfaceVersionValid([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion);
3065        [DllImportAttribute("openvr_api", EntryPoint = "VR_GetInitToken", CallingConvention = CallingConvention.Cdecl)]
3066        internal static extern uint GetInitToken();
3067 }
3068
3069
3070 public enum EVREye
3071 {
3072        Eye_Left = 0,
3073        Eye_Right = 1,
3074 }
3075 public enum ETextureType
3076 {
3077        DirectX = 0,
3078        OpenGL = 1,
3079        Vulkan = 2,
3080        IOSurface = 3,
3081        DirectX12 = 4,
3082 }
3083 public enum EColorSpace
3084 {
3085        Auto = 0,
3086        Gamma = 1,
3087        Linear = 2,
3088 }
3089 public enum ETrackingResult
3090 {
3091        Uninitialized = 1,
3092        Calibrating_InProgress = 100,
3093        Calibrating_OutOfRange = 101,
3094        Running_OK = 200,
3095        Running_OutOfRange = 201,
3096 }
3097 public enum ETrackedDeviceClass
3098 {
3099        Invalid = 0,
3100        HMD = 1,
3101        Controller = 2,
3102        GenericTracker = 3,
3103        TrackingReference = 4,
3104 }
3105 public enum ETrackedControllerRole
3106 {
3107        Invalid = 0,
3108        LeftHand = 1,
3109        RightHand = 2,
3110 }
3111 public enum ETrackingUniverseOrigin
3112 {
3113        TrackingUniverseSeated = 0,
3114        TrackingUniverseStanding = 1,
3115        TrackingUniverseRawAndUncalibrated = 2,
3116 }
3117 public enum ETrackedDeviceProperty
3118 {
3119        Prop_Invalid = 0,
3120        Prop_TrackingSystemName_String = 1000,
3121        Prop_ModelNumber_String = 1001,