Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@JoeLudwig @jeremyselan @aaronleiby
7151 lines (6696 sloc) 289 KB
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: This file contains C#/managed code bindings for the OpenVR interfaces
// This file is auto-generated, do not edit it.
//
//=============================================================================
using System;
using System.Runtime.InteropServices;
using Valve.VR;
namespace Valve.VR
{
[StructLayout(LayoutKind.Sequential)]
public struct IVRSystem
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetRecommendedRenderTargetSize(ref uint pnWidth, ref uint pnHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRecommendedRenderTargetSize GetRecommendedRenderTargetSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdMatrix44_t _GetProjectionMatrix(EVREye eEye, float fNearZ, float fFarZ);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetProjectionMatrix GetProjectionMatrix;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetProjectionRaw(EVREye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetProjectionRaw GetProjectionRaw;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ComputeDistortion(EVREye eEye, float fU, float fV, ref DistortionCoordinates_t pDistortionCoordinates);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ComputeDistortion ComputeDistortion;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdMatrix34_t _GetEyeToHeadTransform(EVREye eEye);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetEyeToHeadTransform GetEyeToHeadTransform;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync, ref ulong pulFrameCounter);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTimeSinceLastVsync GetTimeSinceLastVsync;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate int _GetD3D9AdapterIndex();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetD3D9AdapterIndex GetD3D9AdapterIndex;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDXGIOutputInfo GetDXGIOutputInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetOutputDevice(ref ulong pnDevice, ETextureType textureType, IntPtr pInstance);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOutputDevice GetOutputDevice;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsDisplayOnDesktop();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsDisplayOnDesktop IsDisplayOnDesktop;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetDisplayVisibility SetDisplayVisibility;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, [In, Out] TrackedDevicePose_t[] pTrackedDevicePoseArray, uint unTrackedDevicePoseArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ResetSeatedZeroPose();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ResetSeatedZeroPose ResetSeatedZeroPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdMatrix34_t _GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSeatedZeroPoseToStandingAbsoluteTrackingPose GetSeatedZeroPoseToStandingAbsoluteTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdMatrix34_t _GetRawZeroPoseToStandingAbsoluteTrackingPose();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRawZeroPoseToStandingAbsoluteTrackingPose GetRawZeroPoseToStandingAbsoluteTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass, [In, Out] uint[] punTrackedDeviceIndexArray, uint unTrackedDeviceIndexArrayCount, uint unRelativeToTrackedDeviceIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSortedTrackedDeviceIndicesOfClass GetSortedTrackedDeviceIndicesOfClass;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EDeviceActivityLevel _GetTrackedDeviceActivityLevel(uint unDeviceId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTrackedDeviceActivityLevel GetTrackedDeviceActivityLevel;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ApplyTransform(ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pTrackedDevicePose, ref HmdMatrix34_t pTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ApplyTransform ApplyTransform;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTrackedDeviceIndexForControllerRole GetTrackedDeviceIndexForControllerRole;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ETrackedControllerRole _GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetControllerRoleForTrackedDeviceIndex GetControllerRoleForTrackedDeviceIndex;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ETrackedDeviceClass _GetTrackedDeviceClass(uint unDeviceIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTrackedDeviceClass GetTrackedDeviceClass;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsTrackedDeviceConnected(uint unDeviceIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsTrackedDeviceConnected IsTrackedDeviceConnected;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetBoolTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBoolTrackedDeviceProperty GetBoolTrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate float _GetFloatTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetFloatTrackedDeviceProperty GetFloatTrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate int _GetInt32TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetInt32TrackedDeviceProperty GetInt32TrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _GetUint64TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetUint64TrackedDeviceProperty GetUint64TrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdMatrix34_t _GetMatrix34TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetMatrix34TrackedDeviceProperty GetMatrix34TrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetArrayTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, uint propType, IntPtr pBuffer, uint unBufferSize, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetArrayTrackedDeviceProperty GetArrayTrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetStringTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, System.Text.StringBuilder pchValue, uint unBufferSize, ref ETrackedPropertyError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetStringTrackedDeviceProperty GetStringTrackedDeviceProperty;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PollNextEvent PollNextEvent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PollNextEventWithPose PollNextEventWithPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetEventTypeNameFromEnum(EVREventType eType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetEventTypeNameFromEnum GetEventTypeNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HiddenAreaMesh_t _GetHiddenAreaMesh(EVREye eEye, EHiddenAreaMeshType type);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetHiddenAreaMesh GetHiddenAreaMesh;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerState(uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetControllerState GetControllerState;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin, uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize, ref TrackedDevicePose_t pTrackedDevicePose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetControllerStateWithPose GetControllerStateWithPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _TriggerHapticPulse(uint unControllerDeviceIndex, uint unAxisId, ushort usDurationMicroSec);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _TriggerHapticPulse TriggerHapticPulse;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetButtonIdNameFromEnum(EVRButtonId eButtonId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetButtonIdNameFromEnum GetButtonIdNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsInputAvailable();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsInputAvailable IsInputAvailable;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsSteamVRDrawingControllers();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsSteamVRDrawingControllers IsSteamVRDrawingControllers;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ShouldApplicationPause();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShouldApplicationPause ShouldApplicationPause;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ShouldApplicationReduceRenderingWork();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShouldApplicationReduceRenderingWork ShouldApplicationReduceRenderingWork;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRFirmwareError _PerformFirmwareUpdate(uint unDeviceIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PerformFirmwareUpdate PerformFirmwareUpdate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _AcknowledgeQuit_Exiting();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _AcknowledgeQuit_Exiting AcknowledgeQuit_Exiting;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _AcknowledgeQuit_UserPrompt();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _AcknowledgeQuit_UserPrompt AcknowledgeQuit_UserPrompt;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetAppContainerFilePaths(System.Text.StringBuilder pchBuffer, uint unBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetAppContainerFilePaths GetAppContainerFilePaths;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetRuntimeVersion();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRuntimeVersion GetRuntimeVersion;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRExtendedDisplay
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetWindowBounds(ref int pnX, ref int pnY, ref uint pnWidth, ref uint pnHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWindowBounds GetWindowBounds;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetEyeOutputViewport(EVREye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetEyeOutputViewport GetEyeOutputViewport;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex, ref int pnAdapterOutputIndex);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDXGIOutputInfo GetDXGIOutputInfo;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRTrackedCamera
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCameraErrorNameFromEnum GetCameraErrorNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, ref bool pHasCamera);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HasCamera HasCamera;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetCameraFrameSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref uint pnWidth, ref uint pnHeight, ref uint pnFrameBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCameraFrameSize GetCameraFrameSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetCameraIntrinsics(uint nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCameraIntrinsics GetCameraIntrinsics;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetCameraProjection(uint nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, ref HmdMatrix44_t pProjection);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCameraProjection GetCameraProjection;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _AcquireVideoStreamingService(uint nDeviceIndex, ref ulong pHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _AcquireVideoStreamingService AcquireVideoStreamingService;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _ReleaseVideoStreamingService(ulong hTrackedCamera);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReleaseVideoStreamingService ReleaseVideoStreamingService;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetVideoStreamFrameBuffer(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pFrameBuffer, uint nFrameBufferSize, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVideoStreamFrameBuffer GetVideoStreamFrameBuffer;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetVideoStreamTextureSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref VRTextureBounds_t pTextureBounds, ref uint pnWidth, ref uint pnHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVideoStreamTextureSize GetVideoStreamTextureSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetVideoStreamTextureD3D11(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVideoStreamTextureD3D11 GetVideoStreamTextureD3D11;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _GetVideoStreamTextureGL(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, ref uint pglTextureId, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVideoStreamTextureGL GetVideoStreamTextureGL;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRTrackedCameraError _ReleaseVideoStreamTextureGL(ulong hTrackedCamera, uint glTextureId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReleaseVideoStreamTextureGL ReleaseVideoStreamTextureGL;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetCameraTrackingSpace SetCameraTrackingSpace;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ETrackingUniverseOrigin _GetCameraTrackingSpace();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCameraTrackingSpace GetCameraTrackingSpace;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRApplications
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _AddApplicationManifest(string pchApplicationManifestFullPath, bool bTemporary);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _AddApplicationManifest AddApplicationManifest;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _RemoveApplicationManifest(string pchApplicationManifestFullPath);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RemoveApplicationManifest RemoveApplicationManifest;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsApplicationInstalled(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsApplicationInstalled IsApplicationInstalled;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetApplicationCount();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationCount GetApplicationCount;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _GetApplicationKeyByIndex(uint unApplicationIndex, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationKeyByIndex GetApplicationKeyByIndex;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _LaunchApplication(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LaunchApplication LaunchApplication;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _LaunchTemplateApplication(string pchTemplateAppKey, string pchNewAppKey, [In, Out] AppOverrideKeys_t[] pKeys, uint unKeys);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LaunchTemplateApplication LaunchTemplateApplication;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _LaunchApplicationFromMimeType(string pchMimeType, string pchArgs);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LaunchApplicationFromMimeType LaunchApplicationFromMimeType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _LaunchDashboardOverlay(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LaunchDashboardOverlay LaunchDashboardOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _CancelApplicationLaunch(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CancelApplicationLaunch CancelApplicationLaunch;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _IdentifyApplication(uint unProcessId, string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IdentifyApplication IdentifyApplication;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetApplicationProcessId(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationProcessId GetApplicationProcessId;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetApplicationsErrorNameFromEnum(EVRApplicationError error);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationsErrorNameFromEnum GetApplicationsErrorNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetApplicationPropertyString(string pchAppKey, EVRApplicationProperty eProperty, System.Text.StringBuilder pchPropertyValueBuffer, uint unPropertyValueBufferLen, ref EVRApplicationError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationPropertyString GetApplicationPropertyString;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetApplicationPropertyBool(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationPropertyBool GetApplicationPropertyBool;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _GetApplicationPropertyUint64(string pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _SetApplicationAutoLaunch(string pchAppKey, bool bAutoLaunch);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetApplicationAutoLaunch SetApplicationAutoLaunch;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetApplicationAutoLaunch(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationAutoLaunch GetApplicationAutoLaunch;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _SetDefaultApplicationForMimeType(string pchAppKey, string pchMimeType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetDefaultApplicationForMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetApplicationSupportedMimeTypes(string pchAppKey, System.Text.StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetApplicationsThatSupportMimeType(string pchMimeType, System.Text.StringBuilder pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetApplicationLaunchArguments(uint unHandle, System.Text.StringBuilder pchArgs, uint unArgs);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationLaunchArguments GetApplicationLaunchArguments;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetStartingApplication GetStartingApplication;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationTransitionState _GetTransitionState();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTransitionState GetTransitionState;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _PerformApplicationPrelaunchCheck(string pchAppKey);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PerformApplicationPrelaunchCheck PerformApplicationPrelaunchCheck;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetApplicationsTransitionStateNameFromEnum GetApplicationsTransitionStateNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsQuitUserPromptRequested();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsQuitUserPromptRequested IsQuitUserPromptRequested;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRApplicationError _LaunchInternalProcess(string pchBinaryPath, string pchArguments, string pchWorkingDirectory);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LaunchInternalProcess LaunchInternalProcess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetCurrentSceneProcessId();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCurrentSceneProcessId GetCurrentSceneProcessId;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRChaperone
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ChaperoneCalibrationState _GetCalibrationState();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCalibrationState GetCalibrationState;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPlayAreaSize GetPlayAreaSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPlayAreaRect GetPlayAreaRect;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ReloadInfo();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReloadInfo ReloadInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetSceneColor(HmdColor_t color);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetSceneColor SetSceneColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetBoundsColor(ref HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, ref HmdColor_t pOutputCameraColor);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBoundsColor GetBoundsColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _AreBoundsVisible();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _AreBoundsVisible AreBoundsVisible;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ForceBoundsVisible(bool bForce);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ForceBoundsVisible ForceBoundsVisible;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRChaperoneSetup
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CommitWorkingCopy CommitWorkingCopy;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _RevertWorkingCopy();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RevertWorkingCopy RevertWorkingCopy;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetLiveCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetWorkingPlayAreaSize(float sizeX, float sizeZ);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetWorkingPlayAreaSize SetWorkingPlayAreaSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetWorkingCollisionBoundsInfo SetWorkingCollisionBoundsInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetWorkingPerimeter([In, Out] HmdVector2_t[] pPointBuffer, uint unPointCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetWorkingPerimeter SetWorkingPerimeter;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetWorkingSeatedZeroPoseToRawTrackingPose SetWorkingSeatedZeroPoseToRawTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetWorkingStandingZeroPoseToRawTrackingPose SetWorkingStandingZeroPoseToRawTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ReloadFromDisk(EChaperoneConfigFile configFile);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReloadFromDisk ReloadFromDisk;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ExportLiveToBuffer(System.Text.StringBuilder pBuffer, ref uint pnBufferLength);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ExportLiveToBuffer ExportLiveToBuffer;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ImportFromBufferToWorking(string pBuffer, uint nImportFlags);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ImportFromBufferToWorking ImportFromBufferToWorking;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ShowWorkingSetPreview();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowWorkingSetPreview ShowWorkingSetPreview;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _HideWorkingSetPreview();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HideWorkingSetPreview HideWorkingSetPreview;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _RoomSetupStarting();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RoomSetupStarting RoomSetupStarting;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRCompositor
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetTrackingSpace(ETrackingUniverseOrigin eOrigin);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetTrackingSpace SetTrackingSpace;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ETrackingUniverseOrigin _GetTrackingSpace();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTrackingSpace GetTrackingSpace;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _WaitGetPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _WaitGetPoses WaitGetPoses;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _GetLastPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetLastPoses GetLastPoses;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex, ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pOutputGamePose);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetLastPoseForTrackedDeviceIndex GetLastPoseForTrackedDeviceIndex;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _Submit(EVREye eEye, ref Texture_t pTexture, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Submit Submit;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ClearLastSubmittedFrame();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ClearLastSubmittedFrame ClearLastSubmittedFrame;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _PostPresentHandoff();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PostPresentHandoff PostPresentHandoff;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetFrameTiming GetFrameTiming;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetFrameTimings([In, Out] Compositor_FrameTiming[] pTiming, uint nFrames);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetFrameTimings GetFrameTimings;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate float _GetFrameTimeRemaining();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetFrameTimeRemaining GetFrameTimeRemaining;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetCumulativeStats(ref Compositor_CumulativeStats pStats, uint nStatsSizeInBytes);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCumulativeStats GetCumulativeStats;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FadeToColor FadeToColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCurrentFadeColor GetCurrentFadeColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _FadeGrid(float fSeconds, bool bFadeIn);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FadeGrid FadeGrid;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate float _GetCurrentGridAlpha();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCurrentGridAlpha GetCurrentGridAlpha;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _SetSkyboxOverride([In, Out] Texture_t[] pTextures, uint unTextureCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetSkyboxOverride SetSkyboxOverride;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ClearSkyboxOverride();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ClearSkyboxOverride ClearSkyboxOverride;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _CompositorBringToFront();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CompositorBringToFront CompositorBringToFront;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _CompositorGoToBack();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CompositorGoToBack CompositorGoToBack;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _CompositorQuit();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CompositorQuit CompositorQuit;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsFullscreen();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsFullscreen IsFullscreen;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetCurrentSceneFocusProcess();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetCurrentSceneFocusProcess GetCurrentSceneFocusProcess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetLastFrameRenderer();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetLastFrameRenderer GetLastFrameRenderer;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _CanRenderScene();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CanRenderScene CanRenderScene;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ShowMirrorWindow();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowMirrorWindow ShowMirrorWindow;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _HideMirrorWindow();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HideMirrorWindow HideMirrorWindow;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsMirrorWindowVisible();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsMirrorWindowVisible IsMirrorWindowVisible;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _CompositorDumpImages();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CompositorDumpImages CompositorDumpImages;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ShouldAppRenderWithLowResources();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ForceInterleavedReprojectionOn(bool bOverride);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ForceReconnectProcess();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ForceReconnectProcess ForceReconnectProcess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SuspendRendering(bool bSuspend);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SuspendRendering SuspendRendering;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _GetMirrorTextureD3D11(EVREye eEye, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetMirrorTextureD3D11 GetMirrorTextureD3D11;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReleaseMirrorTextureD3D11 ReleaseMirrorTextureD3D11;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _GetMirrorTextureGL(EVREye eEye, ref uint pglTextureId, IntPtr pglSharedTextureHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetMirrorTextureGL GetMirrorTextureGL;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReleaseSharedGLTexture ReleaseSharedGLTexture;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LockGLSharedTextureForAccess LockGLSharedTextureForAccess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _UnlockGLSharedTextureForAccess UnlockGLSharedTextureForAccess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue, uint unBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVulkanInstanceExtensionsRequired GetVulkanInstanceExtensionsRequired;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice, System.Text.StringBuilder pchValue, uint unBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetVulkanDeviceExtensionsRequired GetVulkanDeviceExtensionsRequired;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetExplicitTimingMode SetExplicitTimingMode;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRCompositorError _SubmitExplicitTimingData();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SubmitExplicitTimingData SubmitExplicitTimingData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsMotionSmoothingEnabled();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsMotionSmoothingEnabled IsMotionSmoothingEnabled;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsMotionSmoothingSupported();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsMotionSmoothingSupported IsMotionSmoothingSupported;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsCurrentSceneFocusAppLoading();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsCurrentSceneFocusAppLoading IsCurrentSceneFocusAppLoading;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVROverlay
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _FindOverlay(string pchOverlayKey, ref ulong pOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FindOverlay FindOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _CreateOverlay(string pchOverlayKey, string pchOverlayName, ref ulong pOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateOverlay CreateOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _DestroyOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _DestroyOverlay DestroyOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetOverlayKey(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayKey GetOverlayKey;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetOverlayName(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayName GetOverlayName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayName(ulong ulOverlayHandle, string pchName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayName SetOverlayName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayImageData GetOverlayImageData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetOverlayErrorNameFromEnum(EVROverlayError error);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayErrorNameFromEnum GetOverlayErrorNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayRenderingPid(ulong ulOverlayHandle, uint unPID);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayRenderingPid SetOverlayRenderingPid;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetOverlayRenderingPid(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayRenderingPid GetOverlayRenderingPid;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayFlag SetOverlayFlag;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayFlag GetOverlayFlag;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayColor(ulong ulOverlayHandle, float fRed, float fGreen, float fBlue);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayColor SetOverlayColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayColor(ulong ulOverlayHandle, ref float pfRed, ref float pfGreen, ref float pfBlue);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayColor GetOverlayColor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayAlpha(ulong ulOverlayHandle, float fAlpha);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayAlpha SetOverlayAlpha;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayAlpha(ulong ulOverlayHandle, ref float pfAlpha);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayAlpha GetOverlayAlpha;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTexelAspect(ulong ulOverlayHandle, float fTexelAspect);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTexelAspect SetOverlayTexelAspect;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTexelAspect(ulong ulOverlayHandle, ref float pfTexelAspect);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTexelAspect GetOverlayTexelAspect;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlaySortOrder(ulong ulOverlayHandle, uint unSortOrder);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlaySortOrder SetOverlaySortOrder;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlaySortOrder(ulong ulOverlayHandle, ref uint punSortOrder);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlaySortOrder GetOverlaySortOrder;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayWidthInMeters(ulong ulOverlayHandle, float fWidthInMeters);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayWidthInMeters SetOverlayWidthInMeters;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayWidthInMeters(ulong ulOverlayHandle, ref float pfWidthInMeters);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayWidthInMeters GetOverlayWidthInMeters;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayAutoCurveDistanceRangeInMeters SetOverlayAutoCurveDistanceRangeInMeters;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle, ref float pfMinDistanceInMeters, ref float pfMaxDistanceInMeters);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayAutoCurveDistanceRangeInMeters GetOverlayAutoCurveDistanceRangeInMeters;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTextureColorSpace SetOverlayTextureColorSpace;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTextureColorSpace(ulong ulOverlayHandle, ref EColorSpace peTextureColorSpace);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTextureColorSpace GetOverlayTextureColorSpace;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTextureBounds SetOverlayTextureBounds;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTextureBounds GetOverlayTextureBounds;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetOverlayRenderModel(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref HmdColor_t pColor, ref EVROverlayError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayRenderModel GetOverlayRenderModel;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayRenderModel(ulong ulOverlayHandle, string pchRenderModel, ref HmdColor_t pColor);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayRenderModel SetOverlayRenderModel;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformType GetOverlayTransformType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTransformAbsolute(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTransformAbsolute SetOverlayTransformAbsolute;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformAbsolute(ulong ulOverlayHandle, ref ETrackingUniverseOrigin peTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformAbsolute GetOverlayTransformAbsolute;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, uint unTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTransformTrackedDeviceRelative SetOverlayTransformTrackedDeviceRelative;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, ref uint punTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformTrackedDeviceRelative GetOverlayTransformTrackedDeviceRelative;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, uint unDeviceIndex, string pchComponentName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowOverlay ShowOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _HideOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HideOverlay HideOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsOverlayVisible IsOverlayVisible;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PollNextOverlayEvent PollNextOverlayEvent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayInputMethod(ulong ulOverlayHandle, ref VROverlayInputMethod peInputMethod);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayInputMethod GetOverlayInputMethod;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayInputMethod(ulong ulOverlayHandle, VROverlayInputMethod eInputMethod);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayInputMethod SetOverlayInputMethod;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayMouseScale GetOverlayMouseScale;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayMouseScale SetOverlayMouseScale;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ComputeOverlayIntersection ComputeOverlayIntersection;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsHoverTargetOverlay IsHoverTargetOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _GetGamepadFocusOverlay();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetGamepadFocusOverlay GetGamepadFocusOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetGamepadFocusOverlay(ulong ulNewFocusOverlay);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetGamepadFocusOverlay SetGamepadFocusOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayNeighbor(EOverlayDirection eDirection, ulong ulFrom, ulong ulTo);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayNeighbor SetOverlayNeighbor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _MoveGamepadFocusToNeighbor(EOverlayDirection eDirection, ulong ulFrom);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _MoveGamepadFocusToNeighbor MoveGamepadFocusToNeighbor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayDualAnalogTransform(ulong ulOverlay, EDualAnalogWhich eWhich, ref HmdVector2_t pvCenter, float fRadius);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayDualAnalogTransform SetOverlayDualAnalogTransform;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayDualAnalogTransform(ulong ulOverlay, EDualAnalogWhich eWhich, ref HmdVector2_t pvCenter, ref float pfRadius);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayDualAnalogTransform GetOverlayDualAnalogTransform;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayTexture(ulong ulOverlayHandle, ref Texture_t pTexture);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayTexture SetOverlayTexture;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ClearOverlayTexture(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ClearOverlayTexture ClearOverlayTexture;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayRaw(ulong ulOverlayHandle, IntPtr pvBuffer, uint unWidth, uint unHeight, uint unDepth);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayRaw SetOverlayRaw;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayFromFile(ulong ulOverlayHandle, string pchFilePath);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayFromFile SetOverlayFromFile;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
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);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTexture GetOverlayTexture;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ReleaseNativeOverlayHandle(ulong ulOverlayHandle, IntPtr pNativeTextureHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ReleaseNativeOverlayHandle ReleaseNativeOverlayHandle;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayTextureSize(ulong ulOverlayHandle, ref uint pWidth, ref uint pHeight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayTextureSize GetOverlayTextureSize;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _CreateDashboardOverlay(string pchOverlayKey, string pchOverlayFriendlyName, ref ulong pMainHandle, ref ulong pThumbnailHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateDashboardOverlay CreateDashboardOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsDashboardVisible();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsDashboardVisible IsDashboardVisible;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsActiveDashboardOverlay IsActiveDashboardOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetDashboardOverlaySceneProcess(ulong ulOverlayHandle, uint unProcessId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetDashboardOverlaySceneProcess SetDashboardOverlaySceneProcess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetDashboardOverlaySceneProcess(ulong ulOverlayHandle, ref uint punProcessId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDashboardOverlaySceneProcess GetDashboardOverlaySceneProcess;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _ShowDashboard(string pchOverlayToShow);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowDashboard ShowDashboard;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetPrimaryDashboardDevice();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPrimaryDashboardDevice GetPrimaryDashboardDevice;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ShowKeyboard(int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowKeyboard ShowKeyboard;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _ShowKeyboardForOverlay(ulong ulOverlayHandle, int eInputMode, int eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText, bool bUseMinimalMode, ulong uUserValue);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowKeyboardForOverlay ShowKeyboardForOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetKeyboardText(System.Text.StringBuilder pchText, uint cchText);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetKeyboardText GetKeyboardText;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _HideKeyboard();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HideKeyboard HideKeyboard;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetKeyboardTransformAbsolute SetKeyboardTransformAbsolute;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetKeyboardPositionForOverlay(ulong ulOverlayHandle, HmdRect2_t avoidRect);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetKeyboardPositionForOverlay SetKeyboardPositionForOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _SetOverlayIntersectionMask(ulong ulOverlayHandle, ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, uint unNumMaskPrimitives, uint unPrimitiveSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetOverlayIntersectionMask SetOverlayIntersectionMask;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVROverlayError _GetOverlayFlags(ulong ulOverlayHandle, ref uint pFlags);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOverlayFlags GetOverlayFlags;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate VRMessageOverlayResponse _ShowMessageOverlay(string pchText, string pchCaption, string pchButton0Text, string pchButton1Text, string pchButton2Text, string pchButton3Text);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowMessageOverlay ShowMessageOverlay;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _CloseMessageOverlay();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CloseMessageOverlay CloseMessageOverlay;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRRenderModels
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRRenderModelError _LoadRenderModel_Async(string pchRenderModelName, ref IntPtr ppRenderModel);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadRenderModel_Async LoadRenderModel_Async;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _FreeRenderModel(IntPtr pRenderModel);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FreeRenderModel FreeRenderModel;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRRenderModelError _LoadTexture_Async(int textureId, ref IntPtr ppTexture);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadTexture_Async LoadTexture_Async;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _FreeTexture(IntPtr pTexture);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FreeTexture FreeTexture;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRRenderModelError _LoadTextureD3D11_Async(int textureId, IntPtr pD3D11Device, ref IntPtr ppD3D11Texture2D);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadTextureD3D11_Async LoadTextureD3D11_Async;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRRenderModelError _LoadIntoTextureD3D11_Async(int textureId, IntPtr pDstTexture);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadIntoTextureD3D11_Async LoadIntoTextureD3D11_Async;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _FreeTextureD3D11(IntPtr pD3D11Texture2D);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FreeTextureD3D11 FreeTextureD3D11;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetRenderModelName(uint unRenderModelIndex, System.Text.StringBuilder pchRenderModelName, uint unRenderModelNameLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRenderModelName GetRenderModelName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetRenderModelCount();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRenderModelCount GetRenderModelCount;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetComponentCount(string pchRenderModelName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentCount GetComponentCount;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetComponentName(string pchRenderModelName, uint unComponentIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentName GetComponentName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _GetComponentButtonMask(string pchRenderModelName, string pchComponentName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentButtonMask GetComponentButtonMask;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetComponentRenderModelName(string pchRenderModelName, string pchComponentName, System.Text.StringBuilder pchComponentRenderModelName, uint unComponentRenderModelNameLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentRenderModelName GetComponentRenderModelName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetComponentStateForDevicePath(string pchRenderModelName, string pchComponentName, ulong devicePath, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentStateForDevicePath GetComponentStateForDevicePath;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetComponentState(string pchRenderModelName, string pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetComponentState GetComponentState;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _RenderModelHasComponent(string pchRenderModelName, string pchComponentName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RenderModelHasComponent RenderModelHasComponent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetRenderModelThumbnailURL(string pchRenderModelName, System.Text.StringBuilder pchThumbnailURL, uint unThumbnailURLLen, ref EVRRenderModelError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRenderModelThumbnailURL GetRenderModelThumbnailURL;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetRenderModelOriginalPath(string pchRenderModelName, System.Text.StringBuilder pchOriginalPath, uint unOriginalPathLen, ref EVRRenderModelError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRenderModelOriginalPath GetRenderModelOriginalPath;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetRenderModelErrorNameFromEnum(EVRRenderModelError error);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetRenderModelErrorNameFromEnum GetRenderModelErrorNameFromEnum;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRNotifications
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRNotificationError _CreateNotification(ulong ulOverlayHandle, ulong ulUserValue, EVRNotificationType type, string pchText, EVRNotificationStyle style, ref NotificationBitmap_t pImage, ref uint pNotificationId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateNotification CreateNotification;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRNotificationError _RemoveNotification(uint notificationId);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RemoveNotification RemoveNotification;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRSettings
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate IntPtr _GetSettingsErrorNameFromEnum(EVRSettingsError eError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _Sync(bool bForce, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Sync Sync;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetBool(string pchSection, string pchSettingsKey, bool bValue, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetBool SetBool;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetInt32(string pchSection, string pchSettingsKey, int nValue, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetInt32 SetInt32;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetFloat(string pchSection, string pchSettingsKey, float flValue, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetFloat SetFloat;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _SetString(string pchSection, string pchSettingsKey, string pchValue, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetString SetString;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetBool(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBool GetBool;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate int _GetInt32(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetInt32 GetInt32;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate float _GetFloat(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetFloat GetFloat;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _GetString(string pchSection, string pchSettingsKey, System.Text.StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetString GetString;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _RemoveSection(string pchSection, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RemoveSection RemoveSection;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate void _RemoveKeyInSection(string pchSection, string pchSettingsKey, ref EVRSettingsError peError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RemoveKeyInSection RemoveKeyInSection;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRScreenshots
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotError _RequestScreenshot(ref uint pOutScreenshotHandle, EVRScreenshotType type, string pchPreviewFilename, string pchVRFilename);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _RequestScreenshot RequestScreenshot;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotError _HookScreenshot([In, Out] EVRScreenshotType[] pSupportedTypes, int numTypes);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HookScreenshot HookScreenshot;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotType _GetScreenshotPropertyType(uint screenshotHandle, ref EVRScreenshotError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetScreenshotPropertyType GetScreenshotPropertyType;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetScreenshotPropertyFilename(uint screenshotHandle, EVRScreenshotPropertyFilenames filenameType, System.Text.StringBuilder pchFilename, uint cchFilename, ref EVRScreenshotError pError);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetScreenshotPropertyFilename GetScreenshotPropertyFilename;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotError _UpdateScreenshotProgress(uint screenshotHandle, float flProgress);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _UpdateScreenshotProgress UpdateScreenshotProgress;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotError _TakeStereoScreenshot(ref uint pOutScreenshotHandle, string pchPreviewFilename, string pchVRFilename);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _TakeStereoScreenshot TakeStereoScreenshot;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRScreenshotError _SubmitScreenshot(uint screenshotHandle, EVRScreenshotType type, string pchSourcePreviewFilename, string pchSourceVRFilename);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SubmitScreenshot SubmitScreenshot;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRResources
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _LoadSharedResource(string pchResourceName, string pchBuffer, uint unBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadSharedResource LoadSharedResource;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetResourceFullPath(string pchResourceName, string pchResourceTypeDirectory, System.Text.StringBuilder pchPathBuffer, uint unBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetResourceFullPath GetResourceFullPath;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRDriverManager
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetDriverCount();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDriverCount GetDriverCount;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _GetDriverName(uint nDriver, System.Text.StringBuilder pchValue, uint unBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDriverName GetDriverName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _GetDriverHandle(string pchDriverName);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDriverHandle GetDriverHandle;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsEnabled(uint nDriver);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsEnabled IsEnabled;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRInput
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _SetActionManifestPath(string pchActionManifestPath);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _SetActionManifestPath SetActionManifestPath;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetActionSetHandle(string pchActionSetName, ref ulong pHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetActionSetHandle GetActionSetHandle;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetActionHandle(string pchActionName, ref ulong pHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetActionHandle GetActionHandle;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetInputSourceHandle(string pchInputSourcePath, ref ulong pHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetInputSourceHandle GetInputSourceHandle;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _UpdateActionState([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _UpdateActionState UpdateActionState;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetDigitalActionData(ulong action, ref InputDigitalActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetDigitalActionData GetDigitalActionData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetAnalogActionData(ulong action, ref InputAnalogActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetAnalogActionData GetAnalogActionData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetPoseActionDataRelativeToNow(ulong action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPoseActionDataRelativeToNow GetPoseActionDataRelativeToNow;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetPoseActionDataForNextFrame(ulong action, ETrackingUniverseOrigin eOrigin, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetPoseActionDataForNextFrame GetPoseActionDataForNextFrame;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalActionData(ulong action, ref InputSkeletalActionData_t pActionData, uint unActionDataSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalActionData GetSkeletalActionData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetBoneCount(ulong action, ref uint pBoneCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBoneCount GetBoneCount;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetBoneHierarchy(ulong action, [In, Out] int[] pParentIndices, uint unIndexArayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBoneHierarchy GetBoneHierarchy;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetBoneName(ulong action, int nBoneIndex, System.Text.StringBuilder pchBoneName, uint unNameBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetBoneName GetBoneName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalReferenceTransforms(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalReferencePose eReferencePose, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalReferenceTransforms GetSkeletalReferenceTransforms;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalTrackingLevel(ulong action, ref EVRSkeletalTrackingLevel pSkeletalTrackingLevel);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalTrackingLevel GetSkeletalTrackingLevel;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalBoneData(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalMotionRange eMotionRange, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalBoneData GetSkeletalBoneData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalSummaryData(ulong action, EVRSummaryType eSummaryType, ref VRSkeletalSummaryData_t pSkeletalSummaryData);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalSummaryData GetSkeletalSummaryData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetSkeletalBoneDataCompressed(ulong action, EVRSkeletalMotionRange eMotionRange, IntPtr pvCompressedData, uint unCompressedSize, ref uint punRequiredCompressedSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSkeletalBoneDataCompressed GetSkeletalBoneDataCompressed;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _DecompressSkeletalBoneData(IntPtr pvCompressedBuffer, uint unCompressedBufferSize, EVRSkeletalTransformSpace eTransformSpace, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _DecompressSkeletalBoneData DecompressSkeletalBoneData;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _TriggerHapticVibrationAction(ulong action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude, ulong ulRestrictToDevice);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _TriggerHapticVibrationAction TriggerHapticVibrationAction;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetActionOrigins(ulong actionSetHandle, ulong digitalActionHandle, [In, Out] ulong[] originsOut, uint originOutCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetActionOrigins GetActionOrigins;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetOriginLocalizedName(ulong origin, System.Text.StringBuilder pchNameArray, uint unNameArraySize, int unStringSectionsToInclude);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOriginLocalizedName GetOriginLocalizedName;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetOriginTrackedDeviceInfo(ulong origin, ref InputOriginInfo_t pOriginInfo, uint unOriginInfoSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetOriginTrackedDeviceInfo GetOriginTrackedDeviceInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _GetActionBindingInfo(ulong action, ref InputBindingInfo_t pOriginInfo, uint unBindingInfoSize, uint unBindingInfoCount, ref uint punReturnedBindingInfoCount);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetActionBindingInfo GetActionBindingInfo;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _ShowActionOrigins(ulong actionSetHandle, ulong ulActionHandle);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowActionOrigins ShowActionOrigins;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRInputError _ShowBindingsForActionSet([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount, ulong originToHighlight);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _ShowBindingsForActionSet ShowBindingsForActionSet;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _IsUsingLegacyInput();
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _IsUsingLegacyInput IsUsingLegacyInput;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRIOBuffer
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EIOBufferError _Open(string pchPath, EIOBufferMode mode, uint unElementSize, uint unElements, ref ulong pulBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Open Open;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EIOBufferError _Close(ulong ulBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Close Close;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EIOBufferError _Read(ulong ulBuffer, IntPtr pDst, uint unBytes, ref uint punRead);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Read Read;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EIOBufferError _Write(ulong ulBuffer, IntPtr pSrc, uint unBytes);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _Write Write;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate ulong _PropertyContainer(ulong ulBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _PropertyContainer PropertyContainer;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _HasReaders(ulong ulBuffer);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _HasReaders HasReaders;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRSpatialAnchors
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromDescriptor(string pchDescriptor, ref uint pHandleOut);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateSpatialAnchorFromDescriptor CreateSpatialAnchorFromDescriptor;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromPose(uint unDeviceIndex, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPose, ref uint pHandleOut);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _CreateSpatialAnchorFromPose CreateSpatialAnchorFromPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRSpatialAnchorError _GetSpatialAnchorPose(uint unHandle, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPoseOut);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSpatialAnchorPose GetSpatialAnchorPose;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRSpatialAnchorError _GetSpatialAnchorDescriptor(uint unHandle, System.Text.StringBuilder pchDescriptorOut, ref uint punDescriptorBufferLenInOut);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _GetSpatialAnchorDescriptor GetSpatialAnchorDescriptor;
}
[StructLayout(LayoutKind.Sequential)]
public struct IVRDebug
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRDebugError _EmitVrProfilerEvent(string pchMessage);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _EmitVrProfilerEvent EmitVrProfilerEvent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRDebugError _BeginVrProfilerEvent(ref ulong pHandleOut);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _BeginVrProfilerEvent BeginVrProfilerEvent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate EVRDebugError _FinishVrProfilerEvent(ulong hHandle, string pchMessage);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _FinishVrProfilerEvent FinishVrProfilerEvent;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _DriverDebugRequest(uint unDeviceIndex, string pchRequest, System.Text.StringBuilder pchResponseBuffer, uint unResponseBufferSize);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _DriverDebugRequest DriverDebugRequest;
}
public class CVRSystem
{
IVRSystem FnTable;
internal CVRSystem(IntPtr pInterface)
{
FnTable = (IVRSystem)Marshal.PtrToStructure(pInterface, typeof(IVRSystem));
}
public void GetRecommendedRenderTargetSize(ref uint pnWidth,ref uint pnHeight)
{
pnWidth = 0;
pnHeight = 0;
FnTable.GetRecommendedRenderTargetSize(ref pnWidth,ref pnHeight);
}
public HmdMatrix44_t GetProjectionMatrix(EVREye eEye,float fNearZ,float fFarZ)
{
HmdMatrix44_t result = FnTable.GetProjectionMatrix(eEye,fNearZ,fFarZ);
return result;
}
public void GetProjectionRaw(EVREye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom)
{
pfLeft = 0;
pfRight = 0;
pfTop = 0;
pfBottom = 0;
FnTable.GetProjectionRaw(eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom);
}
public bool ComputeDistortion(EVREye eEye,float fU,float fV,ref DistortionCoordinates_t pDistortionCoordinates)
{
bool result = FnTable.ComputeDistortion(eEye,fU,fV,ref pDistortionCoordinates);
return result;
}
public HmdMatrix34_t GetEyeToHeadTransform(EVREye eEye)
{
HmdMatrix34_t result = FnTable.GetEyeToHeadTransform(eEye);
return result;
}
public bool GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync,ref ulong pulFrameCounter)
{
pfSecondsSinceLastVsync = 0;
pulFrameCounter = 0;
bool result = FnTable.GetTimeSinceLastVsync(ref pfSecondsSinceLastVsync,ref pulFrameCounter);
return result;
}
public int GetD3D9AdapterIndex()
{
int result = FnTable.GetD3D9AdapterIndex();
return result;
}
public void GetDXGIOutputInfo(ref int pnAdapterIndex)
{
pnAdapterIndex = 0;
FnTable.GetDXGIOutputInfo(ref pnAdapterIndex);
}
public void GetOutputDevice(ref ulong pnDevice,ETextureType textureType,IntPtr pInstance)
{
pnDevice = 0;
FnTable.GetOutputDevice(ref pnDevice,textureType,pInstance);
}
public bool IsDisplayOnDesktop()
{
bool result = FnTable.IsDisplayOnDesktop();
return result;
}
public bool SetDisplayVisibility(bool bIsVisibleOnDesktop)
{
bool result = FnTable.SetDisplayVisibility(bIsVisibleOnDesktop);
return result;
}
public void GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,float fPredictedSecondsToPhotonsFromNow,TrackedDevicePose_t [] pTrackedDevicePoseArray)
{
FnTable.GetDeviceToAbsoluteTrackingPose(eOrigin,fPredictedSecondsToPhotonsFromNow,pTrackedDevicePoseArray,(uint) pTrackedDevicePoseArray.Length);
}
public void ResetSeatedZeroPose()
{
FnTable.ResetSeatedZeroPose();
}
public HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose()
{
HmdMatrix34_t result = FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
return result;
}
public HmdMatrix34_t GetRawZeroPoseToStandingAbsoluteTrackingPose()
{
HmdMatrix34_t result = FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose();
return result;
}
public uint GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass,uint [] punTrackedDeviceIndexArray,uint unRelativeToTrackedDeviceIndex)
{
uint result = FnTable.GetSortedTrackedDeviceIndicesOfClass(eTrackedDeviceClass,punTrackedDeviceIndexArray,(uint) punTrackedDeviceIndexArray.Length,unRelativeToTrackedDeviceIndex);
return result;
}
public EDeviceActivityLevel GetTrackedDeviceActivityLevel(uint unDeviceId)
{
EDeviceActivityLevel result = FnTable.GetTrackedDeviceActivityLevel(unDeviceId);
return result;
}
public void ApplyTransform(ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pTrackedDevicePose,ref HmdMatrix34_t pTransform)
{
FnTable.ApplyTransform(ref pOutputPose,ref pTrackedDevicePose,ref pTransform);
}
public uint GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType)
{
uint result = FnTable.GetTrackedDeviceIndexForControllerRole(unDeviceType);
return result;
}
public ETrackedControllerRole GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex)
{
ETrackedControllerRole result = FnTable.GetControllerRoleForTrackedDeviceIndex(unDeviceIndex);
return result;
}
public ETrackedDeviceClass GetTrackedDeviceClass(uint unDeviceIndex)
{
ETrackedDeviceClass result = FnTable.GetTrackedDeviceClass(unDeviceIndex);
return result;
}
public bool IsTrackedDeviceConnected(uint unDeviceIndex)
{
bool result = FnTable.IsTrackedDeviceConnected(unDeviceIndex);
return result;
}
public bool GetBoolTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
{
bool result = FnTable.GetBoolTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
return result;
}
public float GetFloatTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
{
float result = FnTable.GetFloatTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
return result;
}
public int GetInt32TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
{
int result = FnTable.GetInt32TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
return result;
}
public ulong GetUint64TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
{
ulong result = FnTable.GetUint64TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
return result;
}
public HmdMatrix34_t GetMatrix34TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
{
HmdMatrix34_t result = FnTable.GetMatrix34TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
return result;
}
public uint GetArrayTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,uint propType,IntPtr pBuffer,uint unBufferSize,ref ETrackedPropertyError pError)
{
uint result = FnTable.GetArrayTrackedDeviceProperty(unDeviceIndex,prop,propType,pBuffer,unBufferSize,ref pError);
return result;
}
public uint GetStringTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,System.Text.StringBuilder pchValue,uint unBufferSize,ref ETrackedPropertyError pError)
{
uint result = FnTable.GetStringTrackedDeviceProperty(unDeviceIndex,prop,pchValue,unBufferSize,ref pError);
return result;
}
public string GetPropErrorNameFromEnum(ETrackedPropertyError error)
{
IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
return Marshal.PtrToStringAnsi(result);
}
// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _PollNextEventPacked(ref VREvent_t_Packed pEvent,uint uncbVREvent);
[StructLayout(LayoutKind.Explicit)]
struct PollNextEventUnion
{
[FieldOffset(0)]
public IVRSystem._PollNextEvent pPollNextEvent;
[FieldOffset(0)]
public _PollNextEventPacked pPollNextEventPacked;
}
public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
{
#if !UNITY_METRO
if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
PollNextEventUnion u;
VREvent_t_Packed event_packed = new VREvent_t_Packed();
u.pPollNextEventPacked = null;
u.pPollNextEvent = FnTable.PollNextEvent;
bool packed_result = u.pPollNextEventPacked(ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
event_packed.Unpack(ref pEvent);
return packed_result;
}
#endif
bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
return result;
}
public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
{
bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
return result;
}
public string GetEventTypeNameFromEnum(EVREventType eType)
{
IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
return Marshal.PtrToStringAnsi(result);
}
public HiddenAreaMesh_t GetHiddenAreaMesh(EVREye eEye,EHiddenAreaMeshType type)
{
HiddenAreaMesh_t result = FnTable.GetHiddenAreaMesh(eEye,type);
return result;
}
// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerStatePacked(uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize);
[StructLayout(LayoutKind.Explicit)]
struct GetControllerStateUnion
{
[FieldOffset(0)]
public IVRSystem._GetControllerState pGetControllerState;
[FieldOffset(0)]
public _GetControllerStatePacked pGetControllerStatePacked;
}
public bool GetControllerState(uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize)
{
#if !UNITY_METRO
if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
GetControllerStateUnion u;
VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
u.pGetControllerStatePacked = null;
u.pGetControllerState = FnTable.GetControllerState;
bool packed_result = u.pGetControllerStatePacked(unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)));
state_packed.Unpack(ref pControllerState);
return packed_result;
}
#endif
bool result = FnTable.GetControllerState(unControllerDeviceIndex,ref pControllerState,unControllerStateSize);
return result;
}
// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _GetControllerStateWithPosePacked(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose);
[StructLayout(LayoutKind.Explicit)]
struct GetControllerStateWithPoseUnion
{
[FieldOffset(0)]
public IVRSystem._GetControllerStateWithPose pGetControllerStateWithPose;
[FieldOffset(0)]
public _GetControllerStateWithPosePacked pGetControllerStateWithPosePacked;
}
public bool GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose)
{
#if !UNITY_METRO
if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
GetControllerStateWithPoseUnion u;
VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
u.pGetControllerStateWithPosePacked = null;
u.pGetControllerStateWithPose = FnTable.GetControllerStateWithPose;
bool packed_result = u.pGetControllerStateWithPosePacked(eOrigin,unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)),ref pTrackedDevicePose);
state_packed.Unpack(ref pControllerState);
return packed_result;
}
#endif
bool result = FnTable.GetControllerStateWithPose(eOrigin,unControllerDeviceIndex,ref pControllerState,unControllerStateSize,ref pTrackedDevicePose);
return result;
}
public void TriggerHapticPulse(uint unControllerDeviceIndex,uint unAxisId,ushort usDurationMicroSec)
{
FnTable.TriggerHapticPulse(unControllerDeviceIndex,unAxisId,usDurationMicroSec);
}
public string GetButtonIdNameFromEnum(EVRButtonId eButtonId)
{
IntPtr result = FnTable.GetButtonIdNameFromEnum(eButtonId);
return Marshal.PtrToStringAnsi(result);
}
public string GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType)
{
IntPtr result = FnTable.GetControllerAxisTypeNameFromEnum(eAxisType);
return Marshal.PtrToStringAnsi(result);
}
public bool IsInputAvailable()
{
bool result = FnTable.IsInputAvailable();
return result;
}
public bool IsSteamVRDrawingControllers()
{
bool result = FnTable.IsSteamVRDrawingControllers();
return result;
}
public bool ShouldApplicationPause()
{
bool result = FnTable.ShouldApplicationPause();
return result;
}
public bool ShouldApplicationReduceRenderingWork()
{
bool result = FnTable.ShouldApplicationReduceRenderingWork();
return result;
}
public EVRFirmwareError PerformFirmwareUpdate(uint unDeviceIndex)
{
EVRFirmwareError result = FnTable.PerformFirmwareUpdate(unDeviceIndex);
return result;
}
public void AcknowledgeQuit_Exiting()
{
FnTable.AcknowledgeQuit_Exiting();
}
public void AcknowledgeQuit_UserPrompt()
{
FnTable.AcknowledgeQuit_UserPrompt();
}
public uint GetAppContainerFilePaths(System.Text.StringBuilder pchBuffer,uint unBufferSize)
{
uint result = FnTable.GetAppContainerFilePaths(pchBuffer,unBufferSize);
return result;
}
public string GetRuntimeVersion()
{
IntPtr result = FnTable.GetRuntimeVersion();
return Marshal.PtrToStringAnsi(result);
}
}
public class CVRExtendedDisplay
{
IVRExtendedDisplay FnTable;
internal CVRExtendedDisplay(IntPtr pInterface)
{
FnTable = (IVRExtendedDisplay)Marshal.PtrToStructure(pInterface, typeof(IVRExtendedDisplay));
}
public void GetWindowBounds(ref int pnX,ref int pnY,ref uint pnWidth,ref uint pnHeight)
{
pnX = 0;
pnY = 0;
pnWidth = 0;
pnHeight = 0;
FnTable.GetWindowBounds(ref pnX,ref pnY,ref pnWidth,ref pnHeight);
}
public void GetEyeOutputViewport(EVREye eEye,ref uint pnX,ref uint pnY,ref uint pnWidth,ref uint pnHeight)
{
pnX = 0;
pnY = 0;
pnWidth = 0;
pnHeight = 0;
FnTable.GetEyeOutputViewport(eEye,ref pnX,ref pnY,ref pnWidth,ref pnHeight);
}
public void GetDXGIOutputInfo(ref int pnAdapterIndex,ref int pnAdapterOutputIndex)
{
pnAdapterIndex = 0;
pnAdapterOutputIndex = 0;
FnTable.GetDXGIOutputInfo(ref pnAdapterIndex,ref pnAdapterOutputIndex);
}
}
public class CVRTrackedCamera
{
IVRTrackedCamera FnTable;
internal CVRTrackedCamera(IntPtr pInterface)
{
FnTable = (IVRTrackedCamera)Marshal.PtrToStructure(pInterface, typeof(IVRTrackedCamera));
}
public string GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError)
{
IntPtr result = FnTable.GetCameraErrorNameFromEnum(eCameraError);
return Marshal.PtrToStringAnsi(result);
}
public EVRTrackedCameraError HasCamera(uint nDeviceIndex,ref bool pHasCamera)
{
pHasCamera = false;
EVRTrackedCameraError result = FnTable.HasCamera(nDeviceIndex,ref pHasCamera);
return result;
}
public EVRTrackedCameraError GetCameraFrameSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref uint pnWidth,ref uint pnHeight,ref uint pnFrameBufferSize)
{
pnWidth = 0;
pnHeight = 0;
pnFrameBufferSize = 0;
EVRTrackedCameraError result = FnTable.GetCameraFrameSize(nDeviceIndex,eFrameType,ref pnWidth,ref pnHeight,ref pnFrameBufferSize);
return result;
}
public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex,uint nCameraIndex,EVRTrackedCameraFrameType eFrameType,ref HmdVector2_t pFocalLength,ref HmdVector2_t pCenter)
{
EVRTrackedCameraError result = FnTable.GetCameraIntrinsics(nDeviceIndex,nCameraIndex,eFrameType,ref pFocalLength,ref pCenter);
return result;
}
public EVRTrackedCameraError GetCameraProjection(uint nDeviceIndex,uint nCameraIndex,EVRTrackedCameraFrameType eFrameType,float flZNear,float flZFar,ref HmdMatrix44_t pProjection)
{
EVRTrackedCameraError result = FnTable.GetCameraProjection(nDeviceIndex,nCameraIndex,eFrameType,flZNear,flZFar,ref pProjection);
return result;
}
public EVRTrackedCameraError AcquireVideoStreamingService(uint nDeviceIndex,ref ulong pHandle)
{
pHandle = 0;
EVRTrackedCameraError result = FnTable.AcquireVideoStreamingService(nDeviceIndex,ref pHandle);
return result;
}
public EVRTrackedCameraError ReleaseVideoStreamingService(ulong hTrackedCamera)
{
EVRTrackedCameraError result = FnTable.ReleaseVideoStreamingService(hTrackedCamera);
return result;
}
public EVRTrackedCameraError GetVideoStreamFrameBuffer(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pFrameBuffer,uint nFrameBufferSize,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
{
EVRTrackedCameraError result = FnTable.GetVideoStreamFrameBuffer(hTrackedCamera,eFrameType,pFrameBuffer,nFrameBufferSize,ref pFrameHeader,nFrameHeaderSize);
return result;
}
public EVRTrackedCameraError GetVideoStreamTextureSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref VRTextureBounds_t pTextureBounds,ref uint pnWidth,ref uint pnHeight)
{
pnWidth = 0;
pnHeight = 0;
EVRTrackedCameraError result = FnTable.GetVideoStreamTextureSize(nDeviceIndex,eFrameType,ref pTextureBounds,ref pnWidth,ref pnHeight);
return result;
}
public EVRTrackedCameraError GetVideoStreamTextureD3D11(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
{
EVRTrackedCameraError result = FnTable.GetVideoStreamTextureD3D11(hTrackedCamera,eFrameType,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView,ref pFrameHeader,nFrameHeaderSize);
return result;
}
public EVRTrackedCameraError GetVideoStreamTextureGL(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,ref uint pglTextureId,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
{
pglTextureId = 0;
EVRTrackedCameraError result = FnTable.GetVideoStreamTextureGL(hTrackedCamera,eFrameType,ref pglTextureId,ref pFrameHeader,nFrameHeaderSize);
return result;
}
public EVRTrackedCameraError ReleaseVideoStreamTextureGL(ulong hTrackedCamera,uint glTextureId)
{
EVRTrackedCameraError result = FnTable.ReleaseVideoStreamTextureGL(hTrackedCamera,glTextureId);
return result;
}
public void SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse)
{
FnTable.SetCameraTrackingSpace(eUniverse);
}
public ETrackingUniverseOrigin GetCameraTrackingSpace()
{
ETrackingUniverseOrigin result = FnTable.GetCameraTrackingSpace();
return result;
}
}
public class CVRApplications
{
IVRApplications FnTable;
internal CVRApplications(IntPtr pInterface)
{
FnTable = (IVRApplications)Marshal.PtrToStructure(pInterface, typeof(IVRApplications));
}
public EVRApplicationError AddApplicationManifest(string pchApplicationManifestFullPath,bool bTemporary)
{
EVRApplicationError result = FnTable.AddApplicationManifest(pchApplicationManifestFullPath,bTemporary);
return result;
}
public EVRApplicationError RemoveApplicationManifest(string pchApplicationManifestFullPath)
{
EVRApplicationError result = FnTable.RemoveApplicationManifest(pchApplicationManifestFullPath);
return result;
}
public bool IsApplicationInstalled(string pchAppKey)
{
bool result = FnTable.IsApplicationInstalled(pchAppKey);
return result;
}
public uint GetApplicationCount()
{
uint result = FnTable.GetApplicationCount();
return result;
}
public EVRApplicationError GetApplicationKeyByIndex(uint unApplicationIndex,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
{
EVRApplicationError result = FnTable.GetApplicationKeyByIndex(unApplicationIndex,pchAppKeyBuffer,unAppKeyBufferLen);
return result;
}
public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
{
EVRApplicationError result = FnTable.GetApplicationKeyByProcessId(unProcessId,pchAppKeyBuffer,unAppKeyBufferLen);
return result;
}
public EVRApplicationError LaunchApplication(string pchAppKey)
{
EVRApplicationError result = FnTable.LaunchApplication(pchAppKey);
return result;
}
public EVRApplicationError LaunchTemplateApplication(string pchTemplateAppKey,string pchNewAppKey,AppOverrideKeys_t [] pKeys)
{
EVRApplicationError result = FnTable.LaunchTemplateApplication(pchTemplateAppKey,pchNewAppKey,pKeys,(uint) pKeys.Length);
return result;
}
public EVRApplicationError LaunchApplicationFromMimeType(string pchMimeType,string pchArgs)
{
EVRApplicationError result = FnTable.LaunchApplicationFromMimeType(pchMimeType,pchArgs);
return result;
}
public EVRApplicationError LaunchDashboardOverlay(string pchAppKey)
{
EVRApplicationError result = FnTable.LaunchDashboardOverlay(pchAppKey);
return result;
}
public bool CancelApplicationLaunch(string pchAppKey)
{
bool result = FnTable.CancelApplicationLaunch(pchAppKey);
return result;
}
public EVRApplicationError IdentifyApplication(uint unProcessId,string pchAppKey)
{
EVRApplicationError result = FnTable.IdentifyApplication(unProcessId,pchAppKey);
return result;
}
public uint GetApplicationProcessId(string pchAppKey)
{
uint result = FnTable.GetApplicationProcessId(pchAppKey);
return result;
}
public string GetApplicationsErrorNameFromEnum(EVRApplicationError error)
{
IntPtr result = FnTable.GetApplicationsErrorNameFromEnum(error);
return Marshal.PtrToStringAnsi(result);
}
public uint GetApplicationPropertyString(string pchAppKey,EVRApplicationProperty eProperty,System.Text.StringBuilder pchPropertyValueBuffer,uint unPropertyValueBufferLen,ref EVRApplicationError peError)
{
uint result = FnTable.GetApplicationPropertyString(pchAppKey,eProperty,pchPropertyValueBuffer,unPropertyValueBufferLen,ref peError);
return result;
}
public bool GetApplicationPropertyBool(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
{
bool result = FnTable.GetApplicationPropertyBool(pchAppKey,eProperty,ref peError);
return result;
}
public ulong GetApplicationPropertyUint64(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
{
ulong result = FnTable.GetApplicationPropertyUint64(pchAppKey,eProperty,ref peError);
return result;
}
public EVRApplicationError SetApplicationAutoLaunch(string pchAppKey,bool bAutoLaunch)
{
EVRApplicationError result = FnTable.SetApplicationAutoLaunch(pchAppKey,bAutoLaunch);
return result;
}
public bool GetApplicationAutoLaunch(string pchAppKey)
{
bool result = FnTable.GetApplicationAutoLaunch(pchAppKey);
return result;
}
public EVRApplicationError SetDefaultApplicationForMimeType(string pchAppKey,string pchMimeType)
{
EVRApplicationError result = FnTable.SetDefaultApplicationForMimeType(pchAppKey,pchMimeType);
return result;
}
public bool GetDefaultApplicationForMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
{
bool result = FnTable.GetDefaultApplicationForMimeType(pchMimeType,pchAppKeyBuffer,unAppKeyBufferLen);
return result;
}
public bool GetApplicationSupportedMimeTypes(string pchAppKey,System.Text.StringBuilder pchMimeTypesBuffer,uint unMimeTypesBuffer)
{
bool result = FnTable.GetApplicationSupportedMimeTypes(pchAppKey,pchMimeTypesBuffer,unMimeTypesBuffer);
return result;
}
public uint GetApplicationsThatSupportMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer)
{
uint result = FnTable.GetApplicationsThatSupportMimeType(pchMimeType,pchAppKeysThatSupportBuffer,unAppKeysThatSupportBuffer);
return result;
}
public uint GetApplicationLaunchArguments(uint unHandle,System.Text.StringBuilder pchArgs,uint unArgs)
{
uint result = FnTable.GetApplicationLaunchArguments(unHandle,pchArgs,unArgs);
return result;
}
public EVRApplicationError GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
{
EVRApplicationError result = FnTable.GetStartingApplication(pchAppKeyBuffer,unAppKeyBufferLen);
return result;
}
public EVRApplicationTransitionState GetTransitionState()
{
EVRApplicationTransitionState result = FnTable.GetTransitionState();
return result;
}
public EVRApplicationError PerformApplicationPrelaunchCheck(string pchAppKey)
{
EVRApplicationError result = FnTable.PerformApplicationPrelaunchCheck(pchAppKey);
return result;
}
public string GetApplicationsTransitionStateNameFromEnum(EVRApplicationTransitionState state)
{
IntPtr result = FnTable.GetApplicationsTransitionStateNameFromEnum(state);
return Marshal.PtrToStringAnsi(result);
}
public bool IsQuitUserPromptRequested()
{
bool result = FnTable.IsQuitUserPromptRequested();
return result;
}
public EVRApplicationError LaunchInternalProcess(string pchBinaryPath,string pchArguments,string pchWorkingDirectory)
{
EVRApplicationError result = FnTable.LaunchInternalProcess(pchBinaryPath,pchArguments,pchWorkingDirectory);
return result;
}
public uint GetCurrentSceneProcessId()
{
uint result = FnTable.GetCurrentSceneProcessId();
return result;
}
}
public class CVRChaperone
{
IVRChaperone FnTable;
internal CVRChaperone(IntPtr pInterface)
{
FnTable = (IVRChaperone)Marshal.PtrToStructure(pInterface, typeof(IVRChaperone));
}
public ChaperoneCalibrationState GetCalibrationState()
{
ChaperoneCalibrationState result = FnTable.GetCalibrationState();
return result;
}
public bool GetPlayAreaSize(ref float pSizeX,ref float pSizeZ)
{
pSizeX = 0;
pSizeZ = 0;
bool result = FnTable.GetPlayAreaSize(ref pSizeX,ref pSizeZ);
return result;
}
public bool GetPlayAreaRect(ref HmdQuad_t rect)
{
bool result = FnTable.GetPlayAreaRect(ref rect);
return result;
}
public void ReloadInfo()
{
FnTable.ReloadInfo();
}
public void SetSceneColor(HmdColor_t color)
{
FnTable.SetSceneColor(color);
}
public void GetBoundsColor(ref HmdColor_t pOutputColorArray,int nNumOutputColors,float flCollisionBoundsFadeDistance,ref HmdColor_t pOutputCameraColor)
{
FnTable.GetBoundsColor(ref pOutputColorArray,nNumOutputColors,flCollisionBoundsFadeDistance,ref pOutputCameraColor);
}
public bool AreBoundsVisible()
{
bool result = FnTable.AreBoundsVisible();
return result;
}
public void ForceBoundsVisible(bool bForce)
{
FnTable.ForceBoundsVisible(bForce);
}
}
public class CVRChaperoneSetup
{
IVRChaperoneSetup FnTable;
internal CVRChaperoneSetup(IntPtr pInterface)
{
FnTable = (IVRChaperoneSetup)Marshal.PtrToStructure(pInterface, typeof(IVRChaperoneSetup));
}
public bool CommitWorkingCopy(EChaperoneConfigFile configFile)
{
bool result = FnTable.CommitWorkingCopy(configFile);
return result;
}
public void RevertWorkingCopy()
{
FnTable.RevertWorkingCopy();
}
public bool GetWorkingPlayAreaSize(ref float pSizeX,ref float pSizeZ)
{
pSizeX = 0;
pSizeZ = 0;
bool result = FnTable.GetWorkingPlayAreaSize(ref pSizeX,ref pSizeZ);
return result;
}
public bool GetWorkingPlayAreaRect(ref HmdQuad_t rect)
{
bool result = FnTable.GetWorkingPlayAreaRect(ref rect);
return result;
}
public bool GetWorkingCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
{
uint punQuadsCount = 0;
bool result = FnTable.GetWorkingCollisionBoundsInfo(null,ref punQuadsCount);
pQuadsBuffer= new HmdQuad_t[punQuadsCount];
result = FnTable.GetWorkingCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
return result;
}
public bool GetLiveCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
{
uint punQuadsCount = 0;
bool result = FnTable.GetLiveCollisionBoundsInfo(null,ref punQuadsCount);
pQuadsBuffer= new HmdQuad_t[punQuadsCount];
result = FnTable.GetLiveCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
return result;
}
public bool GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
{
bool result = FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
return result;
}
public bool GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose)
{
bool result = FnTable.GetWorkingStandingZeroPoseToRawTrackingPose(ref pmatStandingZeroPoseToRawTrackingPose);
return result;
}
public void SetWorkingPlayAreaSize(float sizeX,float sizeZ)
{
FnTable.SetWorkingPlayAreaSize(sizeX,sizeZ);
}
public void SetWorkingCollisionBoundsInfo(HmdQuad_t [] pQuadsBuffer)
{
FnTable.SetWorkingCollisionBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
}
public void SetWorkingPerimeter(HmdVector2_t [] pPointBuffer)
{
FnTable.SetWorkingPerimeter(pPointBuffer,(uint) pPointBuffer.Length);
}
public void SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose)
{
FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose(ref pMatSeatedZeroPoseToRawTrackingPose);
}
public void SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose)
{
FnTable.SetWorkingStandingZeroPoseToRawTrackingPose(ref pMatStandingZeroPoseToRawTrackingPose);
}
public void ReloadFromDisk(EChaperoneConfigFile configFile)
{
FnTable.ReloadFromDisk(configFile);
}
public bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
{
bool result = FnTable.GetLiveSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
return result;
}
public bool ExportLiveToBuffer(System.Text.StringBuilder pBuffer,ref uint pnBufferLength)
{
pnBufferLength = 0;
bool result = FnTable.ExportLiveToBuffer(pBuffer,ref pnBufferLength);
return result;
}
public bool ImportFromBufferToWorking(string pBuffer,uint nImportFlags)
{
bool result = FnTable.ImportFromBufferToWorking(pBuffer,nImportFlags);
return result;
}
public void ShowWorkingSetPreview()
{
FnTable.ShowWorkingSetPreview();
}
public void HideWorkingSetPreview()
{
FnTable.HideWorkingSetPreview();
}
public void RoomSetupStarting()
{
FnTable.RoomSetupStarting();
}
}
public class CVRCompositor
{
IVRCompositor FnTable;
internal CVRCompositor(IntPtr pInterface)
{
FnTable = (IVRCompositor)Marshal.PtrToStructure(pInterface, typeof(IVRCompositor));
}
public void SetTrackingSpace(ETrackingUniverseOrigin eOrigin)
{
FnTable.SetTrackingSpace(eOrigin);
}
public ETrackingUniverseOrigin GetTrackingSpace()
{
ETrackingUniverseOrigin result = FnTable.GetTrackingSpace();
return result;
}
public EVRCompositorError WaitGetPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
{
EVRCompositorError result = FnTable.WaitGetPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
return result;
}
public EVRCompositorError GetLastPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
{
EVRCompositorError result = FnTable.GetLastPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
return result;
}
public EVRCompositorError GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex,ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pOutputGamePose)
{
EVRCompositorError result = FnTable.GetLastPoseForTrackedDeviceIndex(unDeviceIndex,ref pOutputPose,ref pOutputGamePose);
return result;
}
public EVRCompositorError Submit(EVREye eEye,ref Texture_t pTexture,ref VRTextureBounds_t pBounds,EVRSubmitFlags nSubmitFlags)
{
EVRCompositorError result = FnTable.Submit(eEye,ref pTexture,ref pBounds,nSubmitFlags);
return result;
}
public void ClearLastSubmittedFrame()
{
FnTable.ClearLastSubmittedFrame();
}
public void PostPresentHandoff()
{
FnTable.PostPresentHandoff();
}
public bool GetFrameTiming(ref Compositor_FrameTiming pTiming,uint unFramesAgo)
{
bool result = FnTable.GetFrameTiming(ref pTiming,unFramesAgo);
return result;
}
public uint GetFrameTimings(Compositor_FrameTiming [] pTiming)
{
uint result = FnTable.GetFrameTimings(pTiming,(uint) pTiming.Length);
return result;
}
public float GetFrameTimeRemaining()
{
float result = FnTable.GetFrameTimeRemaining();
return result;
}
public void GetCumulativeStats(ref Compositor_CumulativeStats pStats,uint nStatsSizeInBytes)
{
FnTable.GetCumulativeStats(ref pStats,nStatsSizeInBytes);
}
public void FadeToColor(float fSeconds,float fRed,float fGreen,float fBlue,float fAlpha,bool bBackground)
{
FnTable.FadeToColor(fSeconds,fRed,fGreen,fBlue,fAlpha,bBackground);
}
public HmdColor_t GetCurrentFadeColor(bool bBackground)
{
HmdColor_t result = FnTable.GetCurrentFadeColor(bBackground);
return result;
}
public void FadeGrid(float fSeconds,bool bFadeIn)
{
FnTable.FadeGrid(fSeconds,bFadeIn);
}
public float GetCurrentGridAlpha()
{
float result = FnTable.GetCurrentGridAlpha();
return result;
}
public EVRCompositorError SetSkyboxOverride(Texture_t [] pTextures)
{
EVRCompositorError result = FnTable.SetSkyboxOverride(pTextures,(uint) pTextures.Length);
return result;
}
public void ClearSkyboxOverride()
{
FnTable.ClearSkyboxOverride();
}
public void CompositorBringToFront()
{
FnTable.CompositorBringToFront();
}
public void CompositorGoToBack()
{
FnTable.CompositorGoToBack();
}
public void CompositorQuit()
{
FnTable.CompositorQuit();
}
public bool IsFullscreen()
{
bool result = FnTable.IsFullscreen();
return result;
}
public uint GetCurrentSceneFocusProcess()
{
uint result = FnTable.GetCurrentSceneFocusProcess();
return result;
}
public uint GetLastFrameRenderer()
{
uint result = FnTable.GetLastFrameRenderer();
return result;
}
public bool CanRenderScene()
{
bool result = FnTable.CanRenderScene();
return result;
}
public void ShowMirrorWindow()
{
FnTable.ShowMirrorWindow();
}
public void HideMirrorWindow()
{
FnTable.HideMirrorWindow();
}
public bool IsMirrorWindowVisible()
{
bool result = FnTable.IsMirrorWindowVisible();
return result;
}
public void CompositorDumpImages()
{
FnTable.CompositorDumpImages();
}
public bool ShouldAppRenderWithLowResources()
{
bool result = FnTable.ShouldAppRenderWithLowResources();
return result;
}
public void ForceInterleavedReprojectionOn(bool bOverride)
{
FnTable.ForceInterleavedReprojectionOn(bOverride);
}
public void ForceReconnectProcess()
{
FnTable.ForceReconnectProcess();
}
public void SuspendRendering(bool bSuspend)
{
FnTable.SuspendRendering(bSuspend);
}
public EVRCompositorError GetMirrorTextureD3D11(EVREye eEye,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView)
{
EVRCompositorError result = FnTable.GetMirrorTextureD3D11(eEye,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView);
return result;
}
public void ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView)
{
FnTable.ReleaseMirrorTextureD3D11(pD3D11ShaderResourceView);
}
public EVRCompositorError GetMirrorTextureGL(EVREye eEye,ref uint pglTextureId,IntPtr pglSharedTextureHandle)
{
pglTextureId = 0;
EVRCompositorError result = FnTable.GetMirrorTextureGL(eEye,ref pglTextureId,pglSharedTextureHandle);
return result;
}
public bool ReleaseSharedGLTexture(uint glTextureId,IntPtr glSharedTextureHandle)
{
bool result = FnTable.ReleaseSharedGLTexture(glTextureId,glSharedTextureHandle);
return result;
}
public void LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
{
FnTable.LockGLSharedTextureForAccess(glSharedTextureHandle);
}
public void UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
{
FnTable.UnlockGLSharedTextureForAccess(glSharedTextureHandle);
}
public uint GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue,uint unBufferSize)
{
uint result = FnTable.GetVulkanInstanceExtensionsRequired(pchValue,unBufferSize);
return result;
}
public uint GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice,System.Text.StringBuilder pchValue,uint unBufferSize)
{
uint result = FnTable.GetVulkanDeviceExtensionsRequired(pPhysicalDevice,pchValue,unBufferSize);
return result;
}
public void SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode)
{
FnTable.SetExplicitTimingMode(eTimingMode);
}
public EVRCompositorError SubmitExplicitTimingData()
{
EVRCompositorError result = FnTable.SubmitExplicitTimingData();
return result;
}
public bool IsMotionSmoothingEnabled()
{
bool result = FnTable.IsMotionSmoothingEnabled();
return result;
}
public bool IsMotionSmoothingSupported()
{
bool result = FnTable.IsMotionSmoothingSupported();
return result;
}
public bool IsCurrentSceneFocusAppLoading()
{
bool result = FnTable.IsCurrentSceneFocusAppLoading();
return result;
}
}
public class CVROverlay
{
IVROverlay FnTable;
internal CVROverlay(IntPtr pInterface)
{
FnTable = (IVROverlay)Marshal.PtrToStructure(pInterface, typeof(IVROverlay));
}
public EVROverlayError FindOverlay(string pchOverlayKey,ref ulong pOverlayHandle)
{
pOverlayHandle = 0;
EVROverlayError result = FnTable.FindOverlay(pchOverlayKey,ref pOverlayHandle);
return result;
}
public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayName,ref ulong pOverlayHandle)
{
pOverlayHandle = 0;
EVROverlayError result = FnTable.CreateOverlay(pchOverlayKey,pchOverlayName,ref pOverlayHandle);
return result;
}
public EVROverlayError DestroyOverlay(ulong ulOverlayHandle)
{
EVROverlayError result = FnTable.DestroyOverlay(ulOverlayHandle);
return result;
}
public uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
{
uint result = FnTable.GetOverlayKey(ulOverlayHandle,pchValue,unBufferSize,ref pError);
return result;
}
public uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
{
uint result = FnTable.GetOverlayName(ulOverlayHandle,pchValue,unBufferSize,ref pError);
return result;
}
public EVROverlayError SetOverlayName(ulong ulOverlayHandle,string pchName)
{
EVROverlayError result = FnTable.SetOverlayName(ulOverlayHandle,pchName);
return result;
}
public EVROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight)
{
punWidth = 0;
punHeight = 0;
EVROverlayError result = FnTable.GetOverlayImageData(ulOverlayHandle,pvBuffer,unBufferSize,ref punWidth,ref punHeight);
return result;
}
public string GetOverlayErrorNameFromEnum(EVROverlayError error)
{
IntPtr result = FnTable.GetOverlayErrorNameFromEnum(error);
return Marshal.PtrToStringAnsi(result);
}
public EVROverlayError SetOverlayRenderingPid(ulong ulOverlayHandle,uint unPID)
{
EVROverlayError result = FnTable.SetOverlayRenderingPid(ulOverlayHandle,unPID);
return result;
}
public uint GetOverlayRenderingPid(ulong ulOverlayHandle)
{
uint result = FnTable.GetOverlayRenderingPid(ulOverlayHandle);
return result;
}
public EVROverlayError SetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,bool bEnabled)
{
EVROverlayError result = FnTable.SetOverlayFlag(ulOverlayHandle,eOverlayFlag,bEnabled);
return result;
}
public EVROverlayError GetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,ref bool pbEnabled)
{
pbEnabled = false;
EVROverlayError result = FnTable.GetOverlayFlag(ulOverlayHandle,eOverlayFlag,ref pbEnabled);
return result;
}
public EVROverlayError SetOverlayColor(ulong ulOverlayHandle,float fRed,float fGreen,float fBlue)
{
EVROverlayError result = FnTable.SetOverlayColor(ulOverlayHandle,fRed,fGreen,fBlue);
return result;
}
public EVROverlayError GetOverlayColor(ulong ulOverlayHandle,ref float pfRed,ref float pfGreen,ref float pfBlue)
{
pfRed = 0;
pfGreen = 0;
pfBlue = 0;
EVROverlayError result = FnTable.GetOverlayColor(ulOverlayHandle,ref pfRed,ref pfGreen,ref pfBlue);
return result;
}
public EVROverlayError SetOverlayAlpha(ulong ulOverlayHandle,float fAlpha)
{
EVROverlayError result = FnTable.SetOverlayAlpha(ulOverlayHandle,fAlpha);
return result;
}
public EVROverlayError GetOverlayAlpha(ulong ulOverlayHandle,ref float pfAlpha)
{
pfAlpha = 0;
EVROverlayError result = FnTable.GetOverlayAlpha(ulOverlayHandle,ref pfAlpha);
return result;
}
public EVROverlayError SetOverlayTexelAspect(ulong ulOverlayHandle,float fTexelAspect)
{
EVROverlayError result = FnTable.SetOverlayTexelAspect(ulOverlayHandle,fTexelAspect);
return result;
}
public EVROverlayError GetOverlayTexelAspect(ulong ulOverlayHandle,ref float pfTexelAspect)
{
pfTexelAspect = 0;
EVROverlayError result = FnTable.GetOverlayTexelAspect(ulOverlayHandle,ref pfTexelAspect);
return result;
}
public EVROverlayError SetOverlaySortOrder(ulong ulOverlayHandle,uint unSortOrder)
{
EVROverlayError result = FnTable.SetOverlaySortOrder(ulOverlayHandle,unSortOrder);
return result;
}
public EVROverlayError GetOverlaySortOrder(ulong ulOverlayHandle,ref uint punSortOrder)
{
punSortOrder = 0;
EVROverlayError result = FnTable.GetOverlaySortOrder(ulOverlayHandle,ref punSortOrder);
return result;
}
public EVROverlayError SetOverlayWidthInMeters(ulong ulOverlayHandle,float fWidthInMeters)
{
EVROverlayError result = FnTable.SetOverlayWidthInMeters(ulOverlayHandle,fWidthInMeters);
return result;
}
public EVROverlayError GetOverlayWidthInMeters(ulong ulOverlayHandle,ref float pfWidthInMeters)
{
pfWidthInMeters = 0;
EVROverlayError result = FnTable.GetOverlayWidthInMeters(ulOverlayHandle,ref pfWidthInMeters);
return result;
}
public EVROverlayError SetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,float fMinDistanceInMeters,float fMaxDistanceInMeters)
{
EVROverlayError result = FnTable.SetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,fMinDistanceInMeters,fMaxDistanceInMeters);
return result;
}
public EVROverlayError GetOverlayAutoCurveDistanceRangeInMeters(ulong ulOverlayHandle,ref float pfMinDistanceInMeters,ref float pfMaxDistanceInMeters)
{
pfMinDistanceInMeters = 0;
pfMaxDistanceInMeters = 0;
EVROverlayError result = FnTable.GetOverlayAutoCurveDistanceRangeInMeters(ulOverlayHandle,ref pfMinDistanceInMeters,ref pfMaxDistanceInMeters);
return result;
}
public EVROverlayError SetOverlayTextureColorSpace(ulong ulOverlayHandle,EColorSpace eTextureColorSpace)
{
EVROverlayError result = FnTable.SetOverlayTextureColorSpace(ulOverlayHandle,eTextureColorSpace);
return result;
}
public EVROverlayError GetOverlayTextureColorSpace(ulong ulOverlayHandle,ref EColorSpace peTextureColorSpace)
{
EVROverlayError result = FnTable.GetOverlayTextureColorSpace(ulOverlayHandle,ref peTextureColorSpace);
return result;
}
public EVROverlayError SetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
{
EVROverlayError result = FnTable.SetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
return result;
}
public EVROverlayError GetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
{
EVROverlayError result = FnTable.GetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
return result;
}
public uint GetOverlayRenderModel(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref HmdColor_t pColor,ref EVROverlayError pError)
{
uint result = FnTable.GetOverlayRenderModel(ulOverlayHandle,pchValue,unBufferSize,ref pColor,ref pError);
return result;
}
public EVROverlayError SetOverlayRenderModel(ulong ulOverlayHandle,string pchRenderModel,ref HmdColor_t pColor)
{
EVROverlayError result = FnTable.SetOverlayRenderModel(ulOverlayHandle,pchRenderModel,ref pColor);
return result;
}
public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
{
EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
return result;
}
public EVROverlayError SetOverlayTransformAbsolute(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
{
EVROverlayError result = FnTable.SetOverlayTransformAbsolute(ulOverlayHandle,eTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
return result;
}
public EVROverlayError GetOverlayTransformAbsolute(ulong ulOverlayHandle,ref ETrackingUniverseOrigin peTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
{
EVROverlayError result = FnTable.GetOverlayTransformAbsolute(ulOverlayHandle,ref peTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
return result;
}
public EVROverlayError SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,uint unTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
{
EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,unTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
return result;
}
public EVROverlayError GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,ref uint punTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
{
punTrackedDevice = 0;
EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,ref punTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
return result;
}
public EVROverlayError SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,uint unDeviceIndex,string pchComponentName)
{
EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,unDeviceIndex,pchComponentName);
return result;
}
public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameSize)
{
punDeviceIndex = 0;
EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize);
return result;
}
public EVROverlayError GetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ref ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
{
ulOverlayHandleParent = 0;
EVROverlayError result = FnTable.GetOverlayTransformOverlayRelative(ulOverlayHandle,ref ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
return result;
}
public EVROverlayError SetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
{
EVROverlayError result = FnTable.SetOverlayTransformOverlayRelative(ulOverlayHandle,ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
return result;
}
public EVROverlayError ShowOverlay(ulong ulOverlayHandle)
{
EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle);
return result;
}
public EVROverlayError HideOverlay(ulong ulOverlayHandle)
{
EVROverlayError result = FnTable.HideOverlay(ulOverlayHandle);
return result;
}
public bool IsOverlayVisible(ulong ulOverlayHandle)
{
bool result = FnTable.IsOverlayVisible(ulOverlayHandle);
return result;
}
public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
{
EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
return result;
}
// This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
// originally mis-compiled with the wrong packing for Linux and OSX.
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate bool _PollNextOverlayEventPacked(ulong ulOverlayHandle,ref VREvent_t_Packed pEvent,uint uncbVREvent);
[StructLayout(LayoutKind.Explicit)]
struct PollNextOverlayEventUnion
{
[FieldOffset(0)]
public IVROverlay._PollNextOverlayEvent pPollNextOverlayEvent;
[FieldOffset(0)]
public _PollNextOverlayEventPacked pPollNextOverlayEventPacked;
}
public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
{
#if !UNITY_METRO
if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
(System.Environment.OSVersion.Platform == System.PlatformID.Unix))
{
PollNextOverlayEventUnion u;
VREvent_t_Packed event_packed = new VREvent_t_Packed();
u.pPollNextOverlayEventPacked = null;
u.pPollNextOverlayEvent = FnTable.PollNextOverlayEvent;
bool packed_result = u.pPollNextOverlayEventPacked(ulOverlayHandle,ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
event_packed.Unpack(ref pEvent);
return packed_result;
}
#endif
bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
return result;
}
public EVROverlayError GetOverlayInputMethod(ulong ulOverlayHandle,ref VROverlayInputMethod peInputMethod)
{
EVROverlayError result = FnTable.GetOverlayInputMethod(ulOverlayHandle,ref peInputMethod);
return result;
}
public EVROverlayError SetOverlayInputMethod(ulong ulOverlayHandle,VROverlayInputMethod eInputMethod)
{
EVROverlayError result = FnTable.SetOverlayInputMethod(ulOverlayHandle,eInputMethod);
return result;
}
public EVROverlayError GetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
{
EVROverlayError result = FnTable.GetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
return result;
}
public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
{
EVROverlayError result = FnTable.SetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
return result;
}
public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
{
bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults);
return result;
}
public bool IsHoverTargetOverlay(ulong ulOverlayHandle)
{
bool