openvr_api.cs 208 KB

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