openvr_api.cs 202 KB

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