2
0

openvr_api.cs 332 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169
  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. #if !OPENVR_XR_API
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using Valve.VR;
  11. #if UNITY_5_3_OR_NEWER
  12. using UnityEngine;
  13. #endif
  14. namespace Valve.VR
  15. {
  16. [StructLayout(LayoutKind.Sequential)]
  17. public struct IVRSystem
  18. {
  19. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  20. internal delegate void _GetRecommendedRenderTargetSize(ref uint pnWidth, ref uint pnHeight);
  21. [MarshalAs(UnmanagedType.FunctionPtr)]
  22. internal _GetRecommendedRenderTargetSize GetRecommendedRenderTargetSize;
  23. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  24. internal delegate HmdMatrix44_t _GetProjectionMatrix(EVREye eEye, float fNearZ, float fFarZ);
  25. [MarshalAs(UnmanagedType.FunctionPtr)]
  26. internal _GetProjectionMatrix GetProjectionMatrix;
  27. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  28. internal delegate void _GetProjectionRaw(EVREye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
  29. [MarshalAs(UnmanagedType.FunctionPtr)]
  30. internal _GetProjectionRaw GetProjectionRaw;
  31. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  32. internal delegate bool _ComputeDistortion(EVREye eEye, float fU, float fV, ref DistortionCoordinates_t pDistortionCoordinates);
  33. [MarshalAs(UnmanagedType.FunctionPtr)]
  34. internal _ComputeDistortion ComputeDistortion;
  35. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  36. internal delegate HmdMatrix34_t _GetEyeToHeadTransform(EVREye eEye);
  37. [MarshalAs(UnmanagedType.FunctionPtr)]
  38. internal _GetEyeToHeadTransform GetEyeToHeadTransform;
  39. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  40. internal delegate bool _GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync, ref ulong pulFrameCounter);
  41. [MarshalAs(UnmanagedType.FunctionPtr)]
  42. internal _GetTimeSinceLastVsync GetTimeSinceLastVsync;
  43. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  44. internal delegate int _GetD3D9AdapterIndex();
  45. [MarshalAs(UnmanagedType.FunctionPtr)]
  46. internal _GetD3D9AdapterIndex GetD3D9AdapterIndex;
  47. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  48. internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex);
  49. [MarshalAs(UnmanagedType.FunctionPtr)]
  50. internal _GetDXGIOutputInfo GetDXGIOutputInfo;
  51. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  52. internal delegate void _GetOutputDevice(ref ulong pnDevice, ETextureType textureType, IntPtr pInstance);
  53. [MarshalAs(UnmanagedType.FunctionPtr)]
  54. internal _GetOutputDevice GetOutputDevice;
  55. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  56. internal delegate bool _IsDisplayOnDesktop();
  57. [MarshalAs(UnmanagedType.FunctionPtr)]
  58. internal _IsDisplayOnDesktop IsDisplayOnDesktop;
  59. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  60. internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop);
  61. [MarshalAs(UnmanagedType.FunctionPtr)]
  62. internal _SetDisplayVisibility SetDisplayVisibility;
  63. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  64. internal delegate void _GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, [In, Out] TrackedDevicePose_t[] pTrackedDevicePoseArray, uint unTrackedDevicePoseArrayCount);
  65. [MarshalAs(UnmanagedType.FunctionPtr)]
  66. internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose;
  67. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  68. internal delegate 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, ushort 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 EVRFirmwareError _PerformFirmwareUpdate(uint unDeviceIndex);
  189. [MarshalAs(UnmanagedType.FunctionPtr)]
  190. internal _PerformFirmwareUpdate PerformFirmwareUpdate;
  191. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  192. internal delegate void _AcknowledgeQuit_Exiting();
  193. [MarshalAs(UnmanagedType.FunctionPtr)]
  194. internal _AcknowledgeQuit_Exiting AcknowledgeQuit_Exiting;
  195. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  196. internal delegate uint _GetAppContainerFilePaths(System.Text.StringBuilder pchBuffer, uint unBufferSize);
  197. [MarshalAs(UnmanagedType.FunctionPtr)]
  198. internal _GetAppContainerFilePaths GetAppContainerFilePaths;
  199. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  200. internal delegate IntPtr _GetRuntimeVersion();
  201. [MarshalAs(UnmanagedType.FunctionPtr)]
  202. internal _GetRuntimeVersion GetRuntimeVersion;
  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, uint nCameraIndex, 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, uint nCameraIndex, 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. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  272. internal delegate void _SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse);
  273. [MarshalAs(UnmanagedType.FunctionPtr)]
  274. internal _SetCameraTrackingSpace SetCameraTrackingSpace;
  275. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  276. internal delegate ETrackingUniverseOrigin _GetCameraTrackingSpace();
  277. [MarshalAs(UnmanagedType.FunctionPtr)]
  278. internal _GetCameraTrackingSpace GetCameraTrackingSpace;
  279. }
  280. [StructLayout(LayoutKind.Sequential)]
  281. public struct IVRApplications
  282. {
  283. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  284. internal delegate EVRApplicationError _AddApplicationManifest(IntPtr pchApplicationManifestFullPath, bool bTemporary);
  285. [MarshalAs(UnmanagedType.FunctionPtr)]
  286. internal _AddApplicationManifest AddApplicationManifest;
  287. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  288. internal delegate EVRApplicationError _RemoveApplicationManifest(IntPtr pchApplicationManifestFullPath);
  289. [MarshalAs(UnmanagedType.FunctionPtr)]
  290. internal _RemoveApplicationManifest RemoveApplicationManifest;
  291. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  292. internal delegate bool _IsApplicationInstalled(IntPtr pchAppKey);
  293. [MarshalAs(UnmanagedType.FunctionPtr)]
  294. internal _IsApplicationInstalled IsApplicationInstalled;
  295. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  296. internal delegate uint _GetApplicationCount();
  297. [MarshalAs(UnmanagedType.FunctionPtr)]
  298. internal _GetApplicationCount GetApplicationCount;
  299. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  300. internal delegate EVRApplicationError _GetApplicationKeyByIndex(uint unApplicationIndex, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
  301. [MarshalAs(UnmanagedType.FunctionPtr)]
  302. internal _GetApplicationKeyByIndex GetApplicationKeyByIndex;
  303. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  304. internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
  305. [MarshalAs(UnmanagedType.FunctionPtr)]
  306. internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId;
  307. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  308. internal delegate EVRApplicationError _LaunchApplication(IntPtr pchAppKey);
  309. [MarshalAs(UnmanagedType.FunctionPtr)]
  310. internal _LaunchApplication LaunchApplication;
  311. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  312. internal delegate EVRApplicationError _LaunchTemplateApplication(IntPtr pchTemplateAppKey, IntPtr pchNewAppKey, [In, Out] AppOverrideKeys_t[] pKeys, uint unKeys);
  313. [MarshalAs(UnmanagedType.FunctionPtr)]
  314. internal _LaunchTemplateApplication LaunchTemplateApplication;
  315. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  316. internal delegate EVRApplicationError _LaunchApplicationFromMimeType(IntPtr pchMimeType, IntPtr pchArgs);
  317. [MarshalAs(UnmanagedType.FunctionPtr)]
  318. internal _LaunchApplicationFromMimeType LaunchApplicationFromMimeType;
  319. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  320. internal delegate EVRApplicationError _LaunchDashboardOverlay(IntPtr pchAppKey);
  321. [MarshalAs(UnmanagedType.FunctionPtr)]
  322. internal _LaunchDashboardOverlay LaunchDashboardOverlay;
  323. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  324. internal delegate bool _CancelApplicationLaunch(IntPtr pchAppKey);
  325. [MarshalAs(UnmanagedType.FunctionPtr)]
  326. internal _CancelApplicationLaunch CancelApplicationLaunch;
  327. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  328. internal delegate EVRApplicationError _IdentifyApplication(uint unProcessId, IntPtr pchAppKey);
  329. [MarshalAs(UnmanagedType.FunctionPtr)]
  330. internal _IdentifyApplication IdentifyApplication;
  331. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  332. internal delegate uint _GetApplicationProcessId(IntPtr pchAppKey);
  333. [MarshalAs(UnmanagedType.FunctionPtr)]
  334. internal _GetApplicationProcessId GetApplicationProcessId;
  335. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  336. internal delegate IntPtr _GetApplicationsErrorNameFromEnum(EVRApplicationError error);
  337. [MarshalAs(UnmanagedType.FunctionPtr)]
  338. internal _GetApplicationsErrorNameFromEnum GetApplicationsErrorNameFromEnum;
  339. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  340. internal delegate uint _GetApplicationPropertyString(IntPtr pchAppKey, EVRApplicationProperty eProperty, System.Text.StringBuilder pchPropertyValueBuffer, uint unPropertyValueBufferLen, ref EVRApplicationError peError);
  341. [MarshalAs(UnmanagedType.FunctionPtr)]
  342. internal _GetApplicationPropertyString GetApplicationPropertyString;
  343. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  344. internal delegate bool _GetApplicationPropertyBool(IntPtr pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
  345. [MarshalAs(UnmanagedType.FunctionPtr)]
  346. internal _GetApplicationPropertyBool GetApplicationPropertyBool;
  347. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  348. internal delegate ulong _GetApplicationPropertyUint64(IntPtr pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);
  349. [MarshalAs(UnmanagedType.FunctionPtr)]
  350. internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64;
  351. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  352. internal delegate EVRApplicationError _SetApplicationAutoLaunch(IntPtr pchAppKey, bool bAutoLaunch);
  353. [MarshalAs(UnmanagedType.FunctionPtr)]
  354. internal _SetApplicationAutoLaunch SetApplicationAutoLaunch;
  355. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  356. internal delegate bool _GetApplicationAutoLaunch(IntPtr pchAppKey);
  357. [MarshalAs(UnmanagedType.FunctionPtr)]
  358. internal _GetApplicationAutoLaunch GetApplicationAutoLaunch;
  359. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  360. internal delegate EVRApplicationError _SetDefaultApplicationForMimeType(IntPtr pchAppKey, IntPtr pchMimeType);
  361. [MarshalAs(UnmanagedType.FunctionPtr)]
  362. internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType;
  363. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  364. internal delegate bool _GetDefaultApplicationForMimeType(IntPtr pchMimeType, System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
  365. [MarshalAs(UnmanagedType.FunctionPtr)]
  366. internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType;
  367. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  368. internal delegate bool _GetApplicationSupportedMimeTypes(IntPtr pchAppKey, System.Text.StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer);
  369. [MarshalAs(UnmanagedType.FunctionPtr)]
  370. internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes;
  371. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  372. internal delegate uint _GetApplicationsThatSupportMimeType(IntPtr pchMimeType, System.Text.StringBuilder pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer);
  373. [MarshalAs(UnmanagedType.FunctionPtr)]
  374. internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType;
  375. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  376. internal delegate uint _GetApplicationLaunchArguments(uint unHandle, System.Text.StringBuilder pchArgs, uint unArgs);
  377. [MarshalAs(UnmanagedType.FunctionPtr)]
  378. internal _GetApplicationLaunchArguments GetApplicationLaunchArguments;
  379. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  380. internal delegate EVRApplicationError _GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);
  381. [MarshalAs(UnmanagedType.FunctionPtr)]
  382. internal _GetStartingApplication GetStartingApplication;
  383. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  384. internal delegate EVRSceneApplicationState _GetSceneApplicationState();
  385. [MarshalAs(UnmanagedType.FunctionPtr)]
  386. internal _GetSceneApplicationState GetSceneApplicationState;
  387. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  388. internal delegate EVRApplicationError _PerformApplicationPrelaunchCheck(IntPtr pchAppKey);
  389. [MarshalAs(UnmanagedType.FunctionPtr)]
  390. internal _PerformApplicationPrelaunchCheck PerformApplicationPrelaunchCheck;
  391. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  392. internal delegate IntPtr _GetSceneApplicationStateNameFromEnum(EVRSceneApplicationState state);
  393. [MarshalAs(UnmanagedType.FunctionPtr)]
  394. internal _GetSceneApplicationStateNameFromEnum GetSceneApplicationStateNameFromEnum;
  395. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  396. internal delegate EVRApplicationError _LaunchInternalProcess(IntPtr pchBinaryPath, IntPtr pchArguments, IntPtr pchWorkingDirectory);
  397. [MarshalAs(UnmanagedType.FunctionPtr)]
  398. internal _LaunchInternalProcess LaunchInternalProcess;
  399. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  400. internal delegate uint _GetCurrentSceneProcessId();
  401. [MarshalAs(UnmanagedType.FunctionPtr)]
  402. internal _GetCurrentSceneProcessId GetCurrentSceneProcessId;
  403. }
  404. [StructLayout(LayoutKind.Sequential)]
  405. public struct IVRChaperone
  406. {
  407. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  408. internal delegate ChaperoneCalibrationState _GetCalibrationState();
  409. [MarshalAs(UnmanagedType.FunctionPtr)]
  410. internal _GetCalibrationState GetCalibrationState;
  411. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  412. internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ);
  413. [MarshalAs(UnmanagedType.FunctionPtr)]
  414. internal _GetPlayAreaSize GetPlayAreaSize;
  415. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  416. internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect);
  417. [MarshalAs(UnmanagedType.FunctionPtr)]
  418. internal _GetPlayAreaRect GetPlayAreaRect;
  419. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  420. internal delegate void _ReloadInfo();
  421. [MarshalAs(UnmanagedType.FunctionPtr)]
  422. internal _ReloadInfo ReloadInfo;
  423. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  424. internal delegate void _SetSceneColor(HmdColor_t color);
  425. [MarshalAs(UnmanagedType.FunctionPtr)]
  426. internal _SetSceneColor SetSceneColor;
  427. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  428. internal delegate void _GetBoundsColor(ref HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, ref HmdColor_t pOutputCameraColor);
  429. [MarshalAs(UnmanagedType.FunctionPtr)]
  430. internal _GetBoundsColor GetBoundsColor;
  431. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  432. internal delegate bool _AreBoundsVisible();
  433. [MarshalAs(UnmanagedType.FunctionPtr)]
  434. internal _AreBoundsVisible AreBoundsVisible;
  435. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  436. internal delegate void _ForceBoundsVisible(bool bForce);
  437. [MarshalAs(UnmanagedType.FunctionPtr)]
  438. internal _ForceBoundsVisible ForceBoundsVisible;
  439. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  440. internal delegate void _ResetZeroPose(ETrackingUniverseOrigin eTrackingUniverseOrigin);
  441. [MarshalAs(UnmanagedType.FunctionPtr)]
  442. internal _ResetZeroPose ResetZeroPose;
  443. }
  444. [StructLayout(LayoutKind.Sequential)]
  445. public struct IVRChaperoneSetup
  446. {
  447. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  448. internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile);
  449. [MarshalAs(UnmanagedType.FunctionPtr)]
  450. internal _CommitWorkingCopy CommitWorkingCopy;
  451. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  452. internal delegate void _RevertWorkingCopy();
  453. [MarshalAs(UnmanagedType.FunctionPtr)]
  454. internal _RevertWorkingCopy RevertWorkingCopy;
  455. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  456. internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ);
  457. [MarshalAs(UnmanagedType.FunctionPtr)]
  458. internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize;
  459. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  460. internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect);
  461. [MarshalAs(UnmanagedType.FunctionPtr)]
  462. internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect;
  463. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  464. internal delegate bool _GetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
  465. [MarshalAs(UnmanagedType.FunctionPtr)]
  466. internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo;
  467. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  468. internal delegate bool _GetLiveCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);
  469. [MarshalAs(UnmanagedType.FunctionPtr)]
  470. internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo;
  471. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  472. internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
  473. [MarshalAs(UnmanagedType.FunctionPtr)]
  474. internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose;
  475. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  476. internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);
  477. [MarshalAs(UnmanagedType.FunctionPtr)]
  478. internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose;
  479. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  480. internal delegate void _SetWorkingPlayAreaSize(float sizeX, float sizeZ);
  481. [MarshalAs(UnmanagedType.FunctionPtr)]
  482. internal _SetWorkingPlayAreaSize SetWorkingPlayAreaSize;
  483. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  484. internal delegate void _SetWorkingCollisionBoundsInfo([In, Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);
  485. [MarshalAs(UnmanagedType.FunctionPtr)]
  486. internal _SetWorkingCollisionBoundsInfo SetWorkingCollisionBoundsInfo;
  487. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  488. internal delegate void _SetWorkingPerimeter([In, Out] HmdVector2_t[] pPointBuffer, uint unPointCount);
  489. [MarshalAs(UnmanagedType.FunctionPtr)]
  490. internal _SetWorkingPerimeter SetWorkingPerimeter;
  491. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  492. internal delegate void _SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);
  493. [MarshalAs(UnmanagedType.FunctionPtr)]
  494. internal _SetWorkingSeatedZeroPoseToRawTrackingPose SetWorkingSeatedZeroPoseToRawTrackingPose;
  495. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  496. internal delegate void _SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);
  497. [MarshalAs(UnmanagedType.FunctionPtr)]
  498. internal _SetWorkingStandingZeroPoseToRawTrackingPose SetWorkingStandingZeroPoseToRawTrackingPose;
  499. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  500. internal delegate void _ReloadFromDisk(EChaperoneConfigFile configFile);
  501. [MarshalAs(UnmanagedType.FunctionPtr)]
  502. internal _ReloadFromDisk ReloadFromDisk;
  503. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  504. internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);
  505. [MarshalAs(UnmanagedType.FunctionPtr)]
  506. internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose;
  507. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  508. internal delegate bool _ExportLiveToBuffer(System.Text.StringBuilder pBuffer, ref uint pnBufferLength);
  509. [MarshalAs(UnmanagedType.FunctionPtr)]
  510. internal _ExportLiveToBuffer ExportLiveToBuffer;
  511. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  512. internal delegate bool _ImportFromBufferToWorking(IntPtr pBuffer, uint nImportFlags);
  513. [MarshalAs(UnmanagedType.FunctionPtr)]
  514. internal _ImportFromBufferToWorking ImportFromBufferToWorking;
  515. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  516. internal delegate void _ShowWorkingSetPreview();
  517. [MarshalAs(UnmanagedType.FunctionPtr)]
  518. internal _ShowWorkingSetPreview ShowWorkingSetPreview;
  519. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  520. internal delegate void _HideWorkingSetPreview();
  521. [MarshalAs(UnmanagedType.FunctionPtr)]
  522. internal _HideWorkingSetPreview HideWorkingSetPreview;
  523. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  524. internal delegate void _RoomSetupStarting();
  525. [MarshalAs(UnmanagedType.FunctionPtr)]
  526. internal _RoomSetupStarting RoomSetupStarting;
  527. }
  528. [StructLayout(LayoutKind.Sequential)]
  529. public struct IVRCompositor
  530. {
  531. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  532. internal delegate void _SetTrackingSpace(ETrackingUniverseOrigin eOrigin);
  533. [MarshalAs(UnmanagedType.FunctionPtr)]
  534. internal _SetTrackingSpace SetTrackingSpace;
  535. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  536. internal delegate ETrackingUniverseOrigin _GetTrackingSpace();
  537. [MarshalAs(UnmanagedType.FunctionPtr)]
  538. internal _GetTrackingSpace GetTrackingSpace;
  539. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  540. internal delegate EVRCompositorError _WaitGetPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
  541. [MarshalAs(UnmanagedType.FunctionPtr)]
  542. internal _WaitGetPoses WaitGetPoses;
  543. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  544. internal delegate EVRCompositorError _GetLastPoses([In, Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In, Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);
  545. [MarshalAs(UnmanagedType.FunctionPtr)]
  546. internal _GetLastPoses GetLastPoses;
  547. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  548. internal delegate EVRCompositorError _GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex, ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pOutputGamePose);
  549. [MarshalAs(UnmanagedType.FunctionPtr)]
  550. internal _GetLastPoseForTrackedDeviceIndex GetLastPoseForTrackedDeviceIndex;
  551. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  552. internal delegate EVRCompositorError _Submit(EVREye eEye, ref Texture_t pTexture, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags);
  553. [MarshalAs(UnmanagedType.FunctionPtr)]
  554. internal _Submit Submit;
  555. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  556. internal delegate void _ClearLastSubmittedFrame();
  557. [MarshalAs(UnmanagedType.FunctionPtr)]
  558. internal _ClearLastSubmittedFrame ClearLastSubmittedFrame;
  559. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  560. internal delegate void _PostPresentHandoff();
  561. [MarshalAs(UnmanagedType.FunctionPtr)]
  562. internal _PostPresentHandoff PostPresentHandoff;
  563. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  564. internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo);
  565. [MarshalAs(UnmanagedType.FunctionPtr)]
  566. internal _GetFrameTiming GetFrameTiming;
  567. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  568. internal delegate uint _GetFrameTimings([In, Out] Compositor_FrameTiming[] pTiming, uint nFrames);
  569. [MarshalAs(UnmanagedType.FunctionPtr)]
  570. internal _GetFrameTimings GetFrameTimings;
  571. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  572. internal delegate float _GetFrameTimeRemaining();
  573. [MarshalAs(UnmanagedType.FunctionPtr)]
  574. internal _GetFrameTimeRemaining GetFrameTimeRemaining;
  575. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  576. internal delegate void _GetCumulativeStats(ref Compositor_CumulativeStats pStats, uint nStatsSizeInBytes);
  577. [MarshalAs(UnmanagedType.FunctionPtr)]
  578. internal _GetCumulativeStats GetCumulativeStats;
  579. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  580. internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground);
  581. [MarshalAs(UnmanagedType.FunctionPtr)]
  582. internal _FadeToColor FadeToColor;
  583. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  584. internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground);
  585. [MarshalAs(UnmanagedType.FunctionPtr)]
  586. internal _GetCurrentFadeColor GetCurrentFadeColor;
  587. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  588. internal delegate void _FadeGrid(float fSeconds, bool bFadeIn);
  589. [MarshalAs(UnmanagedType.FunctionPtr)]
  590. internal _FadeGrid FadeGrid;
  591. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  592. internal delegate float _GetCurrentGridAlpha();
  593. [MarshalAs(UnmanagedType.FunctionPtr)]
  594. internal _GetCurrentGridAlpha GetCurrentGridAlpha;
  595. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  596. internal delegate EVRCompositorError _SetSkyboxOverride([In, Out] Texture_t[] pTextures, uint unTextureCount);
  597. [MarshalAs(UnmanagedType.FunctionPtr)]
  598. internal _SetSkyboxOverride SetSkyboxOverride;
  599. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  600. internal delegate void _ClearSkyboxOverride();
  601. [MarshalAs(UnmanagedType.FunctionPtr)]
  602. internal _ClearSkyboxOverride ClearSkyboxOverride;
  603. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  604. internal delegate void _CompositorBringToFront();
  605. [MarshalAs(UnmanagedType.FunctionPtr)]
  606. internal _CompositorBringToFront CompositorBringToFront;
  607. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  608. internal delegate void _CompositorGoToBack();
  609. [MarshalAs(UnmanagedType.FunctionPtr)]
  610. internal _CompositorGoToBack CompositorGoToBack;
  611. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  612. internal delegate void _CompositorQuit();
  613. [MarshalAs(UnmanagedType.FunctionPtr)]
  614. internal _CompositorQuit CompositorQuit;
  615. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  616. internal delegate bool _IsFullscreen();
  617. [MarshalAs(UnmanagedType.FunctionPtr)]
  618. internal _IsFullscreen IsFullscreen;
  619. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  620. internal delegate uint _GetCurrentSceneFocusProcess();
  621. [MarshalAs(UnmanagedType.FunctionPtr)]
  622. internal _GetCurrentSceneFocusProcess GetCurrentSceneFocusProcess;
  623. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  624. internal delegate uint _GetLastFrameRenderer();
  625. [MarshalAs(UnmanagedType.FunctionPtr)]
  626. internal _GetLastFrameRenderer GetLastFrameRenderer;
  627. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  628. internal delegate bool _CanRenderScene();
  629. [MarshalAs(UnmanagedType.FunctionPtr)]
  630. internal _CanRenderScene CanRenderScene;
  631. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  632. internal delegate void _ShowMirrorWindow();
  633. [MarshalAs(UnmanagedType.FunctionPtr)]
  634. internal _ShowMirrorWindow ShowMirrorWindow;
  635. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  636. internal delegate void _HideMirrorWindow();
  637. [MarshalAs(UnmanagedType.FunctionPtr)]
  638. internal _HideMirrorWindow HideMirrorWindow;
  639. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  640. internal delegate bool _IsMirrorWindowVisible();
  641. [MarshalAs(UnmanagedType.FunctionPtr)]
  642. internal _IsMirrorWindowVisible IsMirrorWindowVisible;
  643. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  644. internal delegate void _CompositorDumpImages();
  645. [MarshalAs(UnmanagedType.FunctionPtr)]
  646. internal _CompositorDumpImages CompositorDumpImages;
  647. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  648. internal delegate bool _ShouldAppRenderWithLowResources();
  649. [MarshalAs(UnmanagedType.FunctionPtr)]
  650. internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources;
  651. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  652. internal delegate void _ForceInterleavedReprojectionOn(bool bOverride);
  653. [MarshalAs(UnmanagedType.FunctionPtr)]
  654. internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn;
  655. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  656. internal delegate void _ForceReconnectProcess();
  657. [MarshalAs(UnmanagedType.FunctionPtr)]
  658. internal _ForceReconnectProcess ForceReconnectProcess;
  659. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  660. internal delegate void _SuspendRendering(bool bSuspend);
  661. [MarshalAs(UnmanagedType.FunctionPtr)]
  662. internal _SuspendRendering SuspendRendering;
  663. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  664. internal delegate EVRCompositorError _GetMirrorTextureD3D11(EVREye eEye, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView);
  665. [MarshalAs(UnmanagedType.FunctionPtr)]
  666. internal _GetMirrorTextureD3D11 GetMirrorTextureD3D11;
  667. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  668. internal delegate void _ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView);
  669. [MarshalAs(UnmanagedType.FunctionPtr)]
  670. internal _ReleaseMirrorTextureD3D11 ReleaseMirrorTextureD3D11;
  671. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  672. internal delegate EVRCompositorError _GetMirrorTextureGL(EVREye eEye, ref uint pglTextureId, IntPtr pglSharedTextureHandle);
  673. [MarshalAs(UnmanagedType.FunctionPtr)]
  674. internal _GetMirrorTextureGL GetMirrorTextureGL;
  675. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  676. internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle);
  677. [MarshalAs(UnmanagedType.FunctionPtr)]
  678. internal _ReleaseSharedGLTexture ReleaseSharedGLTexture;
  679. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  680. internal delegate void _LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
  681. [MarshalAs(UnmanagedType.FunctionPtr)]
  682. internal _LockGLSharedTextureForAccess LockGLSharedTextureForAccess;
  683. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  684. internal delegate void _UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);
  685. [MarshalAs(UnmanagedType.FunctionPtr)]
  686. internal _UnlockGLSharedTextureForAccess UnlockGLSharedTextureForAccess;
  687. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  688. internal delegate uint _GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue, uint unBufferSize);
  689. [MarshalAs(UnmanagedType.FunctionPtr)]
  690. internal _GetVulkanInstanceExtensionsRequired GetVulkanInstanceExtensionsRequired;
  691. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  692. internal delegate uint _GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice, System.Text.StringBuilder pchValue, uint unBufferSize);
  693. [MarshalAs(UnmanagedType.FunctionPtr)]
  694. internal _GetVulkanDeviceExtensionsRequired GetVulkanDeviceExtensionsRequired;
  695. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  696. internal delegate void _SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode);
  697. [MarshalAs(UnmanagedType.FunctionPtr)]
  698. internal _SetExplicitTimingMode SetExplicitTimingMode;
  699. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  700. internal delegate EVRCompositorError _SubmitExplicitTimingData();
  701. [MarshalAs(UnmanagedType.FunctionPtr)]
  702. internal _SubmitExplicitTimingData SubmitExplicitTimingData;
  703. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  704. internal delegate bool _IsMotionSmoothingEnabled();
  705. [MarshalAs(UnmanagedType.FunctionPtr)]
  706. internal _IsMotionSmoothingEnabled IsMotionSmoothingEnabled;
  707. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  708. internal delegate bool _IsMotionSmoothingSupported();
  709. [MarshalAs(UnmanagedType.FunctionPtr)]
  710. internal _IsMotionSmoothingSupported IsMotionSmoothingSupported;
  711. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  712. internal delegate bool _IsCurrentSceneFocusAppLoading();
  713. [MarshalAs(UnmanagedType.FunctionPtr)]
  714. internal _IsCurrentSceneFocusAppLoading IsCurrentSceneFocusAppLoading;
  715. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  716. internal delegate EVRCompositorError _SetStageOverride_Async(IntPtr pchRenderModelPath, ref HmdMatrix34_t pTransform, ref Compositor_StageRenderSettings pRenderSettings, uint nSizeOfRenderSettings);
  717. [MarshalAs(UnmanagedType.FunctionPtr)]
  718. internal _SetStageOverride_Async SetStageOverride_Async;
  719. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  720. internal delegate void _ClearStageOverride();
  721. [MarshalAs(UnmanagedType.FunctionPtr)]
  722. internal _ClearStageOverride ClearStageOverride;
  723. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  724. internal delegate bool _GetCompositorBenchmarkResults(ref Compositor_BenchmarkResults pBenchmarkResults, uint nSizeOfBenchmarkResults);
  725. [MarshalAs(UnmanagedType.FunctionPtr)]
  726. internal _GetCompositorBenchmarkResults GetCompositorBenchmarkResults;
  727. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  728. internal delegate EVRCompositorError _GetLastPosePredictionIDs(ref uint pRenderPosePredictionID, ref uint pGamePosePredictionID);
  729. [MarshalAs(UnmanagedType.FunctionPtr)]
  730. internal _GetLastPosePredictionIDs GetLastPosePredictionIDs;
  731. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  732. internal delegate EVRCompositorError _GetPosesForFrame(uint unPosePredictionID, [In, Out] TrackedDevicePose_t[] pPoseArray, uint unPoseArrayCount);
  733. [MarshalAs(UnmanagedType.FunctionPtr)]
  734. internal _GetPosesForFrame GetPosesForFrame;
  735. }
  736. [StructLayout(LayoutKind.Sequential)]
  737. public struct IVROverlay
  738. {
  739. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  740. internal delegate EVROverlayError _FindOverlay(IntPtr pchOverlayKey, ref ulong pOverlayHandle);
  741. [MarshalAs(UnmanagedType.FunctionPtr)]
  742. internal _FindOverlay FindOverlay;
  743. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  744. internal delegate EVROverlayError _CreateOverlay(IntPtr pchOverlayKey, IntPtr pchOverlayName, ref ulong pOverlayHandle);
  745. [MarshalAs(UnmanagedType.FunctionPtr)]
  746. internal _CreateOverlay CreateOverlay;
  747. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  748. internal delegate EVROverlayError _DestroyOverlay(ulong ulOverlayHandle);
  749. [MarshalAs(UnmanagedType.FunctionPtr)]
  750. internal _DestroyOverlay DestroyOverlay;
  751. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  752. internal delegate uint _GetOverlayKey(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
  753. [MarshalAs(UnmanagedType.FunctionPtr)]
  754. internal _GetOverlayKey GetOverlayKey;
  755. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  756. internal delegate uint _GetOverlayName(ulong ulOverlayHandle, System.Text.StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);
  757. [MarshalAs(UnmanagedType.FunctionPtr)]
  758. internal _GetOverlayName GetOverlayName;
  759. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  760. internal delegate EVROverlayError _SetOverlayName(ulong ulOverlayHandle, IntPtr pchName);
  761. [MarshalAs(UnmanagedType.FunctionPtr)]
  762. internal _SetOverlayName SetOverlayName;
  763. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  764. internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);
  765. [MarshalAs(UnmanagedType.FunctionPtr)]
  766. internal _GetOverlayImageData GetOverlayImageData;
  767. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  768. internal delegate IntPtr _GetOverlayErrorNameFromEnum(EVROverlayError error);
  769. [MarshalAs(UnmanagedType.FunctionPtr)]
  770. internal _GetOverlayErrorNameFromEnum GetOverlayErrorNameFromEnum;
  771. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  772. internal delegate EVROverlayError _SetOverlayRenderingPid(ulong ulOverlayHandle, uint unPID);
  773. [MarshalAs(UnmanagedType.FunctionPtr)]
  774. internal _SetOverlayRenderingPid SetOverlayRenderingPid;
  775. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  776. internal delegate uint _GetOverlayRenderingPid(ulong ulOverlayHandle);
  777. [MarshalAs(UnmanagedType.FunctionPtr)]
  778. internal _GetOverlayRenderingPid GetOverlayRenderingPid;
  779. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  780. internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled);
  781. [MarshalAs(UnmanagedType.FunctionPtr)]
  782. internal _SetOverlayFlag SetOverlayFlag;
  783. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  784. internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled);
  785. [MarshalAs(UnmanagedType.FunctionPtr)]
  786. internal _GetOverlayFlag GetOverlayFlag;
  787. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  788. internal delegate EVROverlayError _GetOverlayFlags(ulong ulOverlayHandle, ref uint pFlags);
  789. [MarshalAs(UnmanagedType.FunctionPtr)]
  790. internal _GetOverlayFlags GetOverlayFlags;
  791. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  792. internal delegate EVROverlayError _SetOverlayColor(ulong ulOverlayHandle, float fRed, float fGreen, float fBlue);
  793. [MarshalAs(UnmanagedType.FunctionPtr)]
  794. internal _SetOverlayColor SetOverlayColor;
  795. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  796. internal delegate EVROverlayError _GetOverlayColor(ulong ulOverlayHandle, ref float pfRed, ref float pfGreen, ref float pfBlue);
  797. [MarshalAs(UnmanagedType.FunctionPtr)]
  798. internal _GetOverlayColor GetOverlayColor;
  799. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  800. internal delegate EVROverlayError _SetOverlayAlpha(ulong ulOverlayHandle, float fAlpha);
  801. [MarshalAs(UnmanagedType.FunctionPtr)]
  802. internal _SetOverlayAlpha SetOverlayAlpha;
  803. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  804. internal delegate EVROverlayError _GetOverlayAlpha(ulong ulOverlayHandle, ref float pfAlpha);
  805. [MarshalAs(UnmanagedType.FunctionPtr)]
  806. internal _GetOverlayAlpha GetOverlayAlpha;
  807. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  808. internal delegate EVROverlayError _SetOverlayTexelAspect(ulong ulOverlayHandle, float fTexelAspect);
  809. [MarshalAs(UnmanagedType.FunctionPtr)]
  810. internal _SetOverlayTexelAspect SetOverlayTexelAspect;
  811. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  812. internal delegate EVROverlayError _GetOverlayTexelAspect(ulong ulOverlayHandle, ref float pfTexelAspect);
  813. [MarshalAs(UnmanagedType.FunctionPtr)]
  814. internal _GetOverlayTexelAspect GetOverlayTexelAspect;
  815. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  816. internal delegate EVROverlayError _SetOverlaySortOrder(ulong ulOverlayHandle, uint unSortOrder);
  817. [MarshalAs(UnmanagedType.FunctionPtr)]
  818. internal _SetOverlaySortOrder SetOverlaySortOrder;
  819. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  820. internal delegate EVROverlayError _GetOverlaySortOrder(ulong ulOverlayHandle, ref uint punSortOrder);
  821. [MarshalAs(UnmanagedType.FunctionPtr)]
  822. internal _GetOverlaySortOrder GetOverlaySortOrder;
  823. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  824. internal delegate EVROverlayError _SetOverlayWidthInMeters(ulong ulOverlayHandle, float fWidthInMeters);
  825. [MarshalAs(UnmanagedType.FunctionPtr)]
  826. internal _SetOverlayWidthInMeters SetOverlayWidthInMeters;
  827. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  828. internal delegate EVROverlayError _GetOverlayWidthInMeters(ulong ulOverlayHandle, ref float pfWidthInMeters);
  829. [MarshalAs(UnmanagedType.FunctionPtr)]
  830. internal _GetOverlayWidthInMeters GetOverlayWidthInMeters;
  831. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  832. internal delegate EVROverlayError _SetOverlayCurvature(ulong ulOverlayHandle, float fCurvature);
  833. [MarshalAs(UnmanagedType.FunctionPtr)]
  834. internal _SetOverlayCurvature SetOverlayCurvature;
  835. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  836. internal delegate EVROverlayError _GetOverlayCurvature(ulong ulOverlayHandle, ref float pfCurvature);
  837. [MarshalAs(UnmanagedType.FunctionPtr)]
  838. internal _GetOverlayCurvature GetOverlayCurvature;
  839. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  840. internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace);
  841. [MarshalAs(UnmanagedType.FunctionPtr)]
  842. internal _SetOverlayTextureColorSpace SetOverlayTextureColorSpace;
  843. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  844. internal delegate EVROverlayError _GetOverlayTextureColorSpace(ulong ulOverlayHandle, ref EColorSpace peTextureColorSpace);
  845. [MarshalAs(UnmanagedType.FunctionPtr)]
  846. internal _GetOverlayTextureColorSpace GetOverlayTextureColorSpace;
  847. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  848. internal delegate EVROverlayError _SetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
  849. [MarshalAs(UnmanagedType.FunctionPtr)]
  850. internal _SetOverlayTextureBounds SetOverlayTextureBounds;
  851. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  852. internal delegate EVROverlayError _GetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);
  853. [MarshalAs(UnmanagedType.FunctionPtr)]
  854. internal _GetOverlayTextureBounds GetOverlayTextureBounds;
  855. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  856. internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
  857. [MarshalAs(UnmanagedType.FunctionPtr)]
  858. internal _GetOverlayTransformType GetOverlayTransformType;
  859. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  860. internal delegate EVROverlayError _SetOverlayTransformAbsolute(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
  861. [MarshalAs(UnmanagedType.FunctionPtr)]
  862. internal _SetOverlayTransformAbsolute SetOverlayTransformAbsolute;
  863. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  864. internal delegate EVROverlayError _GetOverlayTransformAbsolute(ulong ulOverlayHandle, ref ETrackingUniverseOrigin peTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);
  865. [MarshalAs(UnmanagedType.FunctionPtr)]
  866. internal _GetOverlayTransformAbsolute GetOverlayTransformAbsolute;
  867. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  868. internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, uint unTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
  869. [MarshalAs(UnmanagedType.FunctionPtr)]
  870. internal _SetOverlayTransformTrackedDeviceRelative SetOverlayTransformTrackedDeviceRelative;
  871. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  872. internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, ref uint punTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);
  873. [MarshalAs(UnmanagedType.FunctionPtr)]
  874. internal _GetOverlayTransformTrackedDeviceRelative GetOverlayTransformTrackedDeviceRelative;
  875. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  876. internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, uint unDeviceIndex, IntPtr pchComponentName);
  877. [MarshalAs(UnmanagedType.FunctionPtr)]
  878. internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent;
  879. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  880. internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameSize);
  881. [MarshalAs(UnmanagedType.FunctionPtr)]
  882. internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;
  883. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  884. internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
  885. [MarshalAs(UnmanagedType.FunctionPtr)]
  886. internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative;
  887. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  888. internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);
  889. [MarshalAs(UnmanagedType.FunctionPtr)]
  890. internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative;
  891. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  892. internal delegate EVROverlayError _SetOverlayTransformCursor(ulong ulCursorOverlayHandle, ref HmdVector2_t pvHotspot);
  893. [MarshalAs(UnmanagedType.FunctionPtr)]
  894. internal _SetOverlayTransformCursor SetOverlayTransformCursor;
  895. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  896. internal delegate EVROverlayError _GetOverlayTransformCursor(ulong ulOverlayHandle, ref HmdVector2_t pvHotspot);
  897. [MarshalAs(UnmanagedType.FunctionPtr)]
  898. internal _GetOverlayTransformCursor GetOverlayTransformCursor;
  899. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  900. internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);
  901. [MarshalAs(UnmanagedType.FunctionPtr)]
  902. internal _ShowOverlay ShowOverlay;
  903. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  904. internal delegate EVROverlayError _HideOverlay(ulong ulOverlayHandle);
  905. [MarshalAs(UnmanagedType.FunctionPtr)]
  906. internal _HideOverlay HideOverlay;
  907. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  908. internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle);
  909. [MarshalAs(UnmanagedType.FunctionPtr)]
  910. internal _IsOverlayVisible IsOverlayVisible;
  911. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  912. internal delegate EVROverlayError _GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);
  913. [MarshalAs(UnmanagedType.FunctionPtr)]
  914. internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates;
  915. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  916. internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent);
  917. [MarshalAs(UnmanagedType.FunctionPtr)]
  918. internal _PollNextOverlayEvent PollNextOverlayEvent;
  919. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  920. internal delegate EVROverlayError _GetOverlayInputMethod(ulong ulOverlayHandle, ref VROverlayInputMethod peInputMethod);
  921. [MarshalAs(UnmanagedType.FunctionPtr)]
  922. internal _GetOverlayInputMethod GetOverlayInputMethod;
  923. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  924. internal delegate EVROverlayError _SetOverlayInputMethod(ulong ulOverlayHandle, VROverlayInputMethod eInputMethod);
  925. [MarshalAs(UnmanagedType.FunctionPtr)]
  926. internal _SetOverlayInputMethod SetOverlayInputMethod;
  927. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  928. internal delegate EVROverlayError _GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
  929. [MarshalAs(UnmanagedType.FunctionPtr)]
  930. internal _GetOverlayMouseScale GetOverlayMouseScale;
  931. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  932. internal delegate EVROverlayError _SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
  933. [MarshalAs(UnmanagedType.FunctionPtr)]
  934. internal _SetOverlayMouseScale SetOverlayMouseScale;
  935. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  936. internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);
  937. [MarshalAs(UnmanagedType.FunctionPtr)]
  938. internal _ComputeOverlayIntersection ComputeOverlayIntersection;
  939. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  940. internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle);
  941. [MarshalAs(UnmanagedType.FunctionPtr)]
  942. internal _IsHoverTargetOverlay IsHoverTargetOverlay;
  943. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  944. internal delegate EVROverlayError _SetOverlayIntersectionMask(ulong ulOverlayHandle, ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, uint unNumMaskPrimitives, uint unPrimitiveSize);
  945. [MarshalAs(UnmanagedType.FunctionPtr)]
  946. internal _SetOverlayIntersectionMask SetOverlayIntersectionMask;
  947. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  948. internal delegate EVROverlayError _TriggerLaserMouseHapticVibration(ulong ulOverlayHandle, float fDurationSeconds, float fFrequency, float fAmplitude);
  949. [MarshalAs(UnmanagedType.FunctionPtr)]
  950. internal _TriggerLaserMouseHapticVibration TriggerLaserMouseHapticVibration;
  951. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  952. internal delegate EVROverlayError _SetOverlayCursor(ulong ulOverlayHandle, ulong ulCursorHandle);
  953. [MarshalAs(UnmanagedType.FunctionPtr)]
  954. internal _SetOverlayCursor SetOverlayCursor;
  955. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  956. internal delegate EVROverlayError _SetOverlayCursorPositionOverride(ulong ulOverlayHandle, ref HmdVector2_t pvCursor);
  957. [MarshalAs(UnmanagedType.FunctionPtr)]
  958. internal _SetOverlayCursorPositionOverride SetOverlayCursorPositionOverride;
  959. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  960. internal delegate EVROverlayError _ClearOverlayCursorPositionOverride(ulong ulOverlayHandle);
  961. [MarshalAs(UnmanagedType.FunctionPtr)]
  962. internal _ClearOverlayCursorPositionOverride ClearOverlayCursorPositionOverride;
  963. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  964. internal delegate EVROverlayError _SetOverlayTexture(ulong ulOverlayHandle, ref Texture_t pTexture);
  965. [MarshalAs(UnmanagedType.FunctionPtr)]
  966. internal _SetOverlayTexture SetOverlayTexture;
  967. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  968. internal delegate EVROverlayError _ClearOverlayTexture(ulong ulOverlayHandle);
  969. [MarshalAs(UnmanagedType.FunctionPtr)]
  970. internal _ClearOverlayTexture ClearOverlayTexture;
  971. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  972. internal delegate EVROverlayError _SetOverlayRaw(ulong ulOverlayHandle, IntPtr pvBuffer, uint unWidth, uint unHeight, uint unBytesPerPixel);
  973. [MarshalAs(UnmanagedType.FunctionPtr)]
  974. internal _SetOverlayRaw SetOverlayRaw;
  975. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  976. internal delegate EVROverlayError _SetOverlayFromFile(ulong ulOverlayHandle, IntPtr pchFilePath);
  977. [MarshalAs(UnmanagedType.FunctionPtr)]
  978. internal _SetOverlayFromFile SetOverlayFromFile;
  979. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  980. 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);
  981. [MarshalAs(UnmanagedType.FunctionPtr)]
  982. internal _GetOverlayTexture GetOverlayTexture;
  983. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  984. internal delegate EVROverlayError _ReleaseNativeOverlayHandle(ulong ulOverlayHandle, IntPtr pNativeTextureHandle);
  985. [MarshalAs(UnmanagedType.FunctionPtr)]
  986. internal _ReleaseNativeOverlayHandle ReleaseNativeOverlayHandle;
  987. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  988. internal delegate EVROverlayError _GetOverlayTextureSize(ulong ulOverlayHandle, ref uint pWidth, ref uint pHeight);
  989. [MarshalAs(UnmanagedType.FunctionPtr)]
  990. internal _GetOverlayTextureSize GetOverlayTextureSize;
  991. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  992. internal delegate EVROverlayError _CreateDashboardOverlay(IntPtr pchOverlayKey, IntPtr pchOverlayFriendlyName, ref ulong pMainHandle, ref ulong pThumbnailHandle);
  993. [MarshalAs(UnmanagedType.FunctionPtr)]
  994. internal _CreateDashboardOverlay CreateDashboardOverlay;
  995. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  996. internal delegate bool _IsDashboardVisible();
  997. [MarshalAs(UnmanagedType.FunctionPtr)]
  998. internal _IsDashboardVisible IsDashboardVisible;
  999. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1000. internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle);
  1001. [MarshalAs(UnmanagedType.FunctionPtr)]
  1002. internal _IsActiveDashboardOverlay IsActiveDashboardOverlay;
  1003. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1004. internal delegate EVROverlayError _SetDashboardOverlaySceneProcess(ulong ulOverlayHandle, uint unProcessId);
  1005. [MarshalAs(UnmanagedType.FunctionPtr)]
  1006. internal _SetDashboardOverlaySceneProcess SetDashboardOverlaySceneProcess;
  1007. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1008. internal delegate EVROverlayError _GetDashboardOverlaySceneProcess(ulong ulOverlayHandle, ref uint punProcessId);
  1009. [MarshalAs(UnmanagedType.FunctionPtr)]
  1010. internal _GetDashboardOverlaySceneProcess GetDashboardOverlaySceneProcess;
  1011. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1012. internal delegate void _ShowDashboard(IntPtr pchOverlayToShow);
  1013. [MarshalAs(UnmanagedType.FunctionPtr)]
  1014. internal _ShowDashboard ShowDashboard;
  1015. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1016. internal delegate uint _GetPrimaryDashboardDevice();
  1017. [MarshalAs(UnmanagedType.FunctionPtr)]
  1018. internal _GetPrimaryDashboardDevice GetPrimaryDashboardDevice;
  1019. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1020. internal delegate EVROverlayError _ShowKeyboard(int eInputMode, int eLineInputMode, uint unFlags, IntPtr pchDescription, uint unCharMax, IntPtr pchExistingText, ulong uUserValue);
  1021. [MarshalAs(UnmanagedType.FunctionPtr)]
  1022. internal _ShowKeyboard ShowKeyboard;
  1023. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1024. internal delegate EVROverlayError _ShowKeyboardForOverlay(ulong ulOverlayHandle, int eInputMode, int eLineInputMode, uint unFlags, IntPtr pchDescription, uint unCharMax, IntPtr pchExistingText, ulong uUserValue);
  1025. [MarshalAs(UnmanagedType.FunctionPtr)]
  1026. internal _ShowKeyboardForOverlay ShowKeyboardForOverlay;
  1027. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1028. internal delegate uint _GetKeyboardText(System.Text.StringBuilder pchText, uint cchText);
  1029. [MarshalAs(UnmanagedType.FunctionPtr)]
  1030. internal _GetKeyboardText GetKeyboardText;
  1031. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1032. internal delegate void _HideKeyboard();
  1033. [MarshalAs(UnmanagedType.FunctionPtr)]
  1034. internal _HideKeyboard HideKeyboard;
  1035. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1036. internal delegate void _SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);
  1037. [MarshalAs(UnmanagedType.FunctionPtr)]
  1038. internal _SetKeyboardTransformAbsolute SetKeyboardTransformAbsolute;
  1039. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1040. internal delegate void _SetKeyboardPositionForOverlay(ulong ulOverlayHandle, HmdRect2_t avoidRect);
  1041. [MarshalAs(UnmanagedType.FunctionPtr)]
  1042. internal _SetKeyboardPositionForOverlay SetKeyboardPositionForOverlay;
  1043. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1044. internal delegate VRMessageOverlayResponse _ShowMessageOverlay(IntPtr pchText, IntPtr pchCaption, IntPtr pchButton0Text, IntPtr pchButton1Text, IntPtr pchButton2Text, IntPtr pchButton3Text);
  1045. [MarshalAs(UnmanagedType.FunctionPtr)]
  1046. internal _ShowMessageOverlay ShowMessageOverlay;
  1047. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1048. internal delegate void _CloseMessageOverlay();
  1049. [MarshalAs(UnmanagedType.FunctionPtr)]
  1050. internal _CloseMessageOverlay CloseMessageOverlay;
  1051. }
  1052. [StructLayout(LayoutKind.Sequential)]
  1053. public struct IVROverlayView
  1054. {
  1055. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1056. internal delegate EVROverlayError _AcquireOverlayView(ulong ulOverlayHandle, ref VRNativeDevice_t pNativeDevice, ref VROverlayView_t pOverlayView, uint unOverlayViewSize);
  1057. [MarshalAs(UnmanagedType.FunctionPtr)]
  1058. internal _AcquireOverlayView AcquireOverlayView;
  1059. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1060. internal delegate EVROverlayError _ReleaseOverlayView(ref VROverlayView_t pOverlayView);
  1061. [MarshalAs(UnmanagedType.FunctionPtr)]
  1062. internal _ReleaseOverlayView ReleaseOverlayView;
  1063. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1064. internal delegate void _PostOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pvrEvent);
  1065. [MarshalAs(UnmanagedType.FunctionPtr)]
  1066. internal _PostOverlayEvent PostOverlayEvent;
  1067. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1068. internal delegate bool _IsViewingPermitted(ulong ulOverlayHandle);
  1069. [MarshalAs(UnmanagedType.FunctionPtr)]
  1070. internal _IsViewingPermitted IsViewingPermitted;
  1071. }
  1072. [StructLayout(LayoutKind.Sequential)]
  1073. public struct IVRHeadsetView
  1074. {
  1075. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1076. internal delegate void _SetHeadsetViewSize(uint nWidth, uint nHeight);
  1077. [MarshalAs(UnmanagedType.FunctionPtr)]
  1078. internal _SetHeadsetViewSize SetHeadsetViewSize;
  1079. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1080. internal delegate void _GetHeadsetViewSize(ref uint pnWidth, ref uint pnHeight);
  1081. [MarshalAs(UnmanagedType.FunctionPtr)]
  1082. internal _GetHeadsetViewSize GetHeadsetViewSize;
  1083. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1084. internal delegate void _SetHeadsetViewMode(uint eHeadsetViewMode);
  1085. [MarshalAs(UnmanagedType.FunctionPtr)]
  1086. internal _SetHeadsetViewMode SetHeadsetViewMode;
  1087. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1088. internal delegate uint _GetHeadsetViewMode();
  1089. [MarshalAs(UnmanagedType.FunctionPtr)]
  1090. internal _GetHeadsetViewMode GetHeadsetViewMode;
  1091. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1092. internal delegate void _SetHeadsetViewCropped(bool bCropped);
  1093. [MarshalAs(UnmanagedType.FunctionPtr)]
  1094. internal _SetHeadsetViewCropped SetHeadsetViewCropped;
  1095. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1096. internal delegate bool _GetHeadsetViewCropped();
  1097. [MarshalAs(UnmanagedType.FunctionPtr)]
  1098. internal _GetHeadsetViewCropped GetHeadsetViewCropped;
  1099. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1100. internal delegate float _GetHeadsetViewAspectRatio();
  1101. [MarshalAs(UnmanagedType.FunctionPtr)]
  1102. internal _GetHeadsetViewAspectRatio GetHeadsetViewAspectRatio;
  1103. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1104. internal delegate void _SetHeadsetViewBlendRange(float flStartPct, float flEndPct);
  1105. [MarshalAs(UnmanagedType.FunctionPtr)]
  1106. internal _SetHeadsetViewBlendRange SetHeadsetViewBlendRange;
  1107. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1108. internal delegate void _GetHeadsetViewBlendRange(ref float pStartPct, ref float pEndPct);
  1109. [MarshalAs(UnmanagedType.FunctionPtr)]
  1110. internal _GetHeadsetViewBlendRange GetHeadsetViewBlendRange;
  1111. }
  1112. [StructLayout(LayoutKind.Sequential)]
  1113. public struct IVRRenderModels
  1114. {
  1115. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1116. internal delegate EVRRenderModelError _LoadRenderModel_Async(IntPtr pchRenderModelName, ref IntPtr ppRenderModel);
  1117. [MarshalAs(UnmanagedType.FunctionPtr)]
  1118. internal _LoadRenderModel_Async LoadRenderModel_Async;
  1119. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1120. internal delegate void _FreeRenderModel(IntPtr pRenderModel);
  1121. [MarshalAs(UnmanagedType.FunctionPtr)]
  1122. internal _FreeRenderModel FreeRenderModel;
  1123. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1124. internal delegate EVRRenderModelError _LoadTexture_Async(int textureId, ref IntPtr ppTexture);
  1125. [MarshalAs(UnmanagedType.FunctionPtr)]
  1126. internal _LoadTexture_Async LoadTexture_Async;
  1127. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1128. internal delegate void _FreeTexture(IntPtr pTexture);
  1129. [MarshalAs(UnmanagedType.FunctionPtr)]
  1130. internal _FreeTexture FreeTexture;
  1131. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1132. internal delegate EVRRenderModelError _LoadTextureD3D11_Async(int textureId, IntPtr pD3D11Device, ref IntPtr ppD3D11Texture2D);
  1133. [MarshalAs(UnmanagedType.FunctionPtr)]
  1134. internal _LoadTextureD3D11_Async LoadTextureD3D11_Async;
  1135. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1136. internal delegate EVRRenderModelError _LoadIntoTextureD3D11_Async(int textureId, IntPtr pDstTexture);
  1137. [MarshalAs(UnmanagedType.FunctionPtr)]
  1138. internal _LoadIntoTextureD3D11_Async LoadIntoTextureD3D11_Async;
  1139. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1140. internal delegate void _FreeTextureD3D11(IntPtr pD3D11Texture2D);
  1141. [MarshalAs(UnmanagedType.FunctionPtr)]
  1142. internal _FreeTextureD3D11 FreeTextureD3D11;
  1143. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1144. internal delegate uint _GetRenderModelName(uint unRenderModelIndex, System.Text.StringBuilder pchRenderModelName, uint unRenderModelNameLen);
  1145. [MarshalAs(UnmanagedType.FunctionPtr)]
  1146. internal _GetRenderModelName GetRenderModelName;
  1147. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1148. internal delegate uint _GetRenderModelCount();
  1149. [MarshalAs(UnmanagedType.FunctionPtr)]
  1150. internal _GetRenderModelCount GetRenderModelCount;
  1151. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1152. internal delegate uint _GetComponentCount(IntPtr pchRenderModelName);
  1153. [MarshalAs(UnmanagedType.FunctionPtr)]
  1154. internal _GetComponentCount GetComponentCount;
  1155. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1156. internal delegate uint _GetComponentName(IntPtr pchRenderModelName, uint unComponentIndex, System.Text.StringBuilder pchComponentName, uint unComponentNameLen);
  1157. [MarshalAs(UnmanagedType.FunctionPtr)]
  1158. internal _GetComponentName GetComponentName;
  1159. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1160. internal delegate ulong _GetComponentButtonMask(IntPtr pchRenderModelName, IntPtr pchComponentName);
  1161. [MarshalAs(UnmanagedType.FunctionPtr)]
  1162. internal _GetComponentButtonMask GetComponentButtonMask;
  1163. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1164. internal delegate uint _GetComponentRenderModelName(IntPtr pchRenderModelName, IntPtr pchComponentName, System.Text.StringBuilder pchComponentRenderModelName, uint unComponentRenderModelNameLen);
  1165. [MarshalAs(UnmanagedType.FunctionPtr)]
  1166. internal _GetComponentRenderModelName GetComponentRenderModelName;
  1167. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1168. internal delegate bool _GetComponentStateForDevicePath(IntPtr pchRenderModelName, IntPtr pchComponentName, ulong devicePath, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
  1169. [MarshalAs(UnmanagedType.FunctionPtr)]
  1170. internal _GetComponentStateForDevicePath GetComponentStateForDevicePath;
  1171. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1172. internal delegate bool _GetComponentState(IntPtr pchRenderModelName, IntPtr pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);
  1173. [MarshalAs(UnmanagedType.FunctionPtr)]
  1174. internal _GetComponentState GetComponentState;
  1175. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1176. internal delegate bool _RenderModelHasComponent(IntPtr pchRenderModelName, IntPtr pchComponentName);
  1177. [MarshalAs(UnmanagedType.FunctionPtr)]
  1178. internal _RenderModelHasComponent RenderModelHasComponent;
  1179. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1180. internal delegate uint _GetRenderModelThumbnailURL(IntPtr pchRenderModelName, System.Text.StringBuilder pchThumbnailURL, uint unThumbnailURLLen, ref EVRRenderModelError peError);
  1181. [MarshalAs(UnmanagedType.FunctionPtr)]
  1182. internal _GetRenderModelThumbnailURL GetRenderModelThumbnailURL;
  1183. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1184. internal delegate uint _GetRenderModelOriginalPath(IntPtr pchRenderModelName, System.Text.StringBuilder pchOriginalPath, uint unOriginalPathLen, ref EVRRenderModelError peError);
  1185. [MarshalAs(UnmanagedType.FunctionPtr)]
  1186. internal _GetRenderModelOriginalPath GetRenderModelOriginalPath;
  1187. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1188. internal delegate IntPtr _GetRenderModelErrorNameFromEnum(EVRRenderModelError error);
  1189. [MarshalAs(UnmanagedType.FunctionPtr)]
  1190. internal _GetRenderModelErrorNameFromEnum GetRenderModelErrorNameFromEnum;
  1191. }
  1192. [StructLayout(LayoutKind.Sequential)]
  1193. public struct IVRNotifications
  1194. {
  1195. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1196. internal delegate EVRNotificationError _CreateNotification(ulong ulOverlayHandle, ulong ulUserValue, EVRNotificationType type, IntPtr pchText, EVRNotificationStyle style, ref NotificationBitmap_t pImage, ref uint pNotificationId);
  1197. [MarshalAs(UnmanagedType.FunctionPtr)]
  1198. internal _CreateNotification CreateNotification;
  1199. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1200. internal delegate EVRNotificationError _RemoveNotification(uint notificationId);
  1201. [MarshalAs(UnmanagedType.FunctionPtr)]
  1202. internal _RemoveNotification RemoveNotification;
  1203. }
  1204. [StructLayout(LayoutKind.Sequential)]
  1205. public struct IVRSettings
  1206. {
  1207. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1208. internal delegate IntPtr _GetSettingsErrorNameFromEnum(EVRSettingsError eError);
  1209. [MarshalAs(UnmanagedType.FunctionPtr)]
  1210. internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum;
  1211. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1212. internal delegate void _SetBool(IntPtr pchSection, IntPtr pchSettingsKey, bool bValue, ref EVRSettingsError peError);
  1213. [MarshalAs(UnmanagedType.FunctionPtr)]
  1214. internal _SetBool SetBool;
  1215. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1216. internal delegate void _SetInt32(IntPtr pchSection, IntPtr pchSettingsKey, int nValue, ref EVRSettingsError peError);
  1217. [MarshalAs(UnmanagedType.FunctionPtr)]
  1218. internal _SetInt32 SetInt32;
  1219. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1220. internal delegate void _SetFloat(IntPtr pchSection, IntPtr pchSettingsKey, float flValue, ref EVRSettingsError peError);
  1221. [MarshalAs(UnmanagedType.FunctionPtr)]
  1222. internal _SetFloat SetFloat;
  1223. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1224. internal delegate void _SetString(IntPtr pchSection, IntPtr pchSettingsKey, IntPtr pchValue, ref EVRSettingsError peError);
  1225. [MarshalAs(UnmanagedType.FunctionPtr)]
  1226. internal _SetString SetString;
  1227. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1228. internal delegate bool _GetBool(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);
  1229. [MarshalAs(UnmanagedType.FunctionPtr)]
  1230. internal _GetBool GetBool;
  1231. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1232. internal delegate int _GetInt32(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);
  1233. [MarshalAs(UnmanagedType.FunctionPtr)]
  1234. internal _GetInt32 GetInt32;
  1235. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1236. internal delegate float _GetFloat(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);
  1237. [MarshalAs(UnmanagedType.FunctionPtr)]
  1238. internal _GetFloat GetFloat;
  1239. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1240. internal delegate void _GetString(IntPtr pchSection, IntPtr pchSettingsKey, System.Text.StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError);
  1241. [MarshalAs(UnmanagedType.FunctionPtr)]
  1242. internal _GetString GetString;
  1243. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1244. internal delegate void _RemoveSection(IntPtr pchSection, ref EVRSettingsError peError);
  1245. [MarshalAs(UnmanagedType.FunctionPtr)]
  1246. internal _RemoveSection RemoveSection;
  1247. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1248. internal delegate void _RemoveKeyInSection(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);
  1249. [MarshalAs(UnmanagedType.FunctionPtr)]
  1250. internal _RemoveKeyInSection RemoveKeyInSection;
  1251. }
  1252. [StructLayout(LayoutKind.Sequential)]
  1253. public struct IVRScreenshots
  1254. {
  1255. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1256. internal delegate EVRScreenshotError _RequestScreenshot(ref uint pOutScreenshotHandle, EVRScreenshotType type, IntPtr pchPreviewFilename, IntPtr pchVRFilename);
  1257. [MarshalAs(UnmanagedType.FunctionPtr)]
  1258. internal _RequestScreenshot RequestScreenshot;
  1259. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1260. internal delegate EVRScreenshotError _HookScreenshot([In, Out] EVRScreenshotType[] pSupportedTypes, int numTypes);
  1261. [MarshalAs(UnmanagedType.FunctionPtr)]
  1262. internal _HookScreenshot HookScreenshot;
  1263. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1264. internal delegate EVRScreenshotType _GetScreenshotPropertyType(uint screenshotHandle, ref EVRScreenshotError pError);
  1265. [MarshalAs(UnmanagedType.FunctionPtr)]
  1266. internal _GetScreenshotPropertyType GetScreenshotPropertyType;
  1267. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1268. internal delegate uint _GetScreenshotPropertyFilename(uint screenshotHandle, EVRScreenshotPropertyFilenames filenameType, System.Text.StringBuilder pchFilename, uint cchFilename, ref EVRScreenshotError pError);
  1269. [MarshalAs(UnmanagedType.FunctionPtr)]
  1270. internal _GetScreenshotPropertyFilename GetScreenshotPropertyFilename;
  1271. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1272. internal delegate EVRScreenshotError _UpdateScreenshotProgress(uint screenshotHandle, float flProgress);
  1273. [MarshalAs(UnmanagedType.FunctionPtr)]
  1274. internal _UpdateScreenshotProgress UpdateScreenshotProgress;
  1275. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1276. internal delegate EVRScreenshotError _TakeStereoScreenshot(ref uint pOutScreenshotHandle, IntPtr pchPreviewFilename, IntPtr pchVRFilename);
  1277. [MarshalAs(UnmanagedType.FunctionPtr)]
  1278. internal _TakeStereoScreenshot TakeStereoScreenshot;
  1279. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1280. internal delegate EVRScreenshotError _SubmitScreenshot(uint screenshotHandle, EVRScreenshotType type, IntPtr pchSourcePreviewFilename, IntPtr pchSourceVRFilename);
  1281. [MarshalAs(UnmanagedType.FunctionPtr)]
  1282. internal _SubmitScreenshot SubmitScreenshot;
  1283. }
  1284. [StructLayout(LayoutKind.Sequential)]
  1285. public struct IVRResources
  1286. {
  1287. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1288. internal delegate uint _LoadSharedResource(IntPtr pchResourceName, string pchBuffer, uint unBufferLen);
  1289. [MarshalAs(UnmanagedType.FunctionPtr)]
  1290. internal _LoadSharedResource LoadSharedResource;
  1291. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1292. internal delegate uint _GetResourceFullPath(IntPtr pchResourceName, IntPtr pchResourceTypeDirectory, System.Text.StringBuilder pchPathBuffer, uint unBufferLen);
  1293. [MarshalAs(UnmanagedType.FunctionPtr)]
  1294. internal _GetResourceFullPath GetResourceFullPath;
  1295. }
  1296. [StructLayout(LayoutKind.Sequential)]
  1297. public struct IVRDriverManager
  1298. {
  1299. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1300. internal delegate uint _GetDriverCount();
  1301. [MarshalAs(UnmanagedType.FunctionPtr)]
  1302. internal _GetDriverCount GetDriverCount;
  1303. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1304. internal delegate uint _GetDriverName(uint nDriver, System.Text.StringBuilder pchValue, uint unBufferSize);
  1305. [MarshalAs(UnmanagedType.FunctionPtr)]
  1306. internal _GetDriverName GetDriverName;
  1307. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1308. internal delegate ulong _GetDriverHandle(IntPtr pchDriverName);
  1309. [MarshalAs(UnmanagedType.FunctionPtr)]
  1310. internal _GetDriverHandle GetDriverHandle;
  1311. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1312. internal delegate bool _IsEnabled(uint nDriver);
  1313. [MarshalAs(UnmanagedType.FunctionPtr)]
  1314. internal _IsEnabled IsEnabled;
  1315. }
  1316. [StructLayout(LayoutKind.Sequential)]
  1317. public struct IVRInput
  1318. {
  1319. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1320. internal delegate EVRInputError _SetActionManifestPath(IntPtr pchActionManifestPath);
  1321. [MarshalAs(UnmanagedType.FunctionPtr)]
  1322. internal _SetActionManifestPath SetActionManifestPath;
  1323. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1324. internal delegate EVRInputError _GetActionSetHandle(IntPtr pchActionSetName, ref ulong pHandle);
  1325. [MarshalAs(UnmanagedType.FunctionPtr)]
  1326. internal _GetActionSetHandle GetActionSetHandle;
  1327. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1328. internal delegate EVRInputError _GetActionHandle(IntPtr pchActionName, ref ulong pHandle);
  1329. [MarshalAs(UnmanagedType.FunctionPtr)]
  1330. internal _GetActionHandle GetActionHandle;
  1331. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1332. internal delegate EVRInputError _GetInputSourceHandle(IntPtr pchInputSourcePath, ref ulong pHandle);
  1333. [MarshalAs(UnmanagedType.FunctionPtr)]
  1334. internal _GetInputSourceHandle GetInputSourceHandle;
  1335. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1336. internal delegate EVRInputError _UpdateActionState([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount);
  1337. [MarshalAs(UnmanagedType.FunctionPtr)]
  1338. internal _UpdateActionState UpdateActionState;
  1339. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1340. internal delegate EVRInputError _GetDigitalActionData(ulong action, ref InputDigitalActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
  1341. [MarshalAs(UnmanagedType.FunctionPtr)]
  1342. internal _GetDigitalActionData GetDigitalActionData;
  1343. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1344. internal delegate EVRInputError _GetAnalogActionData(ulong action, ref InputAnalogActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
  1345. [MarshalAs(UnmanagedType.FunctionPtr)]
  1346. internal _GetAnalogActionData GetAnalogActionData;
  1347. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1348. internal delegate EVRInputError _GetPoseActionDataRelativeToNow(ulong action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
  1349. [MarshalAs(UnmanagedType.FunctionPtr)]
  1350. internal _GetPoseActionDataRelativeToNow GetPoseActionDataRelativeToNow;
  1351. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1352. internal delegate EVRInputError _GetPoseActionDataForNextFrame(ulong action, ETrackingUniverseOrigin eOrigin, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);
  1353. [MarshalAs(UnmanagedType.FunctionPtr)]
  1354. internal _GetPoseActionDataForNextFrame GetPoseActionDataForNextFrame;
  1355. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1356. internal delegate EVRInputError _GetSkeletalActionData(ulong action, ref InputSkeletalActionData_t pActionData, uint unActionDataSize);
  1357. [MarshalAs(UnmanagedType.FunctionPtr)]
  1358. internal _GetSkeletalActionData GetSkeletalActionData;
  1359. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1360. internal delegate EVRInputError _GetDominantHand(ref ETrackedControllerRole peDominantHand);
  1361. [MarshalAs(UnmanagedType.FunctionPtr)]
  1362. internal _GetDominantHand GetDominantHand;
  1363. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1364. internal delegate EVRInputError _SetDominantHand(ETrackedControllerRole eDominantHand);
  1365. [MarshalAs(UnmanagedType.FunctionPtr)]
  1366. internal _SetDominantHand SetDominantHand;
  1367. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1368. internal delegate EVRInputError _GetBoneCount(ulong action, ref uint pBoneCount);
  1369. [MarshalAs(UnmanagedType.FunctionPtr)]
  1370. internal _GetBoneCount GetBoneCount;
  1371. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1372. internal delegate EVRInputError _GetBoneHierarchy(ulong action, [In, Out] int[] pParentIndices, uint unIndexArayCount);
  1373. [MarshalAs(UnmanagedType.FunctionPtr)]
  1374. internal _GetBoneHierarchy GetBoneHierarchy;
  1375. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1376. internal delegate EVRInputError _GetBoneName(ulong action, int nBoneIndex, System.Text.StringBuilder pchBoneName, uint unNameBufferSize);
  1377. [MarshalAs(UnmanagedType.FunctionPtr)]
  1378. internal _GetBoneName GetBoneName;
  1379. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1380. internal delegate EVRInputError _GetSkeletalReferenceTransforms(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalReferencePose eReferencePose, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
  1381. [MarshalAs(UnmanagedType.FunctionPtr)]
  1382. internal _GetSkeletalReferenceTransforms GetSkeletalReferenceTransforms;
  1383. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1384. internal delegate EVRInputError _GetSkeletalTrackingLevel(ulong action, ref EVRSkeletalTrackingLevel pSkeletalTrackingLevel);
  1385. [MarshalAs(UnmanagedType.FunctionPtr)]
  1386. internal _GetSkeletalTrackingLevel GetSkeletalTrackingLevel;
  1387. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1388. internal delegate EVRInputError _GetSkeletalBoneData(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalMotionRange eMotionRange, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
  1389. [MarshalAs(UnmanagedType.FunctionPtr)]
  1390. internal _GetSkeletalBoneData GetSkeletalBoneData;
  1391. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1392. internal delegate EVRInputError _GetSkeletalSummaryData(ulong action, EVRSummaryType eSummaryType, ref VRSkeletalSummaryData_t pSkeletalSummaryData);
  1393. [MarshalAs(UnmanagedType.FunctionPtr)]
  1394. internal _GetSkeletalSummaryData GetSkeletalSummaryData;
  1395. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1396. internal delegate EVRInputError _GetSkeletalBoneDataCompressed(ulong action, EVRSkeletalMotionRange eMotionRange, IntPtr pvCompressedData, uint unCompressedSize, ref uint punRequiredCompressedSize);
  1397. [MarshalAs(UnmanagedType.FunctionPtr)]
  1398. internal _GetSkeletalBoneDataCompressed GetSkeletalBoneDataCompressed;
  1399. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1400. internal delegate EVRInputError _DecompressSkeletalBoneData(IntPtr pvCompressedBuffer, uint unCompressedBufferSize, EVRSkeletalTransformSpace eTransformSpace, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);
  1401. [MarshalAs(UnmanagedType.FunctionPtr)]
  1402. internal _DecompressSkeletalBoneData DecompressSkeletalBoneData;
  1403. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1404. internal delegate EVRInputError _TriggerHapticVibrationAction(ulong action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude, ulong ulRestrictToDevice);
  1405. [MarshalAs(UnmanagedType.FunctionPtr)]
  1406. internal _TriggerHapticVibrationAction TriggerHapticVibrationAction;
  1407. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1408. internal delegate EVRInputError _GetActionOrigins(ulong actionSetHandle, ulong digitalActionHandle, [In, Out] ulong[] originsOut, uint originOutCount);
  1409. [MarshalAs(UnmanagedType.FunctionPtr)]
  1410. internal _GetActionOrigins GetActionOrigins;
  1411. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1412. internal delegate EVRInputError _GetOriginLocalizedName(ulong origin, System.Text.StringBuilder pchNameArray, uint unNameArraySize, int unStringSectionsToInclude);
  1413. [MarshalAs(UnmanagedType.FunctionPtr)]
  1414. internal _GetOriginLocalizedName GetOriginLocalizedName;
  1415. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1416. internal delegate EVRInputError _GetOriginTrackedDeviceInfo(ulong origin, ref InputOriginInfo_t pOriginInfo, uint unOriginInfoSize);
  1417. [MarshalAs(UnmanagedType.FunctionPtr)]
  1418. internal _GetOriginTrackedDeviceInfo GetOriginTrackedDeviceInfo;
  1419. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1420. internal delegate EVRInputError _GetActionBindingInfo(ulong action, ref InputBindingInfo_t pOriginInfo, uint unBindingInfoSize, uint unBindingInfoCount, ref uint punReturnedBindingInfoCount);
  1421. [MarshalAs(UnmanagedType.FunctionPtr)]
  1422. internal _GetActionBindingInfo GetActionBindingInfo;
  1423. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1424. internal delegate EVRInputError _ShowActionOrigins(ulong actionSetHandle, ulong ulActionHandle);
  1425. [MarshalAs(UnmanagedType.FunctionPtr)]
  1426. internal _ShowActionOrigins ShowActionOrigins;
  1427. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1428. internal delegate EVRInputError _ShowBindingsForActionSet([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount, ulong originToHighlight);
  1429. [MarshalAs(UnmanagedType.FunctionPtr)]
  1430. internal _ShowBindingsForActionSet ShowBindingsForActionSet;
  1431. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1432. internal delegate EVRInputError _GetComponentStateForBinding(IntPtr pchRenderModelName, IntPtr pchComponentName, ref InputBindingInfo_t pOriginInfo, uint unBindingInfoSize, uint unBindingInfoCount, ref RenderModel_ComponentState_t pComponentState);
  1433. [MarshalAs(UnmanagedType.FunctionPtr)]
  1434. internal _GetComponentStateForBinding GetComponentStateForBinding;
  1435. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1436. internal delegate bool _IsUsingLegacyInput();
  1437. [MarshalAs(UnmanagedType.FunctionPtr)]
  1438. internal _IsUsingLegacyInput IsUsingLegacyInput;
  1439. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1440. internal delegate EVRInputError _OpenBindingUI(IntPtr pchAppKey, ulong ulActionSetHandle, ulong ulDeviceHandle, bool bShowOnDesktop);
  1441. [MarshalAs(UnmanagedType.FunctionPtr)]
  1442. internal _OpenBindingUI OpenBindingUI;
  1443. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1444. internal delegate EVRInputError _GetBindingVariant(ulong ulDevicePath, System.Text.StringBuilder pchVariantArray, uint unVariantArraySize);
  1445. [MarshalAs(UnmanagedType.FunctionPtr)]
  1446. internal _GetBindingVariant GetBindingVariant;
  1447. }
  1448. [StructLayout(LayoutKind.Sequential)]
  1449. public struct IVRIOBuffer
  1450. {
  1451. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1452. internal delegate EIOBufferError _Open(IntPtr pchPath, EIOBufferMode mode, uint unElementSize, uint unElements, ref ulong pulBuffer);
  1453. [MarshalAs(UnmanagedType.FunctionPtr)]
  1454. internal _Open Open;
  1455. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1456. internal delegate EIOBufferError _Close(ulong ulBuffer);
  1457. [MarshalAs(UnmanagedType.FunctionPtr)]
  1458. internal _Close Close;
  1459. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1460. internal delegate EIOBufferError _Read(ulong ulBuffer, IntPtr pDst, uint unBytes, ref uint punRead);
  1461. [MarshalAs(UnmanagedType.FunctionPtr)]
  1462. internal _Read Read;
  1463. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1464. internal delegate EIOBufferError _Write(ulong ulBuffer, IntPtr pSrc, uint unBytes);
  1465. [MarshalAs(UnmanagedType.FunctionPtr)]
  1466. internal _Write Write;
  1467. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1468. internal delegate ulong _PropertyContainer(ulong ulBuffer);
  1469. [MarshalAs(UnmanagedType.FunctionPtr)]
  1470. internal _PropertyContainer PropertyContainer;
  1471. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1472. internal delegate bool _HasReaders(ulong ulBuffer);
  1473. [MarshalAs(UnmanagedType.FunctionPtr)]
  1474. internal _HasReaders HasReaders;
  1475. }
  1476. [StructLayout(LayoutKind.Sequential)]
  1477. public struct IVRSpatialAnchors
  1478. {
  1479. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1480. internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromDescriptor(IntPtr pchDescriptor, ref uint pHandleOut);
  1481. [MarshalAs(UnmanagedType.FunctionPtr)]
  1482. internal _CreateSpatialAnchorFromDescriptor CreateSpatialAnchorFromDescriptor;
  1483. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1484. internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromPose(uint unDeviceIndex, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPose, ref uint pHandleOut);
  1485. [MarshalAs(UnmanagedType.FunctionPtr)]
  1486. internal _CreateSpatialAnchorFromPose CreateSpatialAnchorFromPose;
  1487. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1488. internal delegate EVRSpatialAnchorError _GetSpatialAnchorPose(uint unHandle, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPoseOut);
  1489. [MarshalAs(UnmanagedType.FunctionPtr)]
  1490. internal _GetSpatialAnchorPose GetSpatialAnchorPose;
  1491. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1492. internal delegate EVRSpatialAnchorError _GetSpatialAnchorDescriptor(uint unHandle, System.Text.StringBuilder pchDescriptorOut, ref uint punDescriptorBufferLenInOut);
  1493. [MarshalAs(UnmanagedType.FunctionPtr)]
  1494. internal _GetSpatialAnchorDescriptor GetSpatialAnchorDescriptor;
  1495. }
  1496. [StructLayout(LayoutKind.Sequential)]
  1497. public struct IVRDebug
  1498. {
  1499. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1500. internal delegate EVRDebugError _EmitVrProfilerEvent(IntPtr pchMessage);
  1501. [MarshalAs(UnmanagedType.FunctionPtr)]
  1502. internal _EmitVrProfilerEvent EmitVrProfilerEvent;
  1503. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1504. internal delegate EVRDebugError _BeginVrProfilerEvent(ref ulong pHandleOut);
  1505. [MarshalAs(UnmanagedType.FunctionPtr)]
  1506. internal _BeginVrProfilerEvent BeginVrProfilerEvent;
  1507. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1508. internal delegate EVRDebugError _FinishVrProfilerEvent(ulong hHandle, IntPtr pchMessage);
  1509. [MarshalAs(UnmanagedType.FunctionPtr)]
  1510. internal _FinishVrProfilerEvent FinishVrProfilerEvent;
  1511. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1512. internal delegate uint _DriverDebugRequest(uint unDeviceIndex, IntPtr pchRequest, System.Text.StringBuilder pchResponseBuffer, uint unResponseBufferSize);
  1513. [MarshalAs(UnmanagedType.FunctionPtr)]
  1514. internal _DriverDebugRequest DriverDebugRequest;
  1515. }
  1516. [StructLayout(LayoutKind.Sequential)]
  1517. public struct IVRProperties
  1518. {
  1519. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1520. internal delegate ETrackedPropertyError _ReadPropertyBatch(ulong ulContainerHandle, ref PropertyRead_t pBatch, uint unBatchEntryCount);
  1521. [MarshalAs(UnmanagedType.FunctionPtr)]
  1522. internal _ReadPropertyBatch ReadPropertyBatch;
  1523. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1524. internal delegate ETrackedPropertyError _WritePropertyBatch(ulong ulContainerHandle, ref PropertyWrite_t pBatch, uint unBatchEntryCount);
  1525. [MarshalAs(UnmanagedType.FunctionPtr)]
  1526. internal _WritePropertyBatch WritePropertyBatch;
  1527. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1528. internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);
  1529. [MarshalAs(UnmanagedType.FunctionPtr)]
  1530. internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;
  1531. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1532. internal delegate ulong _TrackedDeviceToPropertyContainer(uint nDevice);
  1533. [MarshalAs(UnmanagedType.FunctionPtr)]
  1534. internal _TrackedDeviceToPropertyContainer TrackedDeviceToPropertyContainer;
  1535. }
  1536. [StructLayout(LayoutKind.Sequential)]
  1537. public struct IVRPaths
  1538. {
  1539. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1540. internal delegate ETrackedPropertyError _ReadPathBatch(ulong ulRootHandle, ref PathRead_t pBatch, uint unBatchEntryCount);
  1541. [MarshalAs(UnmanagedType.FunctionPtr)]
  1542. internal _ReadPathBatch ReadPathBatch;
  1543. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1544. internal delegate ETrackedPropertyError _WritePathBatch(ulong ulRootHandle, ref PathWrite_t pBatch, uint unBatchEntryCount);
  1545. [MarshalAs(UnmanagedType.FunctionPtr)]
  1546. internal _WritePathBatch WritePathBatch;
  1547. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1548. internal delegate ETrackedPropertyError _StringToHandle(ref ulong pHandle, IntPtr pchPath);
  1549. [MarshalAs(UnmanagedType.FunctionPtr)]
  1550. internal _StringToHandle StringToHandle;
  1551. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1552. internal delegate ETrackedPropertyError _HandleToString(ulong pHandle, string pchBuffer, uint unBufferSize, ref uint punBufferSizeUsed);
  1553. [MarshalAs(UnmanagedType.FunctionPtr)]
  1554. internal _HandleToString HandleToString;
  1555. }
  1556. [StructLayout(LayoutKind.Sequential)]
  1557. public struct IVRBlockQueue
  1558. {
  1559. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1560. internal delegate EBlockQueueError _Create(ref ulong pulQueueHandle, IntPtr pchPath, uint unBlockDataSize, uint unBlockHeaderSize, uint unBlockCount);
  1561. [MarshalAs(UnmanagedType.FunctionPtr)]
  1562. internal _Create Create;
  1563. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1564. internal delegate EBlockQueueError _Connect(ref ulong pulQueueHandle, IntPtr pchPath);
  1565. [MarshalAs(UnmanagedType.FunctionPtr)]
  1566. internal _Connect Connect;
  1567. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1568. internal delegate EBlockQueueError _Destroy(ulong ulQueueHandle);
  1569. [MarshalAs(UnmanagedType.FunctionPtr)]
  1570. internal _Destroy Destroy;
  1571. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1572. internal delegate EBlockQueueError _AcquireWriteOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer);
  1573. [MarshalAs(UnmanagedType.FunctionPtr)]
  1574. internal _AcquireWriteOnlyBlock AcquireWriteOnlyBlock;
  1575. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1576. internal delegate EBlockQueueError _ReleaseWriteOnlyBlock(ulong ulQueueHandle, ulong ulBlockHandle);
  1577. [MarshalAs(UnmanagedType.FunctionPtr)]
  1578. internal _ReleaseWriteOnlyBlock ReleaseWriteOnlyBlock;
  1579. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1580. internal delegate EBlockQueueError _WaitAndAcquireReadOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer, EBlockQueueReadType eReadType, uint unTimeoutMs);
  1581. [MarshalAs(UnmanagedType.FunctionPtr)]
  1582. internal _WaitAndAcquireReadOnlyBlock WaitAndAcquireReadOnlyBlock;
  1583. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1584. internal delegate EBlockQueueError _AcquireReadOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer, EBlockQueueReadType eReadType);
  1585. [MarshalAs(UnmanagedType.FunctionPtr)]
  1586. internal _AcquireReadOnlyBlock AcquireReadOnlyBlock;
  1587. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1588. internal delegate EBlockQueueError _ReleaseReadOnlyBlock(ulong ulQueueHandle, ulong ulBlockHandle);
  1589. [MarshalAs(UnmanagedType.FunctionPtr)]
  1590. internal _ReleaseReadOnlyBlock ReleaseReadOnlyBlock;
  1591. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1592. internal delegate EBlockQueueError _QueueHasReader(ulong ulQueueHandle, ref bool pbHasReaders);
  1593. [MarshalAs(UnmanagedType.FunctionPtr)]
  1594. internal _QueueHasReader QueueHasReader;
  1595. }
  1596. public class Utils
  1597. {
  1598. public static IntPtr ToUtf8(string managedString)
  1599. {
  1600. if (managedString == null)
  1601. {
  1602. return IntPtr.Zero;
  1603. }
  1604. int size = System.Text.Encoding.UTF8.GetByteCount(managedString) + 1;
  1605. if (buffer.Length < size) buffer = new byte[size];
  1606. int written = System.Text.Encoding.UTF8.GetBytes(managedString, 0, managedString.Length, buffer, 0);
  1607. buffer[written] = 0x00; // null terminate
  1608. IntPtr nativeUtf8 = Marshal.AllocHGlobal(written+1);
  1609. Marshal.Copy(buffer, 0, nativeUtf8, written+1);
  1610. return nativeUtf8;
  1611. }
  1612. private static byte[] buffer = new byte[1024];
  1613. }
  1614. public class CVRSystem
  1615. {
  1616. IVRSystem FnTable;
  1617. internal CVRSystem(IntPtr pInterface)
  1618. {
  1619. FnTable = (IVRSystem)Marshal.PtrToStructure(pInterface, typeof(IVRSystem));
  1620. }
  1621. public void GetRecommendedRenderTargetSize(ref uint pnWidth,ref uint pnHeight)
  1622. {
  1623. pnWidth = 0;
  1624. pnHeight = 0;
  1625. FnTable.GetRecommendedRenderTargetSize(ref pnWidth,ref pnHeight);
  1626. }
  1627. public HmdMatrix44_t GetProjectionMatrix(EVREye eEye,float fNearZ,float fFarZ)
  1628. {
  1629. HmdMatrix44_t result = FnTable.GetProjectionMatrix(eEye,fNearZ,fFarZ);
  1630. return result;
  1631. }
  1632. public void GetProjectionRaw(EVREye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom)
  1633. {
  1634. pfLeft = 0;
  1635. pfRight = 0;
  1636. pfTop = 0;
  1637. pfBottom = 0;
  1638. FnTable.GetProjectionRaw(eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom);
  1639. }
  1640. public bool ComputeDistortion(EVREye eEye,float fU,float fV,ref DistortionCoordinates_t pDistortionCoordinates)
  1641. {
  1642. bool result = FnTable.ComputeDistortion(eEye,fU,fV,ref pDistortionCoordinates);
  1643. return result;
  1644. }
  1645. public HmdMatrix34_t GetEyeToHeadTransform(EVREye eEye)
  1646. {
  1647. HmdMatrix34_t result = FnTable.GetEyeToHeadTransform(eEye);
  1648. return result;
  1649. }
  1650. public bool GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync,ref ulong pulFrameCounter)
  1651. {
  1652. pfSecondsSinceLastVsync = 0;
  1653. pulFrameCounter = 0;
  1654. bool result = FnTable.GetTimeSinceLastVsync(ref pfSecondsSinceLastVsync,ref pulFrameCounter);
  1655. return result;
  1656. }
  1657. public int GetD3D9AdapterIndex()
  1658. {
  1659. int result = FnTable.GetD3D9AdapterIndex();
  1660. return result;
  1661. }
  1662. public void GetDXGIOutputInfo(ref int pnAdapterIndex)
  1663. {
  1664. pnAdapterIndex = 0;
  1665. FnTable.GetDXGIOutputInfo(ref pnAdapterIndex);
  1666. }
  1667. public void GetOutputDevice(ref ulong pnDevice,ETextureType textureType,IntPtr pInstance)
  1668. {
  1669. pnDevice = 0;
  1670. FnTable.GetOutputDevice(ref pnDevice,textureType,pInstance);
  1671. }
  1672. public bool IsDisplayOnDesktop()
  1673. {
  1674. bool result = FnTable.IsDisplayOnDesktop();
  1675. return result;
  1676. }
  1677. public bool SetDisplayVisibility(bool bIsVisibleOnDesktop)
  1678. {
  1679. bool result = FnTable.SetDisplayVisibility(bIsVisibleOnDesktop);
  1680. return result;
  1681. }
  1682. public void GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,float fPredictedSecondsToPhotonsFromNow,TrackedDevicePose_t [] pTrackedDevicePoseArray)
  1683. {
  1684. FnTable.GetDeviceToAbsoluteTrackingPose(eOrigin,fPredictedSecondsToPhotonsFromNow,pTrackedDevicePoseArray,(uint) pTrackedDevicePoseArray.Length);
  1685. }
  1686. public HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose()
  1687. {
  1688. HmdMatrix34_t result = FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
  1689. return result;
  1690. }
  1691. public HmdMatrix34_t GetRawZeroPoseToStandingAbsoluteTrackingPose()
  1692. {
  1693. HmdMatrix34_t result = FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose();
  1694. return result;
  1695. }
  1696. public uint GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass,uint [] punTrackedDeviceIndexArray,uint unRelativeToTrackedDeviceIndex)
  1697. {
  1698. uint result = FnTable.GetSortedTrackedDeviceIndicesOfClass(eTrackedDeviceClass,punTrackedDeviceIndexArray,(uint) punTrackedDeviceIndexArray.Length,unRelativeToTrackedDeviceIndex);
  1699. return result;
  1700. }
  1701. public EDeviceActivityLevel GetTrackedDeviceActivityLevel(uint unDeviceId)
  1702. {
  1703. EDeviceActivityLevel result = FnTable.GetTrackedDeviceActivityLevel(unDeviceId);
  1704. return result;
  1705. }
  1706. public void ApplyTransform(ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pTrackedDevicePose,ref HmdMatrix34_t pTransform)
  1707. {
  1708. FnTable.ApplyTransform(ref pOutputPose,ref pTrackedDevicePose,ref pTransform);
  1709. }
  1710. public uint GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType)
  1711. {
  1712. uint result = FnTable.GetTrackedDeviceIndexForControllerRole(unDeviceType);
  1713. return result;
  1714. }
  1715. public ETrackedControllerRole GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex)
  1716. {
  1717. ETrackedControllerRole result = FnTable.GetControllerRoleForTrackedDeviceIndex(unDeviceIndex);
  1718. return result;
  1719. }
  1720. public ETrackedDeviceClass GetTrackedDeviceClass(uint unDeviceIndex)
  1721. {
  1722. ETrackedDeviceClass result = FnTable.GetTrackedDeviceClass(unDeviceIndex);
  1723. return result;
  1724. }
  1725. public bool IsTrackedDeviceConnected(uint unDeviceIndex)
  1726. {
  1727. bool result = FnTable.IsTrackedDeviceConnected(unDeviceIndex);
  1728. return result;
  1729. }
  1730. public bool GetBoolTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
  1731. {
  1732. bool result = FnTable.GetBoolTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
  1733. return result;
  1734. }
  1735. public float GetFloatTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
  1736. {
  1737. float result = FnTable.GetFloatTrackedDeviceProperty(unDeviceIndex,prop,ref pError);
  1738. return result;
  1739. }
  1740. public int GetInt32TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
  1741. {
  1742. int result = FnTable.GetInt32TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
  1743. return result;
  1744. }
  1745. public ulong GetUint64TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
  1746. {
  1747. ulong result = FnTable.GetUint64TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
  1748. return result;
  1749. }
  1750. public HmdMatrix34_t GetMatrix34TrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,ref ETrackedPropertyError pError)
  1751. {
  1752. HmdMatrix34_t result = FnTable.GetMatrix34TrackedDeviceProperty(unDeviceIndex,prop,ref pError);
  1753. return result;
  1754. }
  1755. public uint GetArrayTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,uint propType,IntPtr pBuffer,uint unBufferSize,ref ETrackedPropertyError pError)
  1756. {
  1757. uint result = FnTable.GetArrayTrackedDeviceProperty(unDeviceIndex,prop,propType,pBuffer,unBufferSize,ref pError);
  1758. return result;
  1759. }
  1760. public uint GetStringTrackedDeviceProperty(uint unDeviceIndex,ETrackedDeviceProperty prop,System.Text.StringBuilder pchValue,uint unBufferSize,ref ETrackedPropertyError pError)
  1761. {
  1762. uint result = FnTable.GetStringTrackedDeviceProperty(unDeviceIndex,prop,pchValue,unBufferSize,ref pError);
  1763. return result;
  1764. }
  1765. public string GetPropErrorNameFromEnum(ETrackedPropertyError error)
  1766. {
  1767. IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
  1768. return Marshal.PtrToStringAnsi(result);
  1769. }
  1770. // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
  1771. // originally mis-compiled with the wrong packing for Linux and OSX.
  1772. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1773. internal delegate bool _PollNextEventPacked(ref VREvent_t_Packed pEvent,uint uncbVREvent);
  1774. [StructLayout(LayoutKind.Explicit)]
  1775. struct PollNextEventUnion
  1776. {
  1777. [FieldOffset(0)]
  1778. public IVRSystem._PollNextEvent pPollNextEvent;
  1779. [FieldOffset(0)]
  1780. public _PollNextEventPacked pPollNextEventPacked;
  1781. }
  1782. public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
  1783. {
  1784. #if !UNITY_METRO
  1785. if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
  1786. (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
  1787. {
  1788. PollNextEventUnion u;
  1789. VREvent_t_Packed event_packed = new VREvent_t_Packed();
  1790. u.pPollNextEventPacked = null;
  1791. u.pPollNextEvent = FnTable.PollNextEvent;
  1792. bool packed_result = u.pPollNextEventPacked(ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
  1793. event_packed.Unpack(ref pEvent);
  1794. return packed_result;
  1795. }
  1796. #endif
  1797. bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
  1798. return result;
  1799. }
  1800. public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
  1801. {
  1802. bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
  1803. return result;
  1804. }
  1805. public string GetEventTypeNameFromEnum(EVREventType eType)
  1806. {
  1807. IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
  1808. return Marshal.PtrToStringAnsi(result);
  1809. }
  1810. public HiddenAreaMesh_t GetHiddenAreaMesh(EVREye eEye,EHiddenAreaMeshType type)
  1811. {
  1812. HiddenAreaMesh_t result = FnTable.GetHiddenAreaMesh(eEye,type);
  1813. return result;
  1814. }
  1815. // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
  1816. // originally mis-compiled with the wrong packing for Linux and OSX.
  1817. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1818. internal delegate bool _GetControllerStatePacked(uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize);
  1819. [StructLayout(LayoutKind.Explicit)]
  1820. struct GetControllerStateUnion
  1821. {
  1822. [FieldOffset(0)]
  1823. public IVRSystem._GetControllerState pGetControllerState;
  1824. [FieldOffset(0)]
  1825. public _GetControllerStatePacked pGetControllerStatePacked;
  1826. }
  1827. public bool GetControllerState(uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize)
  1828. {
  1829. #if !UNITY_METRO
  1830. if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
  1831. (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
  1832. {
  1833. GetControllerStateUnion u;
  1834. VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
  1835. u.pGetControllerStatePacked = null;
  1836. u.pGetControllerState = FnTable.GetControllerState;
  1837. bool packed_result = u.pGetControllerStatePacked(unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)));
  1838. state_packed.Unpack(ref pControllerState);
  1839. return packed_result;
  1840. }
  1841. #endif
  1842. bool result = FnTable.GetControllerState(unControllerDeviceIndex,ref pControllerState,unControllerStateSize);
  1843. return result;
  1844. }
  1845. // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
  1846. // originally mis-compiled with the wrong packing for Linux and OSX.
  1847. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1848. internal delegate bool _GetControllerStateWithPosePacked(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t_Packed pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose);
  1849. [StructLayout(LayoutKind.Explicit)]
  1850. struct GetControllerStateWithPoseUnion
  1851. {
  1852. [FieldOffset(0)]
  1853. public IVRSystem._GetControllerStateWithPose pGetControllerStateWithPose;
  1854. [FieldOffset(0)]
  1855. public _GetControllerStateWithPosePacked pGetControllerStateWithPosePacked;
  1856. }
  1857. public bool GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin,uint unControllerDeviceIndex,ref VRControllerState_t pControllerState,uint unControllerStateSize,ref TrackedDevicePose_t pTrackedDevicePose)
  1858. {
  1859. #if !UNITY_METRO
  1860. if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
  1861. (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
  1862. {
  1863. GetControllerStateWithPoseUnion u;
  1864. VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
  1865. u.pGetControllerStateWithPosePacked = null;
  1866. u.pGetControllerStateWithPose = FnTable.GetControllerStateWithPose;
  1867. bool packed_result = u.pGetControllerStateWithPosePacked(eOrigin,unControllerDeviceIndex,ref state_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRControllerState_t_Packed)),ref pTrackedDevicePose);
  1868. state_packed.Unpack(ref pControllerState);
  1869. return packed_result;
  1870. }
  1871. #endif
  1872. bool result = FnTable.GetControllerStateWithPose(eOrigin,unControllerDeviceIndex,ref pControllerState,unControllerStateSize,ref pTrackedDevicePose);
  1873. return result;
  1874. }
  1875. public void TriggerHapticPulse(uint unControllerDeviceIndex,uint unAxisId,ushort usDurationMicroSec)
  1876. {
  1877. FnTable.TriggerHapticPulse(unControllerDeviceIndex,unAxisId,usDurationMicroSec);
  1878. }
  1879. public string GetButtonIdNameFromEnum(EVRButtonId eButtonId)
  1880. {
  1881. IntPtr result = FnTable.GetButtonIdNameFromEnum(eButtonId);
  1882. return Marshal.PtrToStringAnsi(result);
  1883. }
  1884. public string GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType)
  1885. {
  1886. IntPtr result = FnTable.GetControllerAxisTypeNameFromEnum(eAxisType);
  1887. return Marshal.PtrToStringAnsi(result);
  1888. }
  1889. public bool IsInputAvailable()
  1890. {
  1891. bool result = FnTable.IsInputAvailable();
  1892. return result;
  1893. }
  1894. public bool IsSteamVRDrawingControllers()
  1895. {
  1896. bool result = FnTable.IsSteamVRDrawingControllers();
  1897. return result;
  1898. }
  1899. public bool ShouldApplicationPause()
  1900. {
  1901. bool result = FnTable.ShouldApplicationPause();
  1902. return result;
  1903. }
  1904. public bool ShouldApplicationReduceRenderingWork()
  1905. {
  1906. bool result = FnTable.ShouldApplicationReduceRenderingWork();
  1907. return result;
  1908. }
  1909. public EVRFirmwareError PerformFirmwareUpdate(uint unDeviceIndex)
  1910. {
  1911. EVRFirmwareError result = FnTable.PerformFirmwareUpdate(unDeviceIndex);
  1912. return result;
  1913. }
  1914. public void AcknowledgeQuit_Exiting()
  1915. {
  1916. FnTable.AcknowledgeQuit_Exiting();
  1917. }
  1918. public uint GetAppContainerFilePaths(System.Text.StringBuilder pchBuffer,uint unBufferSize)
  1919. {
  1920. uint result = FnTable.GetAppContainerFilePaths(pchBuffer,unBufferSize);
  1921. return result;
  1922. }
  1923. public string GetRuntimeVersion()
  1924. {
  1925. IntPtr result = FnTable.GetRuntimeVersion();
  1926. return Marshal.PtrToStringAnsi(result);
  1927. }
  1928. }
  1929. public class CVRExtendedDisplay
  1930. {
  1931. IVRExtendedDisplay FnTable;
  1932. internal CVRExtendedDisplay(IntPtr pInterface)
  1933. {
  1934. FnTable = (IVRExtendedDisplay)Marshal.PtrToStructure(pInterface, typeof(IVRExtendedDisplay));
  1935. }
  1936. public void GetWindowBounds(ref int pnX,ref int pnY,ref uint pnWidth,ref uint pnHeight)
  1937. {
  1938. pnX = 0;
  1939. pnY = 0;
  1940. pnWidth = 0;
  1941. pnHeight = 0;
  1942. FnTable.GetWindowBounds(ref pnX,ref pnY,ref pnWidth,ref pnHeight);
  1943. }
  1944. public void GetEyeOutputViewport(EVREye eEye,ref uint pnX,ref uint pnY,ref uint pnWidth,ref uint pnHeight)
  1945. {
  1946. pnX = 0;
  1947. pnY = 0;
  1948. pnWidth = 0;
  1949. pnHeight = 0;
  1950. FnTable.GetEyeOutputViewport(eEye,ref pnX,ref pnY,ref pnWidth,ref pnHeight);
  1951. }
  1952. public void GetDXGIOutputInfo(ref int pnAdapterIndex,ref int pnAdapterOutputIndex)
  1953. {
  1954. pnAdapterIndex = 0;
  1955. pnAdapterOutputIndex = 0;
  1956. FnTable.GetDXGIOutputInfo(ref pnAdapterIndex,ref pnAdapterOutputIndex);
  1957. }
  1958. }
  1959. public class CVRTrackedCamera
  1960. {
  1961. IVRTrackedCamera FnTable;
  1962. internal CVRTrackedCamera(IntPtr pInterface)
  1963. {
  1964. FnTable = (IVRTrackedCamera)Marshal.PtrToStructure(pInterface, typeof(IVRTrackedCamera));
  1965. }
  1966. public string GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError)
  1967. {
  1968. IntPtr result = FnTable.GetCameraErrorNameFromEnum(eCameraError);
  1969. return Marshal.PtrToStringAnsi(result);
  1970. }
  1971. public EVRTrackedCameraError HasCamera(uint nDeviceIndex,ref bool pHasCamera)
  1972. {
  1973. pHasCamera = false;
  1974. EVRTrackedCameraError result = FnTable.HasCamera(nDeviceIndex,ref pHasCamera);
  1975. return result;
  1976. }
  1977. public EVRTrackedCameraError GetCameraFrameSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref uint pnWidth,ref uint pnHeight,ref uint pnFrameBufferSize)
  1978. {
  1979. pnWidth = 0;
  1980. pnHeight = 0;
  1981. pnFrameBufferSize = 0;
  1982. EVRTrackedCameraError result = FnTable.GetCameraFrameSize(nDeviceIndex,eFrameType,ref pnWidth,ref pnHeight,ref pnFrameBufferSize);
  1983. return result;
  1984. }
  1985. public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex,uint nCameraIndex,EVRTrackedCameraFrameType eFrameType,ref HmdVector2_t pFocalLength,ref HmdVector2_t pCenter)
  1986. {
  1987. EVRTrackedCameraError result = FnTable.GetCameraIntrinsics(nDeviceIndex,nCameraIndex,eFrameType,ref pFocalLength,ref pCenter);
  1988. return result;
  1989. }
  1990. public EVRTrackedCameraError GetCameraProjection(uint nDeviceIndex,uint nCameraIndex,EVRTrackedCameraFrameType eFrameType,float flZNear,float flZFar,ref HmdMatrix44_t pProjection)
  1991. {
  1992. EVRTrackedCameraError result = FnTable.GetCameraProjection(nDeviceIndex,nCameraIndex,eFrameType,flZNear,flZFar,ref pProjection);
  1993. return result;
  1994. }
  1995. public EVRTrackedCameraError AcquireVideoStreamingService(uint nDeviceIndex,ref ulong pHandle)
  1996. {
  1997. pHandle = 0;
  1998. EVRTrackedCameraError result = FnTable.AcquireVideoStreamingService(nDeviceIndex,ref pHandle);
  1999. return result;
  2000. }
  2001. public EVRTrackedCameraError ReleaseVideoStreamingService(ulong hTrackedCamera)
  2002. {
  2003. EVRTrackedCameraError result = FnTable.ReleaseVideoStreamingService(hTrackedCamera);
  2004. return result;
  2005. }
  2006. public EVRTrackedCameraError GetVideoStreamFrameBuffer(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pFrameBuffer,uint nFrameBufferSize,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
  2007. {
  2008. EVRTrackedCameraError result = FnTable.GetVideoStreamFrameBuffer(hTrackedCamera,eFrameType,pFrameBuffer,nFrameBufferSize,ref pFrameHeader,nFrameHeaderSize);
  2009. return result;
  2010. }
  2011. public EVRTrackedCameraError GetVideoStreamTextureSize(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref VRTextureBounds_t pTextureBounds,ref uint pnWidth,ref uint pnHeight)
  2012. {
  2013. pnWidth = 0;
  2014. pnHeight = 0;
  2015. EVRTrackedCameraError result = FnTable.GetVideoStreamTextureSize(nDeviceIndex,eFrameType,ref pTextureBounds,ref pnWidth,ref pnHeight);
  2016. return result;
  2017. }
  2018. public EVRTrackedCameraError GetVideoStreamTextureD3D11(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
  2019. {
  2020. EVRTrackedCameraError result = FnTable.GetVideoStreamTextureD3D11(hTrackedCamera,eFrameType,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView,ref pFrameHeader,nFrameHeaderSize);
  2021. return result;
  2022. }
  2023. public EVRTrackedCameraError GetVideoStreamTextureGL(ulong hTrackedCamera,EVRTrackedCameraFrameType eFrameType,ref uint pglTextureId,ref CameraVideoStreamFrameHeader_t pFrameHeader,uint nFrameHeaderSize)
  2024. {
  2025. pglTextureId = 0;
  2026. EVRTrackedCameraError result = FnTable.GetVideoStreamTextureGL(hTrackedCamera,eFrameType,ref pglTextureId,ref pFrameHeader,nFrameHeaderSize);
  2027. return result;
  2028. }
  2029. public EVRTrackedCameraError ReleaseVideoStreamTextureGL(ulong hTrackedCamera,uint glTextureId)
  2030. {
  2031. EVRTrackedCameraError result = FnTable.ReleaseVideoStreamTextureGL(hTrackedCamera,glTextureId);
  2032. return result;
  2033. }
  2034. public void SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse)
  2035. {
  2036. FnTable.SetCameraTrackingSpace(eUniverse);
  2037. }
  2038. public ETrackingUniverseOrigin GetCameraTrackingSpace()
  2039. {
  2040. ETrackingUniverseOrigin result = FnTable.GetCameraTrackingSpace();
  2041. return result;
  2042. }
  2043. }
  2044. public class CVRApplications
  2045. {
  2046. IVRApplications FnTable;
  2047. internal CVRApplications(IntPtr pInterface)
  2048. {
  2049. FnTable = (IVRApplications)Marshal.PtrToStructure(pInterface, typeof(IVRApplications));
  2050. }
  2051. public EVRApplicationError AddApplicationManifest(string pchApplicationManifestFullPath,bool bTemporary)
  2052. {
  2053. IntPtr pchApplicationManifestFullPathUtf8 = Utils.ToUtf8(pchApplicationManifestFullPath);
  2054. EVRApplicationError result = FnTable.AddApplicationManifest(pchApplicationManifestFullPathUtf8,bTemporary);
  2055. Marshal.FreeHGlobal(pchApplicationManifestFullPathUtf8);
  2056. return result;
  2057. }
  2058. public EVRApplicationError RemoveApplicationManifest(string pchApplicationManifestFullPath)
  2059. {
  2060. IntPtr pchApplicationManifestFullPathUtf8 = Utils.ToUtf8(pchApplicationManifestFullPath);
  2061. EVRApplicationError result = FnTable.RemoveApplicationManifest(pchApplicationManifestFullPathUtf8);
  2062. Marshal.FreeHGlobal(pchApplicationManifestFullPathUtf8);
  2063. return result;
  2064. }
  2065. public bool IsApplicationInstalled(string pchAppKey)
  2066. {
  2067. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2068. bool result = FnTable.IsApplicationInstalled(pchAppKeyUtf8);
  2069. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2070. return result;
  2071. }
  2072. public uint GetApplicationCount()
  2073. {
  2074. uint result = FnTable.GetApplicationCount();
  2075. return result;
  2076. }
  2077. public EVRApplicationError GetApplicationKeyByIndex(uint unApplicationIndex,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
  2078. {
  2079. EVRApplicationError result = FnTable.GetApplicationKeyByIndex(unApplicationIndex,pchAppKeyBuffer,unAppKeyBufferLen);
  2080. return result;
  2081. }
  2082. public EVRApplicationError GetApplicationKeyByProcessId(uint unProcessId,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
  2083. {
  2084. EVRApplicationError result = FnTable.GetApplicationKeyByProcessId(unProcessId,pchAppKeyBuffer,unAppKeyBufferLen);
  2085. return result;
  2086. }
  2087. public EVRApplicationError LaunchApplication(string pchAppKey)
  2088. {
  2089. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2090. EVRApplicationError result = FnTable.LaunchApplication(pchAppKeyUtf8);
  2091. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2092. return result;
  2093. }
  2094. public EVRApplicationError LaunchTemplateApplication(string pchTemplateAppKey,string pchNewAppKey,AppOverrideKeys_t [] pKeys)
  2095. {
  2096. IntPtr pchTemplateAppKeyUtf8 = Utils.ToUtf8(pchTemplateAppKey);
  2097. IntPtr pchNewAppKeyUtf8 = Utils.ToUtf8(pchNewAppKey);
  2098. EVRApplicationError result = FnTable.LaunchTemplateApplication(pchTemplateAppKeyUtf8,pchNewAppKeyUtf8,pKeys,(uint) pKeys.Length);
  2099. Marshal.FreeHGlobal(pchTemplateAppKeyUtf8);
  2100. Marshal.FreeHGlobal(pchNewAppKeyUtf8);
  2101. return result;
  2102. }
  2103. public EVRApplicationError LaunchApplicationFromMimeType(string pchMimeType,string pchArgs)
  2104. {
  2105. IntPtr pchMimeTypeUtf8 = Utils.ToUtf8(pchMimeType);
  2106. IntPtr pchArgsUtf8 = Utils.ToUtf8(pchArgs);
  2107. EVRApplicationError result = FnTable.LaunchApplicationFromMimeType(pchMimeTypeUtf8,pchArgsUtf8);
  2108. Marshal.FreeHGlobal(pchMimeTypeUtf8);
  2109. Marshal.FreeHGlobal(pchArgsUtf8);
  2110. return result;
  2111. }
  2112. public EVRApplicationError LaunchDashboardOverlay(string pchAppKey)
  2113. {
  2114. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2115. EVRApplicationError result = FnTable.LaunchDashboardOverlay(pchAppKeyUtf8);
  2116. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2117. return result;
  2118. }
  2119. public bool CancelApplicationLaunch(string pchAppKey)
  2120. {
  2121. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2122. bool result = FnTable.CancelApplicationLaunch(pchAppKeyUtf8);
  2123. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2124. return result;
  2125. }
  2126. public EVRApplicationError IdentifyApplication(uint unProcessId,string pchAppKey)
  2127. {
  2128. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2129. EVRApplicationError result = FnTable.IdentifyApplication(unProcessId,pchAppKeyUtf8);
  2130. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2131. return result;
  2132. }
  2133. public uint GetApplicationProcessId(string pchAppKey)
  2134. {
  2135. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2136. uint result = FnTable.GetApplicationProcessId(pchAppKeyUtf8);
  2137. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2138. return result;
  2139. }
  2140. public string GetApplicationsErrorNameFromEnum(EVRApplicationError error)
  2141. {
  2142. IntPtr result = FnTable.GetApplicationsErrorNameFromEnum(error);
  2143. return Marshal.PtrToStringAnsi(result);
  2144. }
  2145. public uint GetApplicationPropertyString(string pchAppKey,EVRApplicationProperty eProperty,System.Text.StringBuilder pchPropertyValueBuffer,uint unPropertyValueBufferLen,ref EVRApplicationError peError)
  2146. {
  2147. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2148. uint result = FnTable.GetApplicationPropertyString(pchAppKeyUtf8,eProperty,pchPropertyValueBuffer,unPropertyValueBufferLen,ref peError);
  2149. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2150. return result;
  2151. }
  2152. public bool GetApplicationPropertyBool(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
  2153. {
  2154. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2155. bool result = FnTable.GetApplicationPropertyBool(pchAppKeyUtf8,eProperty,ref peError);
  2156. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2157. return result;
  2158. }
  2159. public ulong GetApplicationPropertyUint64(string pchAppKey,EVRApplicationProperty eProperty,ref EVRApplicationError peError)
  2160. {
  2161. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2162. ulong result = FnTable.GetApplicationPropertyUint64(pchAppKeyUtf8,eProperty,ref peError);
  2163. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2164. return result;
  2165. }
  2166. public EVRApplicationError SetApplicationAutoLaunch(string pchAppKey,bool bAutoLaunch)
  2167. {
  2168. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2169. EVRApplicationError result = FnTable.SetApplicationAutoLaunch(pchAppKeyUtf8,bAutoLaunch);
  2170. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2171. return result;
  2172. }
  2173. public bool GetApplicationAutoLaunch(string pchAppKey)
  2174. {
  2175. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2176. bool result = FnTable.GetApplicationAutoLaunch(pchAppKeyUtf8);
  2177. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2178. return result;
  2179. }
  2180. public EVRApplicationError SetDefaultApplicationForMimeType(string pchAppKey,string pchMimeType)
  2181. {
  2182. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2183. IntPtr pchMimeTypeUtf8 = Utils.ToUtf8(pchMimeType);
  2184. EVRApplicationError result = FnTable.SetDefaultApplicationForMimeType(pchAppKeyUtf8,pchMimeTypeUtf8);
  2185. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2186. Marshal.FreeHGlobal(pchMimeTypeUtf8);
  2187. return result;
  2188. }
  2189. public bool GetDefaultApplicationForMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
  2190. {
  2191. IntPtr pchMimeTypeUtf8 = Utils.ToUtf8(pchMimeType);
  2192. bool result = FnTable.GetDefaultApplicationForMimeType(pchMimeTypeUtf8,pchAppKeyBuffer,unAppKeyBufferLen);
  2193. Marshal.FreeHGlobal(pchMimeTypeUtf8);
  2194. return result;
  2195. }
  2196. public bool GetApplicationSupportedMimeTypes(string pchAppKey,System.Text.StringBuilder pchMimeTypesBuffer,uint unMimeTypesBuffer)
  2197. {
  2198. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2199. bool result = FnTable.GetApplicationSupportedMimeTypes(pchAppKeyUtf8,pchMimeTypesBuffer,unMimeTypesBuffer);
  2200. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2201. return result;
  2202. }
  2203. public uint GetApplicationsThatSupportMimeType(string pchMimeType,System.Text.StringBuilder pchAppKeysThatSupportBuffer,uint unAppKeysThatSupportBuffer)
  2204. {
  2205. IntPtr pchMimeTypeUtf8 = Utils.ToUtf8(pchMimeType);
  2206. uint result = FnTable.GetApplicationsThatSupportMimeType(pchMimeTypeUtf8,pchAppKeysThatSupportBuffer,unAppKeysThatSupportBuffer);
  2207. Marshal.FreeHGlobal(pchMimeTypeUtf8);
  2208. return result;
  2209. }
  2210. public uint GetApplicationLaunchArguments(uint unHandle,System.Text.StringBuilder pchArgs,uint unArgs)
  2211. {
  2212. uint result = FnTable.GetApplicationLaunchArguments(unHandle,pchArgs,unArgs);
  2213. return result;
  2214. }
  2215. public EVRApplicationError GetStartingApplication(System.Text.StringBuilder pchAppKeyBuffer,uint unAppKeyBufferLen)
  2216. {
  2217. EVRApplicationError result = FnTable.GetStartingApplication(pchAppKeyBuffer,unAppKeyBufferLen);
  2218. return result;
  2219. }
  2220. public EVRSceneApplicationState GetSceneApplicationState()
  2221. {
  2222. EVRSceneApplicationState result = FnTable.GetSceneApplicationState();
  2223. return result;
  2224. }
  2225. public EVRApplicationError PerformApplicationPrelaunchCheck(string pchAppKey)
  2226. {
  2227. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  2228. EVRApplicationError result = FnTable.PerformApplicationPrelaunchCheck(pchAppKeyUtf8);
  2229. Marshal.FreeHGlobal(pchAppKeyUtf8);
  2230. return result;
  2231. }
  2232. public string GetSceneApplicationStateNameFromEnum(EVRSceneApplicationState state)
  2233. {
  2234. IntPtr result = FnTable.GetSceneApplicationStateNameFromEnum(state);
  2235. return Marshal.PtrToStringAnsi(result);
  2236. }
  2237. public EVRApplicationError LaunchInternalProcess(string pchBinaryPath,string pchArguments,string pchWorkingDirectory)
  2238. {
  2239. IntPtr pchBinaryPathUtf8 = Utils.ToUtf8(pchBinaryPath);
  2240. IntPtr pchArgumentsUtf8 = Utils.ToUtf8(pchArguments);
  2241. IntPtr pchWorkingDirectoryUtf8 = Utils.ToUtf8(pchWorkingDirectory);
  2242. EVRApplicationError result = FnTable.LaunchInternalProcess(pchBinaryPathUtf8,pchArgumentsUtf8,pchWorkingDirectoryUtf8);
  2243. Marshal.FreeHGlobal(pchBinaryPathUtf8);
  2244. Marshal.FreeHGlobal(pchArgumentsUtf8);
  2245. Marshal.FreeHGlobal(pchWorkingDirectoryUtf8);
  2246. return result;
  2247. }
  2248. public uint GetCurrentSceneProcessId()
  2249. {
  2250. uint result = FnTable.GetCurrentSceneProcessId();
  2251. return result;
  2252. }
  2253. }
  2254. public class CVRChaperone
  2255. {
  2256. IVRChaperone FnTable;
  2257. internal CVRChaperone(IntPtr pInterface)
  2258. {
  2259. FnTable = (IVRChaperone)Marshal.PtrToStructure(pInterface, typeof(IVRChaperone));
  2260. }
  2261. public ChaperoneCalibrationState GetCalibrationState()
  2262. {
  2263. ChaperoneCalibrationState result = FnTable.GetCalibrationState();
  2264. return result;
  2265. }
  2266. public bool GetPlayAreaSize(ref float pSizeX,ref float pSizeZ)
  2267. {
  2268. pSizeX = 0;
  2269. pSizeZ = 0;
  2270. bool result = FnTable.GetPlayAreaSize(ref pSizeX,ref pSizeZ);
  2271. return result;
  2272. }
  2273. public bool GetPlayAreaRect(ref HmdQuad_t rect)
  2274. {
  2275. bool result = FnTable.GetPlayAreaRect(ref rect);
  2276. return result;
  2277. }
  2278. public void ReloadInfo()
  2279. {
  2280. FnTable.ReloadInfo();
  2281. }
  2282. public void SetSceneColor(HmdColor_t color)
  2283. {
  2284. FnTable.SetSceneColor(color);
  2285. }
  2286. public void GetBoundsColor(ref HmdColor_t pOutputColorArray,int nNumOutputColors,float flCollisionBoundsFadeDistance,ref HmdColor_t pOutputCameraColor)
  2287. {
  2288. FnTable.GetBoundsColor(ref pOutputColorArray,nNumOutputColors,flCollisionBoundsFadeDistance,ref pOutputCameraColor);
  2289. }
  2290. public bool AreBoundsVisible()
  2291. {
  2292. bool result = FnTable.AreBoundsVisible();
  2293. return result;
  2294. }
  2295. public void ForceBoundsVisible(bool bForce)
  2296. {
  2297. FnTable.ForceBoundsVisible(bForce);
  2298. }
  2299. public void ResetZeroPose(ETrackingUniverseOrigin eTrackingUniverseOrigin)
  2300. {
  2301. FnTable.ResetZeroPose(eTrackingUniverseOrigin);
  2302. }
  2303. }
  2304. public class CVRChaperoneSetup
  2305. {
  2306. IVRChaperoneSetup FnTable;
  2307. internal CVRChaperoneSetup(IntPtr pInterface)
  2308. {
  2309. FnTable = (IVRChaperoneSetup)Marshal.PtrToStructure(pInterface, typeof(IVRChaperoneSetup));
  2310. }
  2311. public bool CommitWorkingCopy(EChaperoneConfigFile configFile)
  2312. {
  2313. bool result = FnTable.CommitWorkingCopy(configFile);
  2314. return result;
  2315. }
  2316. public void RevertWorkingCopy()
  2317. {
  2318. FnTable.RevertWorkingCopy();
  2319. }
  2320. public bool GetWorkingPlayAreaSize(ref float pSizeX,ref float pSizeZ)
  2321. {
  2322. pSizeX = 0;
  2323. pSizeZ = 0;
  2324. bool result = FnTable.GetWorkingPlayAreaSize(ref pSizeX,ref pSizeZ);
  2325. return result;
  2326. }
  2327. public bool GetWorkingPlayAreaRect(ref HmdQuad_t rect)
  2328. {
  2329. bool result = FnTable.GetWorkingPlayAreaRect(ref rect);
  2330. return result;
  2331. }
  2332. public bool GetWorkingCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
  2333. {
  2334. uint punQuadsCount = 0;
  2335. bool result = FnTable.GetWorkingCollisionBoundsInfo(null,ref punQuadsCount);
  2336. pQuadsBuffer= new HmdQuad_t[punQuadsCount];
  2337. result = FnTable.GetWorkingCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
  2338. return result;
  2339. }
  2340. public bool GetLiveCollisionBoundsInfo(out HmdQuad_t [] pQuadsBuffer)
  2341. {
  2342. uint punQuadsCount = 0;
  2343. bool result = FnTable.GetLiveCollisionBoundsInfo(null,ref punQuadsCount);
  2344. pQuadsBuffer= new HmdQuad_t[punQuadsCount];
  2345. result = FnTable.GetLiveCollisionBoundsInfo(pQuadsBuffer,ref punQuadsCount);
  2346. return result;
  2347. }
  2348. public bool GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
  2349. {
  2350. bool result = FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
  2351. return result;
  2352. }
  2353. public bool GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose)
  2354. {
  2355. bool result = FnTable.GetWorkingStandingZeroPoseToRawTrackingPose(ref pmatStandingZeroPoseToRawTrackingPose);
  2356. return result;
  2357. }
  2358. public void SetWorkingPlayAreaSize(float sizeX,float sizeZ)
  2359. {
  2360. FnTable.SetWorkingPlayAreaSize(sizeX,sizeZ);
  2361. }
  2362. public void SetWorkingCollisionBoundsInfo(HmdQuad_t [] pQuadsBuffer)
  2363. {
  2364. FnTable.SetWorkingCollisionBoundsInfo(pQuadsBuffer,(uint) pQuadsBuffer.Length);
  2365. }
  2366. public void SetWorkingPerimeter(HmdVector2_t [] pPointBuffer)
  2367. {
  2368. FnTable.SetWorkingPerimeter(pPointBuffer,(uint) pPointBuffer.Length);
  2369. }
  2370. public void SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose)
  2371. {
  2372. FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose(ref pMatSeatedZeroPoseToRawTrackingPose);
  2373. }
  2374. public void SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose)
  2375. {
  2376. FnTable.SetWorkingStandingZeroPoseToRawTrackingPose(ref pMatStandingZeroPoseToRawTrackingPose);
  2377. }
  2378. public void ReloadFromDisk(EChaperoneConfigFile configFile)
  2379. {
  2380. FnTable.ReloadFromDisk(configFile);
  2381. }
  2382. public bool GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose)
  2383. {
  2384. bool result = FnTable.GetLiveSeatedZeroPoseToRawTrackingPose(ref pmatSeatedZeroPoseToRawTrackingPose);
  2385. return result;
  2386. }
  2387. public bool ExportLiveToBuffer(System.Text.StringBuilder pBuffer,ref uint pnBufferLength)
  2388. {
  2389. pnBufferLength = 0;
  2390. bool result = FnTable.ExportLiveToBuffer(pBuffer,ref pnBufferLength);
  2391. return result;
  2392. }
  2393. public bool ImportFromBufferToWorking(string pBuffer,uint nImportFlags)
  2394. {
  2395. IntPtr pBufferUtf8 = Utils.ToUtf8(pBuffer);
  2396. bool result = FnTable.ImportFromBufferToWorking(pBufferUtf8,nImportFlags);
  2397. Marshal.FreeHGlobal(pBufferUtf8);
  2398. return result;
  2399. }
  2400. public void ShowWorkingSetPreview()
  2401. {
  2402. FnTable.ShowWorkingSetPreview();
  2403. }
  2404. public void HideWorkingSetPreview()
  2405. {
  2406. FnTable.HideWorkingSetPreview();
  2407. }
  2408. public void RoomSetupStarting()
  2409. {
  2410. FnTable.RoomSetupStarting();
  2411. }
  2412. }
  2413. public class CVRCompositor
  2414. {
  2415. IVRCompositor FnTable;
  2416. internal CVRCompositor(IntPtr pInterface)
  2417. {
  2418. FnTable = (IVRCompositor)Marshal.PtrToStructure(pInterface, typeof(IVRCompositor));
  2419. }
  2420. public void SetTrackingSpace(ETrackingUniverseOrigin eOrigin)
  2421. {
  2422. FnTable.SetTrackingSpace(eOrigin);
  2423. }
  2424. public ETrackingUniverseOrigin GetTrackingSpace()
  2425. {
  2426. ETrackingUniverseOrigin result = FnTable.GetTrackingSpace();
  2427. return result;
  2428. }
  2429. public EVRCompositorError WaitGetPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
  2430. {
  2431. EVRCompositorError result = FnTable.WaitGetPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
  2432. return result;
  2433. }
  2434. public EVRCompositorError GetLastPoses(TrackedDevicePose_t [] pRenderPoseArray,TrackedDevicePose_t [] pGamePoseArray)
  2435. {
  2436. EVRCompositorError result = FnTable.GetLastPoses(pRenderPoseArray,(uint) pRenderPoseArray.Length,pGamePoseArray,(uint) pGamePoseArray.Length);
  2437. return result;
  2438. }
  2439. public EVRCompositorError GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex,ref TrackedDevicePose_t pOutputPose,ref TrackedDevicePose_t pOutputGamePose)
  2440. {
  2441. EVRCompositorError result = FnTable.GetLastPoseForTrackedDeviceIndex(unDeviceIndex,ref pOutputPose,ref pOutputGamePose);
  2442. return result;
  2443. }
  2444. public EVRCompositorError Submit(EVREye eEye,ref Texture_t pTexture,ref VRTextureBounds_t pBounds,EVRSubmitFlags nSubmitFlags)
  2445. {
  2446. EVRCompositorError result = FnTable.Submit(eEye,ref pTexture,ref pBounds,nSubmitFlags);
  2447. return result;
  2448. }
  2449. public void ClearLastSubmittedFrame()
  2450. {
  2451. FnTable.ClearLastSubmittedFrame();
  2452. }
  2453. public void PostPresentHandoff()
  2454. {
  2455. FnTable.PostPresentHandoff();
  2456. }
  2457. public bool GetFrameTiming(ref Compositor_FrameTiming pTiming,uint unFramesAgo)
  2458. {
  2459. bool result = FnTable.GetFrameTiming(ref pTiming,unFramesAgo);
  2460. return result;
  2461. }
  2462. public uint GetFrameTimings(Compositor_FrameTiming [] pTiming)
  2463. {
  2464. uint result = FnTable.GetFrameTimings(pTiming,(uint) pTiming.Length);
  2465. return result;
  2466. }
  2467. public float GetFrameTimeRemaining()
  2468. {
  2469. float result = FnTable.GetFrameTimeRemaining();
  2470. return result;
  2471. }
  2472. public void GetCumulativeStats(ref Compositor_CumulativeStats pStats,uint nStatsSizeInBytes)
  2473. {
  2474. FnTable.GetCumulativeStats(ref pStats,nStatsSizeInBytes);
  2475. }
  2476. public void FadeToColor(float fSeconds,float fRed,float fGreen,float fBlue,float fAlpha,bool bBackground)
  2477. {
  2478. FnTable.FadeToColor(fSeconds,fRed,fGreen,fBlue,fAlpha,bBackground);
  2479. }
  2480. public HmdColor_t GetCurrentFadeColor(bool bBackground)
  2481. {
  2482. HmdColor_t result = FnTable.GetCurrentFadeColor(bBackground);
  2483. return result;
  2484. }
  2485. public void FadeGrid(float fSeconds,bool bFadeIn)
  2486. {
  2487. FnTable.FadeGrid(fSeconds,bFadeIn);
  2488. }
  2489. public float GetCurrentGridAlpha()
  2490. {
  2491. float result = FnTable.GetCurrentGridAlpha();
  2492. return result;
  2493. }
  2494. public EVRCompositorError SetSkyboxOverride(Texture_t [] pTextures)
  2495. {
  2496. EVRCompositorError result = FnTable.SetSkyboxOverride(pTextures,(uint) pTextures.Length);
  2497. return result;
  2498. }
  2499. public void ClearSkyboxOverride()
  2500. {
  2501. FnTable.ClearSkyboxOverride();
  2502. }
  2503. public void CompositorBringToFront()
  2504. {
  2505. FnTable.CompositorBringToFront();
  2506. }
  2507. public void CompositorGoToBack()
  2508. {
  2509. FnTable.CompositorGoToBack();
  2510. }
  2511. public void CompositorQuit()
  2512. {
  2513. FnTable.CompositorQuit();
  2514. }
  2515. public bool IsFullscreen()
  2516. {
  2517. bool result = FnTable.IsFullscreen();
  2518. return result;
  2519. }
  2520. public uint GetCurrentSceneFocusProcess()
  2521. {
  2522. uint result = FnTable.GetCurrentSceneFocusProcess();
  2523. return result;
  2524. }
  2525. public uint GetLastFrameRenderer()
  2526. {
  2527. uint result = FnTable.GetLastFrameRenderer();
  2528. return result;
  2529. }
  2530. public bool CanRenderScene()
  2531. {
  2532. bool result = FnTable.CanRenderScene();
  2533. return result;
  2534. }
  2535. public void ShowMirrorWindow()
  2536. {
  2537. FnTable.ShowMirrorWindow();
  2538. }
  2539. public void HideMirrorWindow()
  2540. {
  2541. FnTable.HideMirrorWindow();
  2542. }
  2543. public bool IsMirrorWindowVisible()
  2544. {
  2545. bool result = FnTable.IsMirrorWindowVisible();
  2546. return result;
  2547. }
  2548. public void CompositorDumpImages()
  2549. {
  2550. FnTable.CompositorDumpImages();
  2551. }
  2552. public bool ShouldAppRenderWithLowResources()
  2553. {
  2554. bool result = FnTable.ShouldAppRenderWithLowResources();
  2555. return result;
  2556. }
  2557. public void ForceInterleavedReprojectionOn(bool bOverride)
  2558. {
  2559. FnTable.ForceInterleavedReprojectionOn(bOverride);
  2560. }
  2561. public void ForceReconnectProcess()
  2562. {
  2563. FnTable.ForceReconnectProcess();
  2564. }
  2565. public void SuspendRendering(bool bSuspend)
  2566. {
  2567. FnTable.SuspendRendering(bSuspend);
  2568. }
  2569. public EVRCompositorError GetMirrorTextureD3D11(EVREye eEye,IntPtr pD3D11DeviceOrResource,ref IntPtr ppD3D11ShaderResourceView)
  2570. {
  2571. EVRCompositorError result = FnTable.GetMirrorTextureD3D11(eEye,pD3D11DeviceOrResource,ref ppD3D11ShaderResourceView);
  2572. return result;
  2573. }
  2574. public void ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView)
  2575. {
  2576. FnTable.ReleaseMirrorTextureD3D11(pD3D11ShaderResourceView);
  2577. }
  2578. public EVRCompositorError GetMirrorTextureGL(EVREye eEye,ref uint pglTextureId,IntPtr pglSharedTextureHandle)
  2579. {
  2580. pglTextureId = 0;
  2581. EVRCompositorError result = FnTable.GetMirrorTextureGL(eEye,ref pglTextureId,pglSharedTextureHandle);
  2582. return result;
  2583. }
  2584. public bool ReleaseSharedGLTexture(uint glTextureId,IntPtr glSharedTextureHandle)
  2585. {
  2586. bool result = FnTable.ReleaseSharedGLTexture(glTextureId,glSharedTextureHandle);
  2587. return result;
  2588. }
  2589. public void LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
  2590. {
  2591. FnTable.LockGLSharedTextureForAccess(glSharedTextureHandle);
  2592. }
  2593. public void UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle)
  2594. {
  2595. FnTable.UnlockGLSharedTextureForAccess(glSharedTextureHandle);
  2596. }
  2597. public uint GetVulkanInstanceExtensionsRequired(System.Text.StringBuilder pchValue,uint unBufferSize)
  2598. {
  2599. uint result = FnTable.GetVulkanInstanceExtensionsRequired(pchValue,unBufferSize);
  2600. return result;
  2601. }
  2602. public uint GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice,System.Text.StringBuilder pchValue,uint unBufferSize)
  2603. {
  2604. uint result = FnTable.GetVulkanDeviceExtensionsRequired(pPhysicalDevice,pchValue,unBufferSize);
  2605. return result;
  2606. }
  2607. public void SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode)
  2608. {
  2609. FnTable.SetExplicitTimingMode(eTimingMode);
  2610. }
  2611. public EVRCompositorError SubmitExplicitTimingData()
  2612. {
  2613. EVRCompositorError result = FnTable.SubmitExplicitTimingData();
  2614. return result;
  2615. }
  2616. public bool IsMotionSmoothingEnabled()
  2617. {
  2618. bool result = FnTable.IsMotionSmoothingEnabled();
  2619. return result;
  2620. }
  2621. public bool IsMotionSmoothingSupported()
  2622. {
  2623. bool result = FnTable.IsMotionSmoothingSupported();
  2624. return result;
  2625. }
  2626. public bool IsCurrentSceneFocusAppLoading()
  2627. {
  2628. bool result = FnTable.IsCurrentSceneFocusAppLoading();
  2629. return result;
  2630. }
  2631. public EVRCompositorError SetStageOverride_Async(string pchRenderModelPath,ref HmdMatrix34_t pTransform,ref Compositor_StageRenderSettings pRenderSettings,uint nSizeOfRenderSettings)
  2632. {
  2633. IntPtr pchRenderModelPathUtf8 = Utils.ToUtf8(pchRenderModelPath);
  2634. EVRCompositorError result = FnTable.SetStageOverride_Async(pchRenderModelPathUtf8,ref pTransform,ref pRenderSettings,nSizeOfRenderSettings);
  2635. Marshal.FreeHGlobal(pchRenderModelPathUtf8);
  2636. return result;
  2637. }
  2638. public void ClearStageOverride()
  2639. {
  2640. FnTable.ClearStageOverride();
  2641. }
  2642. public bool GetCompositorBenchmarkResults(ref Compositor_BenchmarkResults pBenchmarkResults,uint nSizeOfBenchmarkResults)
  2643. {
  2644. bool result = FnTable.GetCompositorBenchmarkResults(ref pBenchmarkResults,nSizeOfBenchmarkResults);
  2645. return result;
  2646. }
  2647. public EVRCompositorError GetLastPosePredictionIDs(ref uint pRenderPosePredictionID,ref uint pGamePosePredictionID)
  2648. {
  2649. pRenderPosePredictionID = 0;
  2650. pGamePosePredictionID = 0;
  2651. EVRCompositorError result = FnTable.GetLastPosePredictionIDs(ref pRenderPosePredictionID,ref pGamePosePredictionID);
  2652. return result;
  2653. }
  2654. public EVRCompositorError GetPosesForFrame(uint unPosePredictionID,TrackedDevicePose_t [] pPoseArray)
  2655. {
  2656. EVRCompositorError result = FnTable.GetPosesForFrame(unPosePredictionID,pPoseArray,(uint) pPoseArray.Length);
  2657. return result;
  2658. }
  2659. }
  2660. public class CVROverlay
  2661. {
  2662. IVROverlay FnTable;
  2663. internal CVROverlay(IntPtr pInterface)
  2664. {
  2665. FnTable = (IVROverlay)Marshal.PtrToStructure(pInterface, typeof(IVROverlay));
  2666. }
  2667. public EVROverlayError FindOverlay(string pchOverlayKey,ref ulong pOverlayHandle)
  2668. {
  2669. IntPtr pchOverlayKeyUtf8 = Utils.ToUtf8(pchOverlayKey);
  2670. pOverlayHandle = 0;
  2671. EVROverlayError result = FnTable.FindOverlay(pchOverlayKeyUtf8,ref pOverlayHandle);
  2672. Marshal.FreeHGlobal(pchOverlayKeyUtf8);
  2673. return result;
  2674. }
  2675. public EVROverlayError CreateOverlay(string pchOverlayKey,string pchOverlayName,ref ulong pOverlayHandle)
  2676. {
  2677. IntPtr pchOverlayKeyUtf8 = Utils.ToUtf8(pchOverlayKey);
  2678. IntPtr pchOverlayNameUtf8 = Utils.ToUtf8(pchOverlayName);
  2679. pOverlayHandle = 0;
  2680. EVROverlayError result = FnTable.CreateOverlay(pchOverlayKeyUtf8,pchOverlayNameUtf8,ref pOverlayHandle);
  2681. Marshal.FreeHGlobal(pchOverlayKeyUtf8);
  2682. Marshal.FreeHGlobal(pchOverlayNameUtf8);
  2683. return result;
  2684. }
  2685. public EVROverlayError DestroyOverlay(ulong ulOverlayHandle)
  2686. {
  2687. EVROverlayError result = FnTable.DestroyOverlay(ulOverlayHandle);
  2688. return result;
  2689. }
  2690. public uint GetOverlayKey(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
  2691. {
  2692. uint result = FnTable.GetOverlayKey(ulOverlayHandle,pchValue,unBufferSize,ref pError);
  2693. return result;
  2694. }
  2695. public uint GetOverlayName(ulong ulOverlayHandle,System.Text.StringBuilder pchValue,uint unBufferSize,ref EVROverlayError pError)
  2696. {
  2697. uint result = FnTable.GetOverlayName(ulOverlayHandle,pchValue,unBufferSize,ref pError);
  2698. return result;
  2699. }
  2700. public EVROverlayError SetOverlayName(ulong ulOverlayHandle,string pchName)
  2701. {
  2702. IntPtr pchNameUtf8 = Utils.ToUtf8(pchName);
  2703. EVROverlayError result = FnTable.SetOverlayName(ulOverlayHandle,pchNameUtf8);
  2704. Marshal.FreeHGlobal(pchNameUtf8);
  2705. return result;
  2706. }
  2707. public EVROverlayError GetOverlayImageData(ulong ulOverlayHandle,IntPtr pvBuffer,uint unBufferSize,ref uint punWidth,ref uint punHeight)
  2708. {
  2709. punWidth = 0;
  2710. punHeight = 0;
  2711. EVROverlayError result = FnTable.GetOverlayImageData(ulOverlayHandle,pvBuffer,unBufferSize,ref punWidth,ref punHeight);
  2712. return result;
  2713. }
  2714. public string GetOverlayErrorNameFromEnum(EVROverlayError error)
  2715. {
  2716. IntPtr result = FnTable.GetOverlayErrorNameFromEnum(error);
  2717. return Marshal.PtrToStringAnsi(result);
  2718. }
  2719. public EVROverlayError SetOverlayRenderingPid(ulong ulOverlayHandle,uint unPID)
  2720. {
  2721. EVROverlayError result = FnTable.SetOverlayRenderingPid(ulOverlayHandle,unPID);
  2722. return result;
  2723. }
  2724. public uint GetOverlayRenderingPid(ulong ulOverlayHandle)
  2725. {
  2726. uint result = FnTable.GetOverlayRenderingPid(ulOverlayHandle);
  2727. return result;
  2728. }
  2729. public EVROverlayError SetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,bool bEnabled)
  2730. {
  2731. EVROverlayError result = FnTable.SetOverlayFlag(ulOverlayHandle,eOverlayFlag,bEnabled);
  2732. return result;
  2733. }
  2734. public EVROverlayError GetOverlayFlag(ulong ulOverlayHandle,VROverlayFlags eOverlayFlag,ref bool pbEnabled)
  2735. {
  2736. pbEnabled = false;
  2737. EVROverlayError result = FnTable.GetOverlayFlag(ulOverlayHandle,eOverlayFlag,ref pbEnabled);
  2738. return result;
  2739. }
  2740. public EVROverlayError GetOverlayFlags(ulong ulOverlayHandle,ref uint pFlags)
  2741. {
  2742. pFlags = 0;
  2743. EVROverlayError result = FnTable.GetOverlayFlags(ulOverlayHandle,ref pFlags);
  2744. return result;
  2745. }
  2746. public EVROverlayError SetOverlayColor(ulong ulOverlayHandle,float fRed,float fGreen,float fBlue)
  2747. {
  2748. EVROverlayError result = FnTable.SetOverlayColor(ulOverlayHandle,fRed,fGreen,fBlue);
  2749. return result;
  2750. }
  2751. public EVROverlayError GetOverlayColor(ulong ulOverlayHandle,ref float pfRed,ref float pfGreen,ref float pfBlue)
  2752. {
  2753. pfRed = 0;
  2754. pfGreen = 0;
  2755. pfBlue = 0;
  2756. EVROverlayError result = FnTable.GetOverlayColor(ulOverlayHandle,ref pfRed,ref pfGreen,ref pfBlue);
  2757. return result;
  2758. }
  2759. public EVROverlayError SetOverlayAlpha(ulong ulOverlayHandle,float fAlpha)
  2760. {
  2761. EVROverlayError result = FnTable.SetOverlayAlpha(ulOverlayHandle,fAlpha);
  2762. return result;
  2763. }
  2764. public EVROverlayError GetOverlayAlpha(ulong ulOverlayHandle,ref float pfAlpha)
  2765. {
  2766. pfAlpha = 0;
  2767. EVROverlayError result = FnTable.GetOverlayAlpha(ulOverlayHandle,ref pfAlpha);
  2768. return result;
  2769. }
  2770. public EVROverlayError SetOverlayTexelAspect(ulong ulOverlayHandle,float fTexelAspect)
  2771. {
  2772. EVROverlayError result = FnTable.SetOverlayTexelAspect(ulOverlayHandle,fTexelAspect);
  2773. return result;
  2774. }
  2775. public EVROverlayError GetOverlayTexelAspect(ulong ulOverlayHandle,ref float pfTexelAspect)
  2776. {
  2777. pfTexelAspect = 0;
  2778. EVROverlayError result = FnTable.GetOverlayTexelAspect(ulOverlayHandle,ref pfTexelAspect);
  2779. return result;
  2780. }
  2781. public EVROverlayError SetOverlaySortOrder(ulong ulOverlayHandle,uint unSortOrder)
  2782. {
  2783. EVROverlayError result = FnTable.SetOverlaySortOrder(ulOverlayHandle,unSortOrder);
  2784. return result;
  2785. }
  2786. public EVROverlayError GetOverlaySortOrder(ulong ulOverlayHandle,ref uint punSortOrder)
  2787. {
  2788. punSortOrder = 0;
  2789. EVROverlayError result = FnTable.GetOverlaySortOrder(ulOverlayHandle,ref punSortOrder);
  2790. return result;
  2791. }
  2792. public EVROverlayError SetOverlayWidthInMeters(ulong ulOverlayHandle,float fWidthInMeters)
  2793. {
  2794. EVROverlayError result = FnTable.SetOverlayWidthInMeters(ulOverlayHandle,fWidthInMeters);
  2795. return result;
  2796. }
  2797. public EVROverlayError GetOverlayWidthInMeters(ulong ulOverlayHandle,ref float pfWidthInMeters)
  2798. {
  2799. pfWidthInMeters = 0;
  2800. EVROverlayError result = FnTable.GetOverlayWidthInMeters(ulOverlayHandle,ref pfWidthInMeters);
  2801. return result;
  2802. }
  2803. public EVROverlayError SetOverlayCurvature(ulong ulOverlayHandle,float fCurvature)
  2804. {
  2805. EVROverlayError result = FnTable.SetOverlayCurvature(ulOverlayHandle,fCurvature);
  2806. return result;
  2807. }
  2808. public EVROverlayError GetOverlayCurvature(ulong ulOverlayHandle,ref float pfCurvature)
  2809. {
  2810. pfCurvature = 0;
  2811. EVROverlayError result = FnTable.GetOverlayCurvature(ulOverlayHandle,ref pfCurvature);
  2812. return result;
  2813. }
  2814. public EVROverlayError SetOverlayTextureColorSpace(ulong ulOverlayHandle,EColorSpace eTextureColorSpace)
  2815. {
  2816. EVROverlayError result = FnTable.SetOverlayTextureColorSpace(ulOverlayHandle,eTextureColorSpace);
  2817. return result;
  2818. }
  2819. public EVROverlayError GetOverlayTextureColorSpace(ulong ulOverlayHandle,ref EColorSpace peTextureColorSpace)
  2820. {
  2821. EVROverlayError result = FnTable.GetOverlayTextureColorSpace(ulOverlayHandle,ref peTextureColorSpace);
  2822. return result;
  2823. }
  2824. public EVROverlayError SetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
  2825. {
  2826. EVROverlayError result = FnTable.SetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
  2827. return result;
  2828. }
  2829. public EVROverlayError GetOverlayTextureBounds(ulong ulOverlayHandle,ref VRTextureBounds_t pOverlayTextureBounds)
  2830. {
  2831. EVROverlayError result = FnTable.GetOverlayTextureBounds(ulOverlayHandle,ref pOverlayTextureBounds);
  2832. return result;
  2833. }
  2834. public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
  2835. {
  2836. EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
  2837. return result;
  2838. }
  2839. public EVROverlayError SetOverlayTransformAbsolute(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
  2840. {
  2841. EVROverlayError result = FnTable.SetOverlayTransformAbsolute(ulOverlayHandle,eTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
  2842. return result;
  2843. }
  2844. public EVROverlayError GetOverlayTransformAbsolute(ulong ulOverlayHandle,ref ETrackingUniverseOrigin peTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform)
  2845. {
  2846. EVROverlayError result = FnTable.GetOverlayTransformAbsolute(ulOverlayHandle,ref peTrackingOrigin,ref pmatTrackingOriginToOverlayTransform);
  2847. return result;
  2848. }
  2849. public EVROverlayError SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,uint unTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
  2850. {
  2851. EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,unTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
  2852. return result;
  2853. }
  2854. public EVROverlayError GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle,ref uint punTrackedDevice,ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform)
  2855. {
  2856. punTrackedDevice = 0;
  2857. EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceRelative(ulOverlayHandle,ref punTrackedDevice,ref pmatTrackedDeviceToOverlayTransform);
  2858. return result;
  2859. }
  2860. public EVROverlayError SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,uint unDeviceIndex,string pchComponentName)
  2861. {
  2862. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  2863. EVROverlayError result = FnTable.SetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,unDeviceIndex,pchComponentNameUtf8);
  2864. Marshal.FreeHGlobal(pchComponentNameUtf8);
  2865. return result;
  2866. }
  2867. public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle,ref uint punDeviceIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameSize)
  2868. {
  2869. punDeviceIndex = 0;
  2870. EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize);
  2871. return result;
  2872. }
  2873. public EVROverlayError GetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ref ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
  2874. {
  2875. ulOverlayHandleParent = 0;
  2876. EVROverlayError result = FnTable.GetOverlayTransformOverlayRelative(ulOverlayHandle,ref ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
  2877. return result;
  2878. }
  2879. public EVROverlayError SetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform)
  2880. {
  2881. EVROverlayError result = FnTable.SetOverlayTransformOverlayRelative(ulOverlayHandle,ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform);
  2882. return result;
  2883. }
  2884. public EVROverlayError SetOverlayTransformCursor(ulong ulCursorOverlayHandle,ref HmdVector2_t pvHotspot)
  2885. {
  2886. EVROverlayError result = FnTable.SetOverlayTransformCursor(ulCursorOverlayHandle,ref pvHotspot);
  2887. return result;
  2888. }
  2889. public EVROverlayError GetOverlayTransformCursor(ulong ulOverlayHandle,ref HmdVector2_t pvHotspot)
  2890. {
  2891. EVROverlayError result = FnTable.GetOverlayTransformCursor(ulOverlayHandle,ref pvHotspot);
  2892. return result;
  2893. }
  2894. public EVROverlayError ShowOverlay(ulong ulOverlayHandle)
  2895. {
  2896. EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle);
  2897. return result;
  2898. }
  2899. public EVROverlayError HideOverlay(ulong ulOverlayHandle)
  2900. {
  2901. EVROverlayError result = FnTable.HideOverlay(ulOverlayHandle);
  2902. return result;
  2903. }
  2904. public bool IsOverlayVisible(ulong ulOverlayHandle)
  2905. {
  2906. bool result = FnTable.IsOverlayVisible(ulOverlayHandle);
  2907. return result;
  2908. }
  2909. public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
  2910. {
  2911. EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
  2912. return result;
  2913. }
  2914. // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
  2915. // originally mis-compiled with the wrong packing for Linux and OSX.
  2916. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  2917. internal delegate bool _PollNextOverlayEventPacked(ulong ulOverlayHandle,ref VREvent_t_Packed pEvent,uint uncbVREvent);
  2918. [StructLayout(LayoutKind.Explicit)]
  2919. struct PollNextOverlayEventUnion
  2920. {
  2921. [FieldOffset(0)]
  2922. public IVROverlay._PollNextOverlayEvent pPollNextOverlayEvent;
  2923. [FieldOffset(0)]
  2924. public _PollNextOverlayEventPacked pPollNextOverlayEventPacked;
  2925. }
  2926. public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
  2927. {
  2928. #if !UNITY_METRO
  2929. if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
  2930. (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
  2931. {
  2932. PollNextOverlayEventUnion u;
  2933. VREvent_t_Packed event_packed = new VREvent_t_Packed();
  2934. u.pPollNextOverlayEventPacked = null;
  2935. u.pPollNextOverlayEvent = FnTable.PollNextOverlayEvent;
  2936. bool packed_result = u.pPollNextOverlayEventPacked(ulOverlayHandle,ref event_packed,(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t_Packed)));
  2937. event_packed.Unpack(ref pEvent);
  2938. return packed_result;
  2939. }
  2940. #endif
  2941. bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
  2942. return result;
  2943. }
  2944. public EVROverlayError GetOverlayInputMethod(ulong ulOverlayHandle,ref VROverlayInputMethod peInputMethod)
  2945. {
  2946. EVROverlayError result = FnTable.GetOverlayInputMethod(ulOverlayHandle,ref peInputMethod);
  2947. return result;
  2948. }
  2949. public EVROverlayError SetOverlayInputMethod(ulong ulOverlayHandle,VROverlayInputMethod eInputMethod)
  2950. {
  2951. EVROverlayError result = FnTable.SetOverlayInputMethod(ulOverlayHandle,eInputMethod);
  2952. return result;
  2953. }
  2954. public EVROverlayError GetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
  2955. {
  2956. EVROverlayError result = FnTable.GetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
  2957. return result;
  2958. }
  2959. public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
  2960. {
  2961. EVROverlayError result = FnTable.SetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
  2962. return result;
  2963. }
  2964. public bool ComputeOverlayIntersection(ulong ulOverlayHandle,ref VROverlayIntersectionParams_t pParams,ref VROverlayIntersectionResults_t pResults)
  2965. {
  2966. bool result = FnTable.ComputeOverlayIntersection(ulOverlayHandle,ref pParams,ref pResults);
  2967. return result;
  2968. }
  2969. public bool IsHoverTargetOverlay(ulong ulOverlayHandle)
  2970. {
  2971. bool result = FnTable.IsHoverTargetOverlay(ulOverlayHandle);
  2972. return result;
  2973. }
  2974. public EVROverlayError SetOverlayIntersectionMask(ulong ulOverlayHandle,ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives,uint unNumMaskPrimitives,uint unPrimitiveSize)
  2975. {
  2976. EVROverlayError result = FnTable.SetOverlayIntersectionMask(ulOverlayHandle,ref pMaskPrimitives,unNumMaskPrimitives,unPrimitiveSize);
  2977. return result;
  2978. }
  2979. public EVROverlayError TriggerLaserMouseHapticVibration(ulong ulOverlayHandle,float fDurationSeconds,float fFrequency,float fAmplitude)
  2980. {
  2981. EVROverlayError result = FnTable.TriggerLaserMouseHapticVibration(ulOverlayHandle,fDurationSeconds,fFrequency,fAmplitude);
  2982. return result;
  2983. }
  2984. public EVROverlayError SetOverlayCursor(ulong ulOverlayHandle,ulong ulCursorHandle)
  2985. {
  2986. EVROverlayError result = FnTable.SetOverlayCursor(ulOverlayHandle,ulCursorHandle);
  2987. return result;
  2988. }
  2989. public EVROverlayError SetOverlayCursorPositionOverride(ulong ulOverlayHandle,ref HmdVector2_t pvCursor)
  2990. {
  2991. EVROverlayError result = FnTable.SetOverlayCursorPositionOverride(ulOverlayHandle,ref pvCursor);
  2992. return result;
  2993. }
  2994. public EVROverlayError ClearOverlayCursorPositionOverride(ulong ulOverlayHandle)
  2995. {
  2996. EVROverlayError result = FnTable.ClearOverlayCursorPositionOverride(ulOverlayHandle);
  2997. return result;
  2998. }
  2999. public EVROverlayError SetOverlayTexture(ulong ulOverlayHandle,ref Texture_t pTexture)
  3000. {
  3001. EVROverlayError result = FnTable.SetOverlayTexture(ulOverlayHandle,ref pTexture);
  3002. return result;
  3003. }
  3004. public EVROverlayError ClearOverlayTexture(ulong ulOverlayHandle)
  3005. {
  3006. EVROverlayError result = FnTable.ClearOverlayTexture(ulOverlayHandle);
  3007. return result;
  3008. }
  3009. public EVROverlayError SetOverlayRaw(ulong ulOverlayHandle,IntPtr pvBuffer,uint unWidth,uint unHeight,uint unBytesPerPixel)
  3010. {
  3011. EVROverlayError result = FnTable.SetOverlayRaw(ulOverlayHandle,pvBuffer,unWidth,unHeight,unBytesPerPixel);
  3012. return result;
  3013. }
  3014. public EVROverlayError SetOverlayFromFile(ulong ulOverlayHandle,string pchFilePath)
  3015. {
  3016. IntPtr pchFilePathUtf8 = Utils.ToUtf8(pchFilePath);
  3017. EVROverlayError result = FnTable.SetOverlayFromFile(ulOverlayHandle,pchFilePathUtf8);
  3018. Marshal.FreeHGlobal(pchFilePathUtf8);
  3019. return result;
  3020. }
  3021. 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)
  3022. {
  3023. pWidth = 0;
  3024. pHeight = 0;
  3025. pNativeFormat = 0;
  3026. EVROverlayError result = FnTable.GetOverlayTexture(ulOverlayHandle,ref pNativeTextureHandle,pNativeTextureRef,ref pWidth,ref pHeight,ref pNativeFormat,ref pAPIType,ref pColorSpace,ref pTextureBounds);
  3027. return result;
  3028. }
  3029. public EVROverlayError ReleaseNativeOverlayHandle(ulong ulOverlayHandle,IntPtr pNativeTextureHandle)
  3030. {
  3031. EVROverlayError result = FnTable.ReleaseNativeOverlayHandle(ulOverlayHandle,pNativeTextureHandle);
  3032. return result;
  3033. }
  3034. public EVROverlayError GetOverlayTextureSize(ulong ulOverlayHandle,ref uint pWidth,ref uint pHeight)
  3035. {
  3036. pWidth = 0;
  3037. pHeight = 0;
  3038. EVROverlayError result = FnTable.GetOverlayTextureSize(ulOverlayHandle,ref pWidth,ref pHeight);
  3039. return result;
  3040. }
  3041. public EVROverlayError CreateDashboardOverlay(string pchOverlayKey,string pchOverlayFriendlyName,ref ulong pMainHandle,ref ulong pThumbnailHandle)
  3042. {
  3043. IntPtr pchOverlayKeyUtf8 = Utils.ToUtf8(pchOverlayKey);
  3044. IntPtr pchOverlayFriendlyNameUtf8 = Utils.ToUtf8(pchOverlayFriendlyName);
  3045. pMainHandle = 0;
  3046. pThumbnailHandle = 0;
  3047. EVROverlayError result = FnTable.CreateDashboardOverlay(pchOverlayKeyUtf8,pchOverlayFriendlyNameUtf8,ref pMainHandle,ref pThumbnailHandle);
  3048. Marshal.FreeHGlobal(pchOverlayKeyUtf8);
  3049. Marshal.FreeHGlobal(pchOverlayFriendlyNameUtf8);
  3050. return result;
  3051. }
  3052. public bool IsDashboardVisible()
  3053. {
  3054. bool result = FnTable.IsDashboardVisible();
  3055. return result;
  3056. }
  3057. public bool IsActiveDashboardOverlay(ulong ulOverlayHandle)
  3058. {
  3059. bool result = FnTable.IsActiveDashboardOverlay(ulOverlayHandle);
  3060. return result;
  3061. }
  3062. public EVROverlayError SetDashboardOverlaySceneProcess(ulong ulOverlayHandle,uint unProcessId)
  3063. {
  3064. EVROverlayError result = FnTable.SetDashboardOverlaySceneProcess(ulOverlayHandle,unProcessId);
  3065. return result;
  3066. }
  3067. public EVROverlayError GetDashboardOverlaySceneProcess(ulong ulOverlayHandle,ref uint punProcessId)
  3068. {
  3069. punProcessId = 0;
  3070. EVROverlayError result = FnTable.GetDashboardOverlaySceneProcess(ulOverlayHandle,ref punProcessId);
  3071. return result;
  3072. }
  3073. public void ShowDashboard(string pchOverlayToShow)
  3074. {
  3075. IntPtr pchOverlayToShowUtf8 = Utils.ToUtf8(pchOverlayToShow);
  3076. FnTable.ShowDashboard(pchOverlayToShowUtf8);
  3077. Marshal.FreeHGlobal(pchOverlayToShowUtf8);
  3078. }
  3079. public uint GetPrimaryDashboardDevice()
  3080. {
  3081. uint result = FnTable.GetPrimaryDashboardDevice();
  3082. return result;
  3083. }
  3084. public EVROverlayError ShowKeyboard(int eInputMode,int eLineInputMode,uint unFlags,string pchDescription,uint unCharMax,string pchExistingText,ulong uUserValue)
  3085. {
  3086. IntPtr pchDescriptionUtf8 = Utils.ToUtf8(pchDescription);
  3087. IntPtr pchExistingTextUtf8 = Utils.ToUtf8(pchExistingText);
  3088. EVROverlayError result = FnTable.ShowKeyboard(eInputMode,eLineInputMode,unFlags,pchDescriptionUtf8,unCharMax,pchExistingTextUtf8,uUserValue);
  3089. Marshal.FreeHGlobal(pchDescriptionUtf8);
  3090. Marshal.FreeHGlobal(pchExistingTextUtf8);
  3091. return result;
  3092. }
  3093. public EVROverlayError ShowKeyboardForOverlay(ulong ulOverlayHandle,int eInputMode,int eLineInputMode,uint unFlags,string pchDescription,uint unCharMax,string pchExistingText,ulong uUserValue)
  3094. {
  3095. IntPtr pchDescriptionUtf8 = Utils.ToUtf8(pchDescription);
  3096. IntPtr pchExistingTextUtf8 = Utils.ToUtf8(pchExistingText);
  3097. EVROverlayError result = FnTable.ShowKeyboardForOverlay(ulOverlayHandle,eInputMode,eLineInputMode,unFlags,pchDescriptionUtf8,unCharMax,pchExistingTextUtf8,uUserValue);
  3098. Marshal.FreeHGlobal(pchDescriptionUtf8);
  3099. Marshal.FreeHGlobal(pchExistingTextUtf8);
  3100. return result;
  3101. }
  3102. public uint GetKeyboardText(System.Text.StringBuilder pchText,uint cchText)
  3103. {
  3104. uint result = FnTable.GetKeyboardText(pchText,cchText);
  3105. return result;
  3106. }
  3107. public void HideKeyboard()
  3108. {
  3109. FnTable.HideKeyboard();
  3110. }
  3111. public void SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform)
  3112. {
  3113. FnTable.SetKeyboardTransformAbsolute(eTrackingOrigin,ref pmatTrackingOriginToKeyboardTransform);
  3114. }
  3115. public void SetKeyboardPositionForOverlay(ulong ulOverlayHandle,HmdRect2_t avoidRect)
  3116. {
  3117. FnTable.SetKeyboardPositionForOverlay(ulOverlayHandle,avoidRect);
  3118. }
  3119. public VRMessageOverlayResponse ShowMessageOverlay(string pchText,string pchCaption,string pchButton0Text,string pchButton1Text,string pchButton2Text,string pchButton3Text)
  3120. {
  3121. IntPtr pchTextUtf8 = Utils.ToUtf8(pchText);
  3122. IntPtr pchCaptionUtf8 = Utils.ToUtf8(pchCaption);
  3123. IntPtr pchButton0TextUtf8 = Utils.ToUtf8(pchButton0Text);
  3124. IntPtr pchButton1TextUtf8 = Utils.ToUtf8(pchButton1Text);
  3125. IntPtr pchButton2TextUtf8 = Utils.ToUtf8(pchButton2Text);
  3126. IntPtr pchButton3TextUtf8 = Utils.ToUtf8(pchButton3Text);
  3127. VRMessageOverlayResponse result = FnTable.ShowMessageOverlay(pchTextUtf8,pchCaptionUtf8,pchButton0TextUtf8,pchButton1TextUtf8,pchButton2TextUtf8,pchButton3TextUtf8);
  3128. Marshal.FreeHGlobal(pchTextUtf8);
  3129. Marshal.FreeHGlobal(pchCaptionUtf8);
  3130. Marshal.FreeHGlobal(pchButton0TextUtf8);
  3131. Marshal.FreeHGlobal(pchButton1TextUtf8);
  3132. Marshal.FreeHGlobal(pchButton2TextUtf8);
  3133. Marshal.FreeHGlobal(pchButton3TextUtf8);
  3134. return result;
  3135. }
  3136. public void CloseMessageOverlay()
  3137. {
  3138. FnTable.CloseMessageOverlay();
  3139. }
  3140. }
  3141. public class CVROverlayView
  3142. {
  3143. IVROverlayView FnTable;
  3144. internal CVROverlayView(IntPtr pInterface)
  3145. {
  3146. FnTable = (IVROverlayView)Marshal.PtrToStructure(pInterface, typeof(IVROverlayView));
  3147. }
  3148. public EVROverlayError AcquireOverlayView(ulong ulOverlayHandle,ref VRNativeDevice_t pNativeDevice,ref VROverlayView_t pOverlayView,uint unOverlayViewSize)
  3149. {
  3150. EVROverlayError result = FnTable.AcquireOverlayView(ulOverlayHandle,ref pNativeDevice,ref pOverlayView,unOverlayViewSize);
  3151. return result;
  3152. }
  3153. public EVROverlayError ReleaseOverlayView(ref VROverlayView_t pOverlayView)
  3154. {
  3155. EVROverlayError result = FnTable.ReleaseOverlayView(ref pOverlayView);
  3156. return result;
  3157. }
  3158. public void PostOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pvrEvent)
  3159. {
  3160. FnTable.PostOverlayEvent(ulOverlayHandle,ref pvrEvent);
  3161. }
  3162. public bool IsViewingPermitted(ulong ulOverlayHandle)
  3163. {
  3164. bool result = FnTable.IsViewingPermitted(ulOverlayHandle);
  3165. return result;
  3166. }
  3167. }
  3168. public class CVRHeadsetView
  3169. {
  3170. IVRHeadsetView FnTable;
  3171. internal CVRHeadsetView(IntPtr pInterface)
  3172. {
  3173. FnTable = (IVRHeadsetView)Marshal.PtrToStructure(pInterface, typeof(IVRHeadsetView));
  3174. }
  3175. public void SetHeadsetViewSize(uint nWidth,uint nHeight)
  3176. {
  3177. FnTable.SetHeadsetViewSize(nWidth,nHeight);
  3178. }
  3179. public void GetHeadsetViewSize(ref uint pnWidth,ref uint pnHeight)
  3180. {
  3181. pnWidth = 0;
  3182. pnHeight = 0;
  3183. FnTable.GetHeadsetViewSize(ref pnWidth,ref pnHeight);
  3184. }
  3185. public void SetHeadsetViewMode(uint eHeadsetViewMode)
  3186. {
  3187. FnTable.SetHeadsetViewMode(eHeadsetViewMode);
  3188. }
  3189. public uint GetHeadsetViewMode()
  3190. {
  3191. uint result = FnTable.GetHeadsetViewMode();
  3192. return result;
  3193. }
  3194. public void SetHeadsetViewCropped(bool bCropped)
  3195. {
  3196. FnTable.SetHeadsetViewCropped(bCropped);
  3197. }
  3198. public bool GetHeadsetViewCropped()
  3199. {
  3200. bool result = FnTable.GetHeadsetViewCropped();
  3201. return result;
  3202. }
  3203. public float GetHeadsetViewAspectRatio()
  3204. {
  3205. float result = FnTable.GetHeadsetViewAspectRatio();
  3206. return result;
  3207. }
  3208. public void SetHeadsetViewBlendRange(float flStartPct,float flEndPct)
  3209. {
  3210. FnTable.SetHeadsetViewBlendRange(flStartPct,flEndPct);
  3211. }
  3212. public void GetHeadsetViewBlendRange(ref float pStartPct,ref float pEndPct)
  3213. {
  3214. pStartPct = 0;
  3215. pEndPct = 0;
  3216. FnTable.GetHeadsetViewBlendRange(ref pStartPct,ref pEndPct);
  3217. }
  3218. }
  3219. public class CVRRenderModels
  3220. {
  3221. IVRRenderModels FnTable;
  3222. internal CVRRenderModels(IntPtr pInterface)
  3223. {
  3224. FnTable = (IVRRenderModels)Marshal.PtrToStructure(pInterface, typeof(IVRRenderModels));
  3225. }
  3226. public EVRRenderModelError LoadRenderModel_Async(string pchRenderModelName,ref IntPtr ppRenderModel)
  3227. {
  3228. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3229. EVRRenderModelError result = FnTable.LoadRenderModel_Async(pchRenderModelNameUtf8,ref ppRenderModel);
  3230. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3231. return result;
  3232. }
  3233. public void FreeRenderModel(IntPtr pRenderModel)
  3234. {
  3235. FnTable.FreeRenderModel(pRenderModel);
  3236. }
  3237. public EVRRenderModelError LoadTexture_Async(int textureId,ref IntPtr ppTexture)
  3238. {
  3239. EVRRenderModelError result = FnTable.LoadTexture_Async(textureId,ref ppTexture);
  3240. return result;
  3241. }
  3242. public void FreeTexture(IntPtr pTexture)
  3243. {
  3244. FnTable.FreeTexture(pTexture);
  3245. }
  3246. public EVRRenderModelError LoadTextureD3D11_Async(int textureId,IntPtr pD3D11Device,ref IntPtr ppD3D11Texture2D)
  3247. {
  3248. EVRRenderModelError result = FnTable.LoadTextureD3D11_Async(textureId,pD3D11Device,ref ppD3D11Texture2D);
  3249. return result;
  3250. }
  3251. public EVRRenderModelError LoadIntoTextureD3D11_Async(int textureId,IntPtr pDstTexture)
  3252. {
  3253. EVRRenderModelError result = FnTable.LoadIntoTextureD3D11_Async(textureId,pDstTexture);
  3254. return result;
  3255. }
  3256. public void FreeTextureD3D11(IntPtr pD3D11Texture2D)
  3257. {
  3258. FnTable.FreeTextureD3D11(pD3D11Texture2D);
  3259. }
  3260. public uint GetRenderModelName(uint unRenderModelIndex,System.Text.StringBuilder pchRenderModelName,uint unRenderModelNameLen)
  3261. {
  3262. uint result = FnTable.GetRenderModelName(unRenderModelIndex,pchRenderModelName,unRenderModelNameLen);
  3263. return result;
  3264. }
  3265. public uint GetRenderModelCount()
  3266. {
  3267. uint result = FnTable.GetRenderModelCount();
  3268. return result;
  3269. }
  3270. public uint GetComponentCount(string pchRenderModelName)
  3271. {
  3272. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3273. uint result = FnTable.GetComponentCount(pchRenderModelNameUtf8);
  3274. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3275. return result;
  3276. }
  3277. public uint GetComponentName(string pchRenderModelName,uint unComponentIndex,System.Text.StringBuilder pchComponentName,uint unComponentNameLen)
  3278. {
  3279. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3280. uint result = FnTable.GetComponentName(pchRenderModelNameUtf8,unComponentIndex,pchComponentName,unComponentNameLen);
  3281. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3282. return result;
  3283. }
  3284. public ulong GetComponentButtonMask(string pchRenderModelName,string pchComponentName)
  3285. {
  3286. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3287. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3288. ulong result = FnTable.GetComponentButtonMask(pchRenderModelNameUtf8,pchComponentNameUtf8);
  3289. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3290. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3291. return result;
  3292. }
  3293. public uint GetComponentRenderModelName(string pchRenderModelName,string pchComponentName,System.Text.StringBuilder pchComponentRenderModelName,uint unComponentRenderModelNameLen)
  3294. {
  3295. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3296. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3297. uint result = FnTable.GetComponentRenderModelName(pchRenderModelNameUtf8,pchComponentNameUtf8,pchComponentRenderModelName,unComponentRenderModelNameLen);
  3298. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3299. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3300. return result;
  3301. }
  3302. public bool GetComponentStateForDevicePath(string pchRenderModelName,string pchComponentName,ulong devicePath,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)
  3303. {
  3304. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3305. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3306. bool result = FnTable.GetComponentStateForDevicePath(pchRenderModelNameUtf8,pchComponentNameUtf8,devicePath,ref pState,ref pComponentState);
  3307. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3308. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3309. return result;
  3310. }
  3311. // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were
  3312. // originally mis-compiled with the wrong packing for Linux and OSX.
  3313. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  3314. internal delegate bool _GetComponentStatePacked(IntPtr pchRenderModelName,IntPtr pchComponentName,ref VRControllerState_t_Packed pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState);
  3315. [StructLayout(LayoutKind.Explicit)]
  3316. struct GetComponentStateUnion
  3317. {
  3318. [FieldOffset(0)]
  3319. public IVRRenderModels._GetComponentState pGetComponentState;
  3320. [FieldOffset(0)]
  3321. public _GetComponentStatePacked pGetComponentStatePacked;
  3322. }
  3323. public bool GetComponentState(string pchRenderModelName,string pchComponentName,ref VRControllerState_t pControllerState,ref RenderModel_ControllerMode_State_t pState,ref RenderModel_ComponentState_t pComponentState)
  3324. {
  3325. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3326. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3327. #if !UNITY_METRO
  3328. if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||
  3329. (System.Environment.OSVersion.Platform == System.PlatformID.Unix))
  3330. {
  3331. GetComponentStateUnion u;
  3332. VRControllerState_t_Packed state_packed = new VRControllerState_t_Packed(pControllerState);
  3333. u.pGetComponentStatePacked = null;
  3334. u.pGetComponentState = FnTable.GetComponentState;
  3335. bool packed_result = u.pGetComponentStatePacked(pchRenderModelNameUtf8,pchComponentNameUtf8,ref state_packed,ref pState,ref pComponentState);
  3336. state_packed.Unpack(ref pControllerState);
  3337. return packed_result;
  3338. }
  3339. #endif
  3340. bool result = FnTable.GetComponentState(pchRenderModelNameUtf8,pchComponentNameUtf8,ref pControllerState,ref pState,ref pComponentState);
  3341. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3342. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3343. return result;
  3344. }
  3345. public bool RenderModelHasComponent(string pchRenderModelName,string pchComponentName)
  3346. {
  3347. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3348. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3349. bool result = FnTable.RenderModelHasComponent(pchRenderModelNameUtf8,pchComponentNameUtf8);
  3350. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3351. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3352. return result;
  3353. }
  3354. public uint GetRenderModelThumbnailURL(string pchRenderModelName,System.Text.StringBuilder pchThumbnailURL,uint unThumbnailURLLen,ref EVRRenderModelError peError)
  3355. {
  3356. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3357. uint result = FnTable.GetRenderModelThumbnailURL(pchRenderModelNameUtf8,pchThumbnailURL,unThumbnailURLLen,ref peError);
  3358. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3359. return result;
  3360. }
  3361. public uint GetRenderModelOriginalPath(string pchRenderModelName,System.Text.StringBuilder pchOriginalPath,uint unOriginalPathLen,ref EVRRenderModelError peError)
  3362. {
  3363. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3364. uint result = FnTable.GetRenderModelOriginalPath(pchRenderModelNameUtf8,pchOriginalPath,unOriginalPathLen,ref peError);
  3365. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3366. return result;
  3367. }
  3368. public string GetRenderModelErrorNameFromEnum(EVRRenderModelError error)
  3369. {
  3370. IntPtr result = FnTable.GetRenderModelErrorNameFromEnum(error);
  3371. return Marshal.PtrToStringAnsi(result);
  3372. }
  3373. }
  3374. public class CVRNotifications
  3375. {
  3376. IVRNotifications FnTable;
  3377. internal CVRNotifications(IntPtr pInterface)
  3378. {
  3379. FnTable = (IVRNotifications)Marshal.PtrToStructure(pInterface, typeof(IVRNotifications));
  3380. }
  3381. public EVRNotificationError CreateNotification(ulong ulOverlayHandle,ulong ulUserValue,EVRNotificationType type,string pchText,EVRNotificationStyle style,ref NotificationBitmap_t pImage,ref uint pNotificationId)
  3382. {
  3383. IntPtr pchTextUtf8 = Utils.ToUtf8(pchText);
  3384. pNotificationId = 0;
  3385. EVRNotificationError result = FnTable.CreateNotification(ulOverlayHandle,ulUserValue,type,pchTextUtf8,style,ref pImage,ref pNotificationId);
  3386. Marshal.FreeHGlobal(pchTextUtf8);
  3387. return result;
  3388. }
  3389. public EVRNotificationError RemoveNotification(uint notificationId)
  3390. {
  3391. EVRNotificationError result = FnTable.RemoveNotification(notificationId);
  3392. return result;
  3393. }
  3394. }
  3395. public class CVRSettings
  3396. {
  3397. IVRSettings FnTable;
  3398. internal CVRSettings(IntPtr pInterface)
  3399. {
  3400. FnTable = (IVRSettings)Marshal.PtrToStructure(pInterface, typeof(IVRSettings));
  3401. }
  3402. public string GetSettingsErrorNameFromEnum(EVRSettingsError eError)
  3403. {
  3404. IntPtr result = FnTable.GetSettingsErrorNameFromEnum(eError);
  3405. return Marshal.PtrToStringAnsi(result);
  3406. }
  3407. public void SetBool(string pchSection,string pchSettingsKey,bool bValue,ref EVRSettingsError peError)
  3408. {
  3409. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3410. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3411. FnTable.SetBool(pchSectionUtf8,pchSettingsKeyUtf8,bValue,ref peError);
  3412. Marshal.FreeHGlobal(pchSectionUtf8);
  3413. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3414. }
  3415. public void SetInt32(string pchSection,string pchSettingsKey,int nValue,ref EVRSettingsError peError)
  3416. {
  3417. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3418. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3419. FnTable.SetInt32(pchSectionUtf8,pchSettingsKeyUtf8,nValue,ref peError);
  3420. Marshal.FreeHGlobal(pchSectionUtf8);
  3421. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3422. }
  3423. public void SetFloat(string pchSection,string pchSettingsKey,float flValue,ref EVRSettingsError peError)
  3424. {
  3425. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3426. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3427. FnTable.SetFloat(pchSectionUtf8,pchSettingsKeyUtf8,flValue,ref peError);
  3428. Marshal.FreeHGlobal(pchSectionUtf8);
  3429. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3430. }
  3431. public void SetString(string pchSection,string pchSettingsKey,string pchValue,ref EVRSettingsError peError)
  3432. {
  3433. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3434. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3435. IntPtr pchValueUtf8 = Utils.ToUtf8(pchValue);
  3436. FnTable.SetString(pchSectionUtf8,pchSettingsKeyUtf8,pchValueUtf8,ref peError);
  3437. Marshal.FreeHGlobal(pchSectionUtf8);
  3438. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3439. Marshal.FreeHGlobal(pchValueUtf8);
  3440. }
  3441. public bool GetBool(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
  3442. {
  3443. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3444. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3445. bool result = FnTable.GetBool(pchSectionUtf8,pchSettingsKeyUtf8,ref peError);
  3446. Marshal.FreeHGlobal(pchSectionUtf8);
  3447. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3448. return result;
  3449. }
  3450. public int GetInt32(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
  3451. {
  3452. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3453. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3454. int result = FnTable.GetInt32(pchSectionUtf8,pchSettingsKeyUtf8,ref peError);
  3455. Marshal.FreeHGlobal(pchSectionUtf8);
  3456. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3457. return result;
  3458. }
  3459. public float GetFloat(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
  3460. {
  3461. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3462. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3463. float result = FnTable.GetFloat(pchSectionUtf8,pchSettingsKeyUtf8,ref peError);
  3464. Marshal.FreeHGlobal(pchSectionUtf8);
  3465. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3466. return result;
  3467. }
  3468. public void GetString(string pchSection,string pchSettingsKey,System.Text.StringBuilder pchValue,uint unValueLen,ref EVRSettingsError peError)
  3469. {
  3470. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3471. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3472. FnTable.GetString(pchSectionUtf8,pchSettingsKeyUtf8,pchValue,unValueLen,ref peError);
  3473. Marshal.FreeHGlobal(pchSectionUtf8);
  3474. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3475. }
  3476. public void RemoveSection(string pchSection,ref EVRSettingsError peError)
  3477. {
  3478. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3479. FnTable.RemoveSection(pchSectionUtf8,ref peError);
  3480. Marshal.FreeHGlobal(pchSectionUtf8);
  3481. }
  3482. public void RemoveKeyInSection(string pchSection,string pchSettingsKey,ref EVRSettingsError peError)
  3483. {
  3484. IntPtr pchSectionUtf8 = Utils.ToUtf8(pchSection);
  3485. IntPtr pchSettingsKeyUtf8 = Utils.ToUtf8(pchSettingsKey);
  3486. FnTable.RemoveKeyInSection(pchSectionUtf8,pchSettingsKeyUtf8,ref peError);
  3487. Marshal.FreeHGlobal(pchSectionUtf8);
  3488. Marshal.FreeHGlobal(pchSettingsKeyUtf8);
  3489. }
  3490. }
  3491. public class CVRScreenshots
  3492. {
  3493. IVRScreenshots FnTable;
  3494. internal CVRScreenshots(IntPtr pInterface)
  3495. {
  3496. FnTable = (IVRScreenshots)Marshal.PtrToStructure(pInterface, typeof(IVRScreenshots));
  3497. }
  3498. public EVRScreenshotError RequestScreenshot(ref uint pOutScreenshotHandle,EVRScreenshotType type,string pchPreviewFilename,string pchVRFilename)
  3499. {
  3500. pOutScreenshotHandle = 0;
  3501. IntPtr pchPreviewFilenameUtf8 = Utils.ToUtf8(pchPreviewFilename);
  3502. IntPtr pchVRFilenameUtf8 = Utils.ToUtf8(pchVRFilename);
  3503. EVRScreenshotError result = FnTable.RequestScreenshot(ref pOutScreenshotHandle,type,pchPreviewFilenameUtf8,pchVRFilenameUtf8);
  3504. Marshal.FreeHGlobal(pchPreviewFilenameUtf8);
  3505. Marshal.FreeHGlobal(pchVRFilenameUtf8);
  3506. return result;
  3507. }
  3508. public EVRScreenshotError HookScreenshot(EVRScreenshotType [] pSupportedTypes)
  3509. {
  3510. EVRScreenshotError result = FnTable.HookScreenshot(pSupportedTypes,(int) pSupportedTypes.Length);
  3511. return result;
  3512. }
  3513. public EVRScreenshotType GetScreenshotPropertyType(uint screenshotHandle,ref EVRScreenshotError pError)
  3514. {
  3515. EVRScreenshotType result = FnTable.GetScreenshotPropertyType(screenshotHandle,ref pError);
  3516. return result;
  3517. }
  3518. public uint GetScreenshotPropertyFilename(uint screenshotHandle,EVRScreenshotPropertyFilenames filenameType,System.Text.StringBuilder pchFilename,uint cchFilename,ref EVRScreenshotError pError)
  3519. {
  3520. uint result = FnTable.GetScreenshotPropertyFilename(screenshotHandle,filenameType,pchFilename,cchFilename,ref pError);
  3521. return result;
  3522. }
  3523. public EVRScreenshotError UpdateScreenshotProgress(uint screenshotHandle,float flProgress)
  3524. {
  3525. EVRScreenshotError result = FnTable.UpdateScreenshotProgress(screenshotHandle,flProgress);
  3526. return result;
  3527. }
  3528. public EVRScreenshotError TakeStereoScreenshot(ref uint pOutScreenshotHandle,string pchPreviewFilename,string pchVRFilename)
  3529. {
  3530. pOutScreenshotHandle = 0;
  3531. IntPtr pchPreviewFilenameUtf8 = Utils.ToUtf8(pchPreviewFilename);
  3532. IntPtr pchVRFilenameUtf8 = Utils.ToUtf8(pchVRFilename);
  3533. EVRScreenshotError result = FnTable.TakeStereoScreenshot(ref pOutScreenshotHandle,pchPreviewFilenameUtf8,pchVRFilenameUtf8);
  3534. Marshal.FreeHGlobal(pchPreviewFilenameUtf8);
  3535. Marshal.FreeHGlobal(pchVRFilenameUtf8);
  3536. return result;
  3537. }
  3538. public EVRScreenshotError SubmitScreenshot(uint screenshotHandle,EVRScreenshotType type,string pchSourcePreviewFilename,string pchSourceVRFilename)
  3539. {
  3540. IntPtr pchSourcePreviewFilenameUtf8 = Utils.ToUtf8(pchSourcePreviewFilename);
  3541. IntPtr pchSourceVRFilenameUtf8 = Utils.ToUtf8(pchSourceVRFilename);
  3542. EVRScreenshotError result = FnTable.SubmitScreenshot(screenshotHandle,type,pchSourcePreviewFilenameUtf8,pchSourceVRFilenameUtf8);
  3543. Marshal.FreeHGlobal(pchSourcePreviewFilenameUtf8);
  3544. Marshal.FreeHGlobal(pchSourceVRFilenameUtf8);
  3545. return result;
  3546. }
  3547. }
  3548. public class CVRResources
  3549. {
  3550. IVRResources FnTable;
  3551. internal CVRResources(IntPtr pInterface)
  3552. {
  3553. FnTable = (IVRResources)Marshal.PtrToStructure(pInterface, typeof(IVRResources));
  3554. }
  3555. public uint LoadSharedResource(string pchResourceName,string pchBuffer,uint unBufferLen)
  3556. {
  3557. IntPtr pchResourceNameUtf8 = Utils.ToUtf8(pchResourceName);
  3558. uint result = FnTable.LoadSharedResource(pchResourceNameUtf8,pchBuffer,unBufferLen);
  3559. Marshal.FreeHGlobal(pchResourceNameUtf8);
  3560. return result;
  3561. }
  3562. public uint GetResourceFullPath(string pchResourceName,string pchResourceTypeDirectory,System.Text.StringBuilder pchPathBuffer,uint unBufferLen)
  3563. {
  3564. IntPtr pchResourceNameUtf8 = Utils.ToUtf8(pchResourceName);
  3565. IntPtr pchResourceTypeDirectoryUtf8 = Utils.ToUtf8(pchResourceTypeDirectory);
  3566. uint result = FnTable.GetResourceFullPath(pchResourceNameUtf8,pchResourceTypeDirectoryUtf8,pchPathBuffer,unBufferLen);
  3567. Marshal.FreeHGlobal(pchResourceNameUtf8);
  3568. Marshal.FreeHGlobal(pchResourceTypeDirectoryUtf8);
  3569. return result;
  3570. }
  3571. }
  3572. public class CVRDriverManager
  3573. {
  3574. IVRDriverManager FnTable;
  3575. internal CVRDriverManager(IntPtr pInterface)
  3576. {
  3577. FnTable = (IVRDriverManager)Marshal.PtrToStructure(pInterface, typeof(IVRDriverManager));
  3578. }
  3579. public uint GetDriverCount()
  3580. {
  3581. uint result = FnTable.GetDriverCount();
  3582. return result;
  3583. }
  3584. public uint GetDriverName(uint nDriver,System.Text.StringBuilder pchValue,uint unBufferSize)
  3585. {
  3586. uint result = FnTable.GetDriverName(nDriver,pchValue,unBufferSize);
  3587. return result;
  3588. }
  3589. public ulong GetDriverHandle(string pchDriverName)
  3590. {
  3591. IntPtr pchDriverNameUtf8 = Utils.ToUtf8(pchDriverName);
  3592. ulong result = FnTable.GetDriverHandle(pchDriverNameUtf8);
  3593. Marshal.FreeHGlobal(pchDriverNameUtf8);
  3594. return result;
  3595. }
  3596. public bool IsEnabled(uint nDriver)
  3597. {
  3598. bool result = FnTable.IsEnabled(nDriver);
  3599. return result;
  3600. }
  3601. }
  3602. public class CVRInput
  3603. {
  3604. IVRInput FnTable;
  3605. internal CVRInput(IntPtr pInterface)
  3606. {
  3607. FnTable = (IVRInput)Marshal.PtrToStructure(pInterface, typeof(IVRInput));
  3608. }
  3609. public EVRInputError SetActionManifestPath(string pchActionManifestPath)
  3610. {
  3611. IntPtr pchActionManifestPathUtf8 = Utils.ToUtf8(pchActionManifestPath);
  3612. EVRInputError result = FnTable.SetActionManifestPath(pchActionManifestPathUtf8);
  3613. Marshal.FreeHGlobal(pchActionManifestPathUtf8);
  3614. return result;
  3615. }
  3616. public EVRInputError GetActionSetHandle(string pchActionSetName,ref ulong pHandle)
  3617. {
  3618. IntPtr pchActionSetNameUtf8 = Utils.ToUtf8(pchActionSetName);
  3619. pHandle = 0;
  3620. EVRInputError result = FnTable.GetActionSetHandle(pchActionSetNameUtf8,ref pHandle);
  3621. Marshal.FreeHGlobal(pchActionSetNameUtf8);
  3622. return result;
  3623. }
  3624. public EVRInputError GetActionHandle(string pchActionName,ref ulong pHandle)
  3625. {
  3626. IntPtr pchActionNameUtf8 = Utils.ToUtf8(pchActionName);
  3627. pHandle = 0;
  3628. EVRInputError result = FnTable.GetActionHandle(pchActionNameUtf8,ref pHandle);
  3629. Marshal.FreeHGlobal(pchActionNameUtf8);
  3630. return result;
  3631. }
  3632. public EVRInputError GetInputSourceHandle(string pchInputSourcePath,ref ulong pHandle)
  3633. {
  3634. IntPtr pchInputSourcePathUtf8 = Utils.ToUtf8(pchInputSourcePath);
  3635. pHandle = 0;
  3636. EVRInputError result = FnTable.GetInputSourceHandle(pchInputSourcePathUtf8,ref pHandle);
  3637. Marshal.FreeHGlobal(pchInputSourcePathUtf8);
  3638. return result;
  3639. }
  3640. public EVRInputError UpdateActionState(VRActiveActionSet_t [] pSets,uint unSizeOfVRSelectedActionSet_t)
  3641. {
  3642. EVRInputError result = FnTable.UpdateActionState(pSets,unSizeOfVRSelectedActionSet_t,(uint) pSets.Length);
  3643. return result;
  3644. }
  3645. public EVRInputError GetDigitalActionData(ulong action,ref InputDigitalActionData_t pActionData,uint unActionDataSize,ulong ulRestrictToDevice)
  3646. {
  3647. EVRInputError result = FnTable.GetDigitalActionData(action,ref pActionData,unActionDataSize,ulRestrictToDevice);
  3648. return result;
  3649. }
  3650. public EVRInputError GetAnalogActionData(ulong action,ref InputAnalogActionData_t pActionData,uint unActionDataSize,ulong ulRestrictToDevice)
  3651. {
  3652. EVRInputError result = FnTable.GetAnalogActionData(action,ref pActionData,unActionDataSize,ulRestrictToDevice);
  3653. return result;
  3654. }
  3655. public EVRInputError GetPoseActionDataRelativeToNow(ulong action,ETrackingUniverseOrigin eOrigin,float fPredictedSecondsFromNow,ref InputPoseActionData_t pActionData,uint unActionDataSize,ulong ulRestrictToDevice)
  3656. {
  3657. EVRInputError result = FnTable.GetPoseActionDataRelativeToNow(action,eOrigin,fPredictedSecondsFromNow,ref pActionData,unActionDataSize,ulRestrictToDevice);
  3658. return result;
  3659. }
  3660. public EVRInputError GetPoseActionDataForNextFrame(ulong action,ETrackingUniverseOrigin eOrigin,ref InputPoseActionData_t pActionData,uint unActionDataSize,ulong ulRestrictToDevice)
  3661. {
  3662. EVRInputError result = FnTable.GetPoseActionDataForNextFrame(action,eOrigin,ref pActionData,unActionDataSize,ulRestrictToDevice);
  3663. return result;
  3664. }
  3665. public EVRInputError GetSkeletalActionData(ulong action,ref InputSkeletalActionData_t pActionData,uint unActionDataSize)
  3666. {
  3667. EVRInputError result = FnTable.GetSkeletalActionData(action,ref pActionData,unActionDataSize);
  3668. return result;
  3669. }
  3670. public EVRInputError GetDominantHand(ref ETrackedControllerRole peDominantHand)
  3671. {
  3672. EVRInputError result = FnTable.GetDominantHand(ref peDominantHand);
  3673. return result;
  3674. }
  3675. public EVRInputError SetDominantHand(ETrackedControllerRole eDominantHand)
  3676. {
  3677. EVRInputError result = FnTable.SetDominantHand(eDominantHand);
  3678. return result;
  3679. }
  3680. public EVRInputError GetBoneCount(ulong action,ref uint pBoneCount)
  3681. {
  3682. pBoneCount = 0;
  3683. EVRInputError result = FnTable.GetBoneCount(action,ref pBoneCount);
  3684. return result;
  3685. }
  3686. public EVRInputError GetBoneHierarchy(ulong action,int [] pParentIndices)
  3687. {
  3688. EVRInputError result = FnTable.GetBoneHierarchy(action,pParentIndices,(uint) pParentIndices.Length);
  3689. return result;
  3690. }
  3691. public EVRInputError GetBoneName(ulong action,int nBoneIndex,System.Text.StringBuilder pchBoneName,uint unNameBufferSize)
  3692. {
  3693. EVRInputError result = FnTable.GetBoneName(action,nBoneIndex,pchBoneName,unNameBufferSize);
  3694. return result;
  3695. }
  3696. public EVRInputError GetSkeletalReferenceTransforms(ulong action,EVRSkeletalTransformSpace eTransformSpace,EVRSkeletalReferencePose eReferencePose,VRBoneTransform_t [] pTransformArray)
  3697. {
  3698. EVRInputError result = FnTable.GetSkeletalReferenceTransforms(action,eTransformSpace,eReferencePose,pTransformArray,(uint) pTransformArray.Length);
  3699. return result;
  3700. }
  3701. public EVRInputError GetSkeletalTrackingLevel(ulong action,ref EVRSkeletalTrackingLevel pSkeletalTrackingLevel)
  3702. {
  3703. EVRInputError result = FnTable.GetSkeletalTrackingLevel(action,ref pSkeletalTrackingLevel);
  3704. return result;
  3705. }
  3706. public EVRInputError GetSkeletalBoneData(ulong action,EVRSkeletalTransformSpace eTransformSpace,EVRSkeletalMotionRange eMotionRange,VRBoneTransform_t [] pTransformArray)
  3707. {
  3708. EVRInputError result = FnTable.GetSkeletalBoneData(action,eTransformSpace,eMotionRange,pTransformArray,(uint) pTransformArray.Length);
  3709. return result;
  3710. }
  3711. public EVRInputError GetSkeletalSummaryData(ulong action,EVRSummaryType eSummaryType,ref VRSkeletalSummaryData_t pSkeletalSummaryData)
  3712. {
  3713. EVRInputError result = FnTable.GetSkeletalSummaryData(action,eSummaryType,ref pSkeletalSummaryData);
  3714. return result;
  3715. }
  3716. public EVRInputError GetSkeletalBoneDataCompressed(ulong action,EVRSkeletalMotionRange eMotionRange,IntPtr pvCompressedData,uint unCompressedSize,ref uint punRequiredCompressedSize)
  3717. {
  3718. punRequiredCompressedSize = 0;
  3719. EVRInputError result = FnTable.GetSkeletalBoneDataCompressed(action,eMotionRange,pvCompressedData,unCompressedSize,ref punRequiredCompressedSize);
  3720. return result;
  3721. }
  3722. public EVRInputError DecompressSkeletalBoneData(IntPtr pvCompressedBuffer,uint unCompressedBufferSize,EVRSkeletalTransformSpace eTransformSpace,VRBoneTransform_t [] pTransformArray)
  3723. {
  3724. EVRInputError result = FnTable.DecompressSkeletalBoneData(pvCompressedBuffer,unCompressedBufferSize,eTransformSpace,pTransformArray,(uint) pTransformArray.Length);
  3725. return result;
  3726. }
  3727. public EVRInputError TriggerHapticVibrationAction(ulong action,float fStartSecondsFromNow,float fDurationSeconds,float fFrequency,float fAmplitude,ulong ulRestrictToDevice)
  3728. {
  3729. EVRInputError result = FnTable.TriggerHapticVibrationAction(action,fStartSecondsFromNow,fDurationSeconds,fFrequency,fAmplitude,ulRestrictToDevice);
  3730. return result;
  3731. }
  3732. public EVRInputError GetActionOrigins(ulong actionSetHandle,ulong digitalActionHandle,ulong [] originsOut)
  3733. {
  3734. EVRInputError result = FnTable.GetActionOrigins(actionSetHandle,digitalActionHandle,originsOut,(uint) originsOut.Length);
  3735. return result;
  3736. }
  3737. public EVRInputError GetOriginLocalizedName(ulong origin,System.Text.StringBuilder pchNameArray,uint unNameArraySize,int unStringSectionsToInclude)
  3738. {
  3739. EVRInputError result = FnTable.GetOriginLocalizedName(origin,pchNameArray,unNameArraySize,unStringSectionsToInclude);
  3740. return result;
  3741. }
  3742. public EVRInputError GetOriginTrackedDeviceInfo(ulong origin,ref InputOriginInfo_t pOriginInfo,uint unOriginInfoSize)
  3743. {
  3744. EVRInputError result = FnTable.GetOriginTrackedDeviceInfo(origin,ref pOriginInfo,unOriginInfoSize);
  3745. return result;
  3746. }
  3747. public EVRInputError GetActionBindingInfo(ulong action,ref InputBindingInfo_t pOriginInfo,uint unBindingInfoSize,uint unBindingInfoCount,ref uint punReturnedBindingInfoCount)
  3748. {
  3749. punReturnedBindingInfoCount = 0;
  3750. EVRInputError result = FnTable.GetActionBindingInfo(action,ref pOriginInfo,unBindingInfoSize,unBindingInfoCount,ref punReturnedBindingInfoCount);
  3751. return result;
  3752. }
  3753. public EVRInputError ShowActionOrigins(ulong actionSetHandle,ulong ulActionHandle)
  3754. {
  3755. EVRInputError result = FnTable.ShowActionOrigins(actionSetHandle,ulActionHandle);
  3756. return result;
  3757. }
  3758. public EVRInputError ShowBindingsForActionSet(VRActiveActionSet_t [] pSets,uint unSizeOfVRSelectedActionSet_t,ulong originToHighlight)
  3759. {
  3760. EVRInputError result = FnTable.ShowBindingsForActionSet(pSets,unSizeOfVRSelectedActionSet_t,(uint) pSets.Length,originToHighlight);
  3761. return result;
  3762. }
  3763. public EVRInputError GetComponentStateForBinding(string pchRenderModelName,string pchComponentName,ref InputBindingInfo_t pOriginInfo,uint unBindingInfoSize,uint unBindingInfoCount,ref RenderModel_ComponentState_t pComponentState)
  3764. {
  3765. IntPtr pchRenderModelNameUtf8 = Utils.ToUtf8(pchRenderModelName);
  3766. IntPtr pchComponentNameUtf8 = Utils.ToUtf8(pchComponentName);
  3767. EVRInputError result = FnTable.GetComponentStateForBinding(pchRenderModelNameUtf8,pchComponentNameUtf8,ref pOriginInfo,unBindingInfoSize,unBindingInfoCount,ref pComponentState);
  3768. Marshal.FreeHGlobal(pchRenderModelNameUtf8);
  3769. Marshal.FreeHGlobal(pchComponentNameUtf8);
  3770. return result;
  3771. }
  3772. public bool IsUsingLegacyInput()
  3773. {
  3774. bool result = FnTable.IsUsingLegacyInput();
  3775. return result;
  3776. }
  3777. public EVRInputError OpenBindingUI(string pchAppKey,ulong ulActionSetHandle,ulong ulDeviceHandle,bool bShowOnDesktop)
  3778. {
  3779. IntPtr pchAppKeyUtf8 = Utils.ToUtf8(pchAppKey);
  3780. EVRInputError result = FnTable.OpenBindingUI(pchAppKeyUtf8,ulActionSetHandle,ulDeviceHandle,bShowOnDesktop);
  3781. Marshal.FreeHGlobal(pchAppKeyUtf8);
  3782. return result;
  3783. }
  3784. public EVRInputError GetBindingVariant(ulong ulDevicePath,System.Text.StringBuilder pchVariantArray,uint unVariantArraySize)
  3785. {
  3786. EVRInputError result = FnTable.GetBindingVariant(ulDevicePath,pchVariantArray,unVariantArraySize);
  3787. return result;
  3788. }
  3789. }
  3790. public class CVRIOBuffer
  3791. {
  3792. IVRIOBuffer FnTable;
  3793. internal CVRIOBuffer(IntPtr pInterface)
  3794. {
  3795. FnTable = (IVRIOBuffer)Marshal.PtrToStructure(pInterface, typeof(IVRIOBuffer));
  3796. }
  3797. public EIOBufferError Open(string pchPath,EIOBufferMode mode,uint unElementSize,uint unElements,ref ulong pulBuffer)
  3798. {
  3799. IntPtr pchPathUtf8 = Utils.ToUtf8(pchPath);
  3800. pulBuffer = 0;
  3801. EIOBufferError result = FnTable.Open(pchPathUtf8,mode,unElementSize,unElements,ref pulBuffer);
  3802. Marshal.FreeHGlobal(pchPathUtf8);
  3803. return result;
  3804. }
  3805. public EIOBufferError Close(ulong ulBuffer)
  3806. {
  3807. EIOBufferError result = FnTable.Close(ulBuffer);
  3808. return result;
  3809. }
  3810. public EIOBufferError Read(ulong ulBuffer,IntPtr pDst,uint unBytes,ref uint punRead)
  3811. {
  3812. punRead = 0;
  3813. EIOBufferError result = FnTable.Read(ulBuffer,pDst,unBytes,ref punRead);
  3814. return result;
  3815. }
  3816. public EIOBufferError Write(ulong ulBuffer,IntPtr pSrc,uint unBytes)
  3817. {
  3818. EIOBufferError result = FnTable.Write(ulBuffer,pSrc,unBytes);
  3819. return result;
  3820. }
  3821. public ulong PropertyContainer(ulong ulBuffer)
  3822. {
  3823. ulong result = FnTable.PropertyContainer(ulBuffer);
  3824. return result;
  3825. }
  3826. public bool HasReaders(ulong ulBuffer)
  3827. {
  3828. bool result = FnTable.HasReaders(ulBuffer);
  3829. return result;
  3830. }
  3831. }
  3832. public class CVRSpatialAnchors
  3833. {
  3834. IVRSpatialAnchors FnTable;
  3835. internal CVRSpatialAnchors(IntPtr pInterface)
  3836. {
  3837. FnTable = (IVRSpatialAnchors)Marshal.PtrToStructure(pInterface, typeof(IVRSpatialAnchors));
  3838. }
  3839. public EVRSpatialAnchorError CreateSpatialAnchorFromDescriptor(string pchDescriptor,ref uint pHandleOut)
  3840. {
  3841. IntPtr pchDescriptorUtf8 = Utils.ToUtf8(pchDescriptor);
  3842. pHandleOut = 0;
  3843. EVRSpatialAnchorError result = FnTable.CreateSpatialAnchorFromDescriptor(pchDescriptorUtf8,ref pHandleOut);
  3844. Marshal.FreeHGlobal(pchDescriptorUtf8);
  3845. return result;
  3846. }
  3847. public EVRSpatialAnchorError CreateSpatialAnchorFromPose(uint unDeviceIndex,ETrackingUniverseOrigin eOrigin,ref SpatialAnchorPose_t pPose,ref uint pHandleOut)
  3848. {
  3849. pHandleOut = 0;
  3850. EVRSpatialAnchorError result = FnTable.CreateSpatialAnchorFromPose(unDeviceIndex,eOrigin,ref pPose,ref pHandleOut);
  3851. return result;
  3852. }
  3853. public EVRSpatialAnchorError GetSpatialAnchorPose(uint unHandle,ETrackingUniverseOrigin eOrigin,ref SpatialAnchorPose_t pPoseOut)
  3854. {
  3855. EVRSpatialAnchorError result = FnTable.GetSpatialAnchorPose(unHandle,eOrigin,ref pPoseOut);
  3856. return result;
  3857. }
  3858. public EVRSpatialAnchorError GetSpatialAnchorDescriptor(uint unHandle,System.Text.StringBuilder pchDescriptorOut,ref uint punDescriptorBufferLenInOut)
  3859. {
  3860. punDescriptorBufferLenInOut = 0;
  3861. EVRSpatialAnchorError result = FnTable.GetSpatialAnchorDescriptor(unHandle,pchDescriptorOut,ref punDescriptorBufferLenInOut);
  3862. return result;
  3863. }
  3864. }
  3865. public class CVRDebug
  3866. {
  3867. IVRDebug FnTable;
  3868. internal CVRDebug(IntPtr pInterface)
  3869. {
  3870. FnTable = (IVRDebug)Marshal.PtrToStructure(pInterface, typeof(IVRDebug));
  3871. }
  3872. public EVRDebugError EmitVrProfilerEvent(string pchMessage)
  3873. {
  3874. IntPtr pchMessageUtf8 = Utils.ToUtf8(pchMessage);
  3875. EVRDebugError result = FnTable.EmitVrProfilerEvent(pchMessageUtf8);
  3876. Marshal.FreeHGlobal(pchMessageUtf8);
  3877. return result;
  3878. }
  3879. public EVRDebugError BeginVrProfilerEvent(ref ulong pHandleOut)
  3880. {
  3881. pHandleOut = 0;
  3882. EVRDebugError result = FnTable.BeginVrProfilerEvent(ref pHandleOut);
  3883. return result;
  3884. }
  3885. public EVRDebugError FinishVrProfilerEvent(ulong hHandle,string pchMessage)
  3886. {
  3887. IntPtr pchMessageUtf8 = Utils.ToUtf8(pchMessage);
  3888. EVRDebugError result = FnTable.FinishVrProfilerEvent(hHandle,pchMessageUtf8);
  3889. Marshal.FreeHGlobal(pchMessageUtf8);
  3890. return result;
  3891. }
  3892. public uint DriverDebugRequest(uint unDeviceIndex,string pchRequest,System.Text.StringBuilder pchResponseBuffer,uint unResponseBufferSize)
  3893. {
  3894. IntPtr pchRequestUtf8 = Utils.ToUtf8(pchRequest);
  3895. uint result = FnTable.DriverDebugRequest(unDeviceIndex,pchRequestUtf8,pchResponseBuffer,unResponseBufferSize);
  3896. Marshal.FreeHGlobal(pchRequestUtf8);
  3897. return result;
  3898. }
  3899. }
  3900. public class CVRProperties
  3901. {
  3902. IVRProperties FnTable;
  3903. internal CVRProperties(IntPtr pInterface)
  3904. {
  3905. FnTable = (IVRProperties)Marshal.PtrToStructure(pInterface, typeof(IVRProperties));
  3906. }
  3907. public ETrackedPropertyError ReadPropertyBatch(ulong ulContainerHandle,ref PropertyRead_t pBatch,uint unBatchEntryCount)
  3908. {
  3909. ETrackedPropertyError result = FnTable.ReadPropertyBatch(ulContainerHandle,ref pBatch,unBatchEntryCount);
  3910. return result;
  3911. }
  3912. public ETrackedPropertyError WritePropertyBatch(ulong ulContainerHandle,ref PropertyWrite_t pBatch,uint unBatchEntryCount)
  3913. {
  3914. ETrackedPropertyError result = FnTable.WritePropertyBatch(ulContainerHandle,ref pBatch,unBatchEntryCount);
  3915. return result;
  3916. }
  3917. public string GetPropErrorNameFromEnum(ETrackedPropertyError error)
  3918. {
  3919. IntPtr result = FnTable.GetPropErrorNameFromEnum(error);
  3920. return Marshal.PtrToStringAnsi(result);
  3921. }
  3922. public ulong TrackedDeviceToPropertyContainer(uint nDevice)
  3923. {
  3924. ulong result = FnTable.TrackedDeviceToPropertyContainer(nDevice);
  3925. return result;
  3926. }
  3927. }
  3928. public class CVRPaths
  3929. {
  3930. IVRPaths FnTable;
  3931. internal CVRPaths(IntPtr pInterface)
  3932. {
  3933. FnTable = (IVRPaths)Marshal.PtrToStructure(pInterface, typeof(IVRPaths));
  3934. }
  3935. public ETrackedPropertyError ReadPathBatch(ulong ulRootHandle,ref PathRead_t pBatch,uint unBatchEntryCount)
  3936. {
  3937. ETrackedPropertyError result = FnTable.ReadPathBatch(ulRootHandle,ref pBatch,unBatchEntryCount);
  3938. return result;
  3939. }
  3940. public ETrackedPropertyError WritePathBatch(ulong ulRootHandle,ref PathWrite_t pBatch,uint unBatchEntryCount)
  3941. {
  3942. ETrackedPropertyError result = FnTable.WritePathBatch(ulRootHandle,ref pBatch,unBatchEntryCount);
  3943. return result;
  3944. }
  3945. public ETrackedPropertyError StringToHandle(ref ulong pHandle,string pchPath)
  3946. {
  3947. pHandle = 0;
  3948. IntPtr pchPathUtf8 = Utils.ToUtf8(pchPath);
  3949. ETrackedPropertyError result = FnTable.StringToHandle(ref pHandle,pchPathUtf8);
  3950. Marshal.FreeHGlobal(pchPathUtf8);
  3951. return result;
  3952. }
  3953. public ETrackedPropertyError HandleToString(ulong pHandle,string pchBuffer,uint unBufferSize,ref uint punBufferSizeUsed)
  3954. {
  3955. punBufferSizeUsed = 0;
  3956. ETrackedPropertyError result = FnTable.HandleToString(pHandle,pchBuffer,unBufferSize,ref punBufferSizeUsed);
  3957. return result;
  3958. }
  3959. }
  3960. public class CVRBlockQueue
  3961. {
  3962. IVRBlockQueue FnTable;
  3963. internal CVRBlockQueue(IntPtr pInterface)
  3964. {
  3965. FnTable = (IVRBlockQueue)Marshal.PtrToStructure(pInterface, typeof(IVRBlockQueue));
  3966. }
  3967. public EBlockQueueError Create(ref ulong pulQueueHandle,string pchPath,uint unBlockDataSize,uint unBlockHeaderSize,uint unBlockCount)
  3968. {
  3969. pulQueueHandle = 0;
  3970. IntPtr pchPathUtf8 = Utils.ToUtf8(pchPath);
  3971. EBlockQueueError result = FnTable.Create(ref pulQueueHandle,pchPathUtf8,unBlockDataSize,unBlockHeaderSize,unBlockCount);
  3972. Marshal.FreeHGlobal(pchPathUtf8);
  3973. return result;
  3974. }
  3975. public EBlockQueueError Connect(ref ulong pulQueueHandle,string pchPath)
  3976. {
  3977. pulQueueHandle = 0;
  3978. IntPtr pchPathUtf8 = Utils.ToUtf8(pchPath);
  3979. EBlockQueueError result = FnTable.Connect(ref pulQueueHandle,pchPathUtf8);
  3980. Marshal.FreeHGlobal(pchPathUtf8);
  3981. return result;
  3982. }
  3983. public EBlockQueueError Destroy(ulong ulQueueHandle)
  3984. {
  3985. EBlockQueueError result = FnTable.Destroy(ulQueueHandle);
  3986. return result;
  3987. }
  3988. public EBlockQueueError AcquireWriteOnlyBlock(ulong ulQueueHandle,ref ulong pulBlockHandle,ref IntPtr ppvBuffer)
  3989. {
  3990. pulBlockHandle = 0;
  3991. EBlockQueueError result = FnTable.AcquireWriteOnlyBlock(ulQueueHandle,ref pulBlockHandle,ref ppvBuffer);
  3992. return result;
  3993. }
  3994. public EBlockQueueError ReleaseWriteOnlyBlock(ulong ulQueueHandle,ulong ulBlockHandle)
  3995. {
  3996. EBlockQueueError result = FnTable.ReleaseWriteOnlyBlock(ulQueueHandle,ulBlockHandle);
  3997. return result;
  3998. }
  3999. public EBlockQueueError WaitAndAcquireReadOnlyBlock(ulong ulQueueHandle,ref ulong pulBlockHandle,ref IntPtr ppvBuffer,EBlockQueueReadType eReadType,uint unTimeoutMs)
  4000. {
  4001. pulBlockHandle = 0;
  4002. EBlockQueueError result = FnTable.WaitAndAcquireReadOnlyBlock(ulQueueHandle,ref pulBlockHandle,ref ppvBuffer,eReadType,unTimeoutMs);
  4003. return result;
  4004. }
  4005. public EBlockQueueError AcquireReadOnlyBlock(ulong ulQueueHandle,ref ulong pulBlockHandle,ref IntPtr ppvBuffer,EBlockQueueReadType eReadType)
  4006. {
  4007. pulBlockHandle = 0;
  4008. EBlockQueueError result = FnTable.AcquireReadOnlyBlock(ulQueueHandle,ref pulBlockHandle,ref ppvBuffer,eReadType);
  4009. return result;
  4010. }
  4011. public EBlockQueueError ReleaseReadOnlyBlock(ulong ulQueueHandle,ulong ulBlockHandle)
  4012. {
  4013. EBlockQueueError result = FnTable.ReleaseReadOnlyBlock(ulQueueHandle,ulBlockHandle);
  4014. return result;
  4015. }
  4016. public EBlockQueueError QueueHasReader(ulong ulQueueHandle,ref bool pbHasReaders)
  4017. {
  4018. pbHasReaders = false;
  4019. EBlockQueueError result = FnTable.QueueHasReader(ulQueueHandle,ref pbHasReaders);
  4020. return result;
  4021. }
  4022. }
  4023. public class OpenVRInterop
  4024. {
  4025. [DllImportAttribute("openvr_api", EntryPoint = "VR_InitInternal", CallingConvention = CallingConvention.Cdecl)]
  4026. internal static extern uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType);
  4027. [DllImportAttribute("openvr_api", EntryPoint = "VR_InitInternal2", CallingConvention = CallingConvention.Cdecl)]
  4028. internal static extern uint InitInternal2(ref EVRInitError peError, EVRApplicationType eApplicationType,[In, MarshalAs(UnmanagedType.LPStr)] string pStartupInfo);
  4029. [DllImportAttribute("openvr_api", EntryPoint = "VR_ShutdownInternal", CallingConvention = CallingConvention.Cdecl)]
  4030. internal static extern void ShutdownInternal();
  4031. [DllImportAttribute("openvr_api", EntryPoint = "VR_IsHmdPresent", CallingConvention = CallingConvention.Cdecl)]
  4032. internal static extern bool IsHmdPresent();
  4033. [DllImportAttribute("openvr_api", EntryPoint = "VR_IsRuntimeInstalled", CallingConvention = CallingConvention.Cdecl)]
  4034. internal static extern bool IsRuntimeInstalled();
  4035. [DllImportAttribute("openvr_api", EntryPoint = "VR_RuntimePath", CallingConvention = CallingConvention.Cdecl)]
  4036. internal static extern string RuntimePath();
  4037. [DllImportAttribute("openvr_api", EntryPoint = "VR_GetRuntimePath", CallingConvention = CallingConvention.Cdecl)]
  4038. internal static extern bool GetRuntimePath(System.Text.StringBuilder pchPathBuffer, uint unBufferSize, ref uint punRequiredBufferSize);
  4039. [DllImportAttribute("openvr_api", EntryPoint = "VR_GetStringForHmdError", CallingConvention = CallingConvention.Cdecl)]
  4040. internal static extern IntPtr GetStringForHmdError(EVRInitError error);
  4041. [DllImportAttribute("openvr_api", EntryPoint = "VR_GetGenericInterface", CallingConvention = CallingConvention.Cdecl)]
  4042. internal static extern IntPtr GetGenericInterface([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion, ref EVRInitError peError);
  4043. [DllImportAttribute("openvr_api", EntryPoint = "VR_IsInterfaceVersionValid", CallingConvention = CallingConvention.Cdecl)]
  4044. internal static extern bool IsInterfaceVersionValid([In, MarshalAs(UnmanagedType.LPStr)] string pchInterfaceVersion);
  4045. [DllImportAttribute("openvr_api", EntryPoint = "VR_GetInitToken", CallingConvention = CallingConvention.Cdecl)]
  4046. internal static extern uint GetInitToken();
  4047. }
  4048. public enum EVREye
  4049. {
  4050. Eye_Left = 0,
  4051. Eye_Right = 1,
  4052. }
  4053. public enum ETextureType
  4054. {
  4055. Invalid = -1,
  4056. DirectX = 0,
  4057. OpenGL = 1,
  4058. Vulkan = 2,
  4059. IOSurface = 3,
  4060. DirectX12 = 4,
  4061. DXGISharedHandle = 5,
  4062. Metal = 6,
  4063. }
  4064. public enum EColorSpace
  4065. {
  4066. Auto = 0,
  4067. Gamma = 1,
  4068. Linear = 2,
  4069. }
  4070. public enum ETrackingResult
  4071. {
  4072. Uninitialized = 1,
  4073. Calibrating_InProgress = 100,
  4074. Calibrating_OutOfRange = 101,
  4075. Running_OK = 200,
  4076. Running_OutOfRange = 201,
  4077. Fallback_RotationOnly = 300,
  4078. }
  4079. public enum ETrackedDeviceClass
  4080. {
  4081. Invalid = 0,
  4082. HMD = 1,
  4083. Controller = 2,
  4084. GenericTracker = 3,
  4085. TrackingReference = 4,
  4086. DisplayRedirect = 5,
  4087. Max = 6,
  4088. }
  4089. public enum ETrackedControllerRole
  4090. {
  4091. Invalid = 0,
  4092. LeftHand = 1,
  4093. RightHand = 2,
  4094. OptOut = 3,
  4095. Treadmill = 4,
  4096. Stylus = 5,
  4097. Max = 5,
  4098. }
  4099. public enum ETrackingUniverseOrigin
  4100. {
  4101. TrackingUniverseSeated = 0,
  4102. TrackingUniverseStanding = 1,
  4103. TrackingUniverseRawAndUncalibrated = 2,
  4104. }
  4105. public enum EAdditionalRadioFeatures
  4106. {
  4107. None = 0,
  4108. HTCLinkBox = 1,
  4109. InternalDongle = 2,
  4110. ExternalDongle = 4,
  4111. }
  4112. public enum ETrackedDeviceProperty
  4113. {
  4114. Prop_Invalid = 0,
  4115. Prop_TrackingSystemName_String = 1000,
  4116. Prop_ModelNumber_String = 1001,
  4117. Prop_SerialNumber_String = 1002,
  4118. Prop_RenderModelName_String = 1003,
  4119. Prop_WillDriftInYaw_Bool = 1004,
  4120. Prop_ManufacturerName_String = 1005,
  4121. Prop_TrackingFirmwareVersion_String = 1006,
  4122. Prop_HardwareRevision_String = 1007,
  4123. Prop_AllWirelessDongleDescriptions_String = 1008,
  4124. Prop_ConnectedWirelessDongle_String = 1009,
  4125. Prop_DeviceIsWireless_Bool = 1010,
  4126. Prop_DeviceIsCharging_Bool = 1011,
  4127. Prop_DeviceBatteryPercentage_Float = 1012,
  4128. Prop_StatusDisplayTransform_Matrix34 = 1013,
  4129. Prop_Firmware_UpdateAvailable_Bool = 1014,
  4130. Prop_Firmware_ManualUpdate_Bool = 1015,
  4131. Prop_Firmware_ManualUpdateURL_String = 1016,
  4132. Prop_HardwareRevision_Uint64 = 1017,
  4133. Prop_FirmwareVersion_Uint64 = 1018,
  4134. Prop_FPGAVersion_Uint64 = 1019,
  4135. Prop_VRCVersion_Uint64 = 1020,
  4136. Prop_RadioVersion_Uint64 = 1021,
  4137. Prop_DongleVersion_Uint64 = 1022,
  4138. Prop_BlockServerShutdown_Bool = 1023,
  4139. Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024,
  4140. Prop_ContainsProximitySensor_Bool = 1025,
  4141. Prop_DeviceProvidesBatteryStatus_Bool = 1026,
  4142. Prop_DeviceCanPowerOff_Bool = 1027,
  4143. Prop_Firmware_ProgrammingTarget_String = 1028,
  4144. Prop_DeviceClass_Int32 = 1029,
  4145. Prop_HasCamera_Bool = 1030,
  4146. Prop_DriverVersion_String = 1031,
  4147. Prop_Firmware_ForceUpdateRequired_Bool = 1032,
  4148. Prop_ViveSystemButtonFixRequired_Bool = 1033,
  4149. Prop_ParentDriver_Uint64 = 1034,
  4150. Prop_ResourceRoot_String = 1035,
  4151. Prop_RegisteredDeviceType_String = 1036,
  4152. Prop_InputProfilePath_String = 1037,
  4153. Prop_NeverTracked_Bool = 1038,
  4154. Prop_NumCameras_Int32 = 1039,
  4155. Prop_CameraFrameLayout_Int32 = 1040,
  4156. Prop_CameraStreamFormat_Int32 = 1041,
  4157. Prop_AdditionalDeviceSettingsPath_String = 1042,
  4158. Prop_Identifiable_Bool = 1043,
  4159. Prop_BootloaderVersion_Uint64 = 1044,
  4160. Prop_AdditionalSystemReportData_String = 1045,
  4161. Prop_CompositeFirmwareVersion_String = 1046,
  4162. Prop_Firmware_RemindUpdate_Bool = 1047,
  4163. Prop_PeripheralApplicationVersion_Uint64 = 1048,
  4164. Prop_ManufacturerSerialNumber_String = 1049,
  4165. Prop_ComputedSerialNumber_String = 1050,
  4166. Prop_EstimatedDeviceFirstUseTime_Int32 = 1051,
  4167. Prop_ReportsTimeSinceVSync_Bool = 2000,
  4168. Prop_SecondsFromVsyncToPhotons_Float = 2001,
  4169. Prop_DisplayFrequency_Float = 2002,
  4170. Prop_UserIpdMeters_Float = 2003,
  4171. Prop_CurrentUniverseId_Uint64 = 2004,
  4172. Prop_PreviousUniverseId_Uint64 = 2005,
  4173. Prop_DisplayFirmwareVersion_Uint64 = 2006,
  4174. Prop_IsOnDesktop_Bool = 2007,
  4175. Prop_DisplayMCType_Int32 = 2008,
  4176. Prop_DisplayMCOffset_Float = 2009,
  4177. Prop_DisplayMCScale_Float = 2010,
  4178. Prop_EdidVendorID_Int32 = 2011,
  4179. Prop_DisplayMCImageLeft_String = 2012,
  4180. Prop_DisplayMCImageRight_String = 2013,
  4181. Prop_DisplayGCBlackClamp_Float = 2014,
  4182. Prop_EdidProductID_Int32 = 2015,
  4183. Prop_CameraToHeadTransform_Matrix34 = 2016,
  4184. Prop_DisplayGCType_Int32 = 2017,
  4185. Prop_DisplayGCOffset_Float = 2018,
  4186. Prop_DisplayGCScale_Float = 2019,
  4187. Prop_DisplayGCPrescale_Float = 2020,
  4188. Prop_DisplayGCImage_String = 2021,
  4189. Prop_LensCenterLeftU_Float = 2022,
  4190. Prop_LensCenterLeftV_Float = 2023,
  4191. Prop_LensCenterRightU_Float = 2024,
  4192. Prop_LensCenterRightV_Float = 2025,
  4193. Prop_UserHeadToEyeDepthMeters_Float = 2026,
  4194. Prop_CameraFirmwareVersion_Uint64 = 2027,
  4195. Prop_CameraFirmwareDescription_String = 2028,
  4196. Prop_DisplayFPGAVersion_Uint64 = 2029,
  4197. Prop_DisplayBootloaderVersion_Uint64 = 2030,
  4198. Prop_DisplayHardwareVersion_Uint64 = 2031,
  4199. Prop_AudioFirmwareVersion_Uint64 = 2032,
  4200. Prop_CameraCompatibilityMode_Int32 = 2033,
  4201. Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034,
  4202. Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035,
  4203. Prop_DisplaySuppressed_Bool = 2036,
  4204. Prop_DisplayAllowNightMode_Bool = 2037,
  4205. Prop_DisplayMCImageWidth_Int32 = 2038,
  4206. Prop_DisplayMCImageHeight_Int32 = 2039,
  4207. Prop_DisplayMCImageNumChannels_Int32 = 2040,
  4208. Prop_DisplayMCImageData_Binary = 2041,
  4209. Prop_SecondsFromPhotonsToVblank_Float = 2042,
  4210. Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043,
  4211. Prop_DisplayDebugMode_Bool = 2044,
  4212. Prop_GraphicsAdapterLuid_Uint64 = 2045,
  4213. Prop_DriverProvidedChaperonePath_String = 2048,
  4214. Prop_ExpectedTrackingReferenceCount_Int32 = 2049,
  4215. Prop_ExpectedControllerCount_Int32 = 2050,
  4216. Prop_NamedIconPathControllerLeftDeviceOff_String = 2051,
  4217. Prop_NamedIconPathControllerRightDeviceOff_String = 2052,
  4218. Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053,
  4219. Prop_DoNotApplyPrediction_Bool = 2054,
  4220. Prop_CameraToHeadTransforms_Matrix34_Array = 2055,
  4221. Prop_DistortionMeshResolution_Int32 = 2056,
  4222. Prop_DriverIsDrawingControllers_Bool = 2057,
  4223. Prop_DriverRequestsApplicationPause_Bool = 2058,
  4224. Prop_DriverRequestsReducedRendering_Bool = 2059,
  4225. Prop_MinimumIpdStepMeters_Float = 2060,
  4226. Prop_AudioBridgeFirmwareVersion_Uint64 = 2061,
  4227. Prop_ImageBridgeFirmwareVersion_Uint64 = 2062,
  4228. Prop_ImuToHeadTransform_Matrix34 = 2063,
  4229. Prop_ImuFactoryGyroBias_Vector3 = 2064,
  4230. Prop_ImuFactoryGyroScale_Vector3 = 2065,
  4231. Prop_ImuFactoryAccelerometerBias_Vector3 = 2066,
  4232. Prop_ImuFactoryAccelerometerScale_Vector3 = 2067,
  4233. Prop_ConfigurationIncludesLighthouse20Features_Bool = 2069,
  4234. Prop_AdditionalRadioFeatures_Uint64 = 2070,
  4235. Prop_CameraWhiteBalance_Vector4_Array = 2071,
  4236. Prop_CameraDistortionFunction_Int32_Array = 2072,
  4237. Prop_CameraDistortionCoefficients_Float_Array = 2073,
  4238. Prop_ExpectedControllerType_String = 2074,
  4239. Prop_HmdTrackingStyle_Int32 = 2075,
  4240. Prop_DriverProvidedChaperoneVisibility_Bool = 2076,
  4241. Prop_HmdColumnCorrectionSettingPrefix_String = 2077,
  4242. Prop_CameraSupportsCompatibilityModes_Bool = 2078,
  4243. Prop_SupportsRoomViewDepthProjection_Bool = 2079,
  4244. Prop_DisplayAvailableFrameRates_Float_Array = 2080,
  4245. Prop_DisplaySupportsMultipleFramerates_Bool = 2081,
  4246. Prop_DisplayColorMultLeft_Vector3 = 2082,
  4247. Prop_DisplayColorMultRight_Vector3 = 2083,
  4248. Prop_DisplaySupportsRuntimeFramerateChange_Bool = 2084,
  4249. Prop_DisplaySupportsAnalogGain_Bool = 2085,
  4250. Prop_DisplayMinAnalogGain_Float = 2086,
  4251. Prop_DisplayMaxAnalogGain_Float = 2087,
  4252. Prop_DashboardScale_Float = 2091,
  4253. Prop_IpdUIRangeMinMeters_Float = 2100,
  4254. Prop_IpdUIRangeMaxMeters_Float = 2101,
  4255. Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200,
  4256. Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201,
  4257. Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202,
  4258. Prop_DriverRequestedMuraFeather_InnerTop_Int32 = 2203,
  4259. Prop_DriverRequestedMuraFeather_InnerBottom_Int32 = 2204,
  4260. Prop_DriverRequestedMuraFeather_OuterLeft_Int32 = 2205,
  4261. Prop_DriverRequestedMuraFeather_OuterRight_Int32 = 2206,
  4262. Prop_DriverRequestedMuraFeather_OuterTop_Int32 = 2207,
  4263. Prop_DriverRequestedMuraFeather_OuterBottom_Int32 = 2208,
  4264. Prop_Audio_DefaultPlaybackDeviceId_String = 2300,
  4265. Prop_Audio_DefaultRecordingDeviceId_String = 2301,
  4266. Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302,
  4267. Prop_AttachedDeviceId_String = 3000,
  4268. Prop_SupportedButtons_Uint64 = 3001,
  4269. Prop_Axis0Type_Int32 = 3002,
  4270. Prop_Axis1Type_Int32 = 3003,
  4271. Prop_Axis2Type_Int32 = 3004,
  4272. Prop_Axis3Type_Int32 = 3005,
  4273. Prop_Axis4Type_Int32 = 3006,
  4274. Prop_ControllerRoleHint_Int32 = 3007,
  4275. Prop_FieldOfViewLeftDegrees_Float = 4000,
  4276. Prop_FieldOfViewRightDegrees_Float = 4001,
  4277. Prop_FieldOfViewTopDegrees_Float = 4002,
  4278. Prop_FieldOfViewBottomDegrees_Float = 4003,
  4279. Prop_TrackingRangeMinimumMeters_Float = 4004,
  4280. Prop_TrackingRangeMaximumMeters_Float = 4005,
  4281. Prop_ModeLabel_String = 4006,
  4282. Prop_CanWirelessIdentify_Bool = 4007,
  4283. Prop_Nonce_Int32 = 4008,
  4284. Prop_IconPathName_String = 5000,
  4285. Prop_NamedIconPathDeviceOff_String = 5001,
  4286. Prop_NamedIconPathDeviceSearching_String = 5002,
  4287. Prop_NamedIconPathDeviceSearchingAlert_String = 5003,
  4288. Prop_NamedIconPathDeviceReady_String = 5004,
  4289. Prop_NamedIconPathDeviceReadyAlert_String = 5005,
  4290. Prop_NamedIconPathDeviceNotReady_String = 5006,
  4291. Prop_NamedIconPathDeviceStandby_String = 5007,
  4292. Prop_NamedIconPathDeviceAlertLow_String = 5008,
  4293. Prop_NamedIconPathDeviceStandbyAlert_String = 5009,
  4294. Prop_DisplayHiddenArea_Binary_Start = 5100,
  4295. Prop_DisplayHiddenArea_Binary_End = 5150,
  4296. Prop_ParentContainer = 5151,
  4297. Prop_OverrideContainer_Uint64 = 5152,
  4298. Prop_UserConfigPath_String = 6000,
  4299. Prop_InstallPath_String = 6001,
  4300. Prop_HasDisplayComponent_Bool = 6002,
  4301. Prop_HasControllerComponent_Bool = 6003,
  4302. Prop_HasCameraComponent_Bool = 6004,
  4303. Prop_HasDriverDirectModeComponent_Bool = 6005,
  4304. Prop_HasVirtualDisplayComponent_Bool = 6006,
  4305. Prop_HasSpatialAnchorsSupport_Bool = 6007,
  4306. Prop_ControllerType_String = 7000,
  4307. Prop_ControllerHandSelectionPriority_Int32 = 7002,
  4308. Prop_VendorSpecific_Reserved_Start = 10000,
  4309. Prop_VendorSpecific_Reserved_End = 10999,
  4310. Prop_TrackedDeviceProperty_Max = 1000000,
  4311. }
  4312. public enum ETrackedPropertyError
  4313. {
  4314. TrackedProp_Success = 0,
  4315. TrackedProp_WrongDataType = 1,
  4316. TrackedProp_WrongDeviceClass = 2,
  4317. TrackedProp_BufferTooSmall = 3,
  4318. TrackedProp_UnknownProperty = 4,
  4319. TrackedProp_InvalidDevice = 5,
  4320. TrackedProp_CouldNotContactServer = 6,
  4321. TrackedProp_ValueNotProvidedByDevice = 7,
  4322. TrackedProp_StringExceedsMaximumLength = 8,
  4323. TrackedProp_NotYetAvailable = 9,
  4324. TrackedProp_PermissionDenied = 10,
  4325. TrackedProp_InvalidOperation = 11,
  4326. TrackedProp_CannotWriteToWildcards = 12,
  4327. TrackedProp_IPCReadFailure = 13,
  4328. TrackedProp_OutOfMemory = 14,
  4329. TrackedProp_InvalidContainer = 15,
  4330. }
  4331. public enum EHmdTrackingStyle
  4332. {
  4333. Unknown = 0,
  4334. Lighthouse = 1,
  4335. OutsideInCameras = 2,
  4336. InsideOutCameras = 3,
  4337. }
  4338. public enum EVRSubmitFlags
  4339. {
  4340. Submit_Default = 0,
  4341. Submit_LensDistortionAlreadyApplied = 1,
  4342. Submit_GlRenderBuffer = 2,
  4343. Submit_Reserved = 4,
  4344. Submit_TextureWithPose = 8,
  4345. Submit_TextureWithDepth = 16,
  4346. Submit_FrameDiscontinuty = 32,
  4347. Submit_VulkanTextureWithArrayData = 64,
  4348. }
  4349. public enum EVRState
  4350. {
  4351. Undefined = -1,
  4352. Off = 0,
  4353. Searching = 1,
  4354. Searching_Alert = 2,
  4355. Ready = 3,
  4356. Ready_Alert = 4,
  4357. NotReady = 5,
  4358. Standby = 6,
  4359. Ready_Alert_Low = 7,
  4360. }
  4361. public enum EVREventType
  4362. {
  4363. VREvent_None = 0,
  4364. VREvent_TrackedDeviceActivated = 100,
  4365. VREvent_TrackedDeviceDeactivated = 101,
  4366. VREvent_TrackedDeviceUpdated = 102,
  4367. VREvent_TrackedDeviceUserInteractionStarted = 103,
  4368. VREvent_TrackedDeviceUserInteractionEnded = 104,
  4369. VREvent_IpdChanged = 105,
  4370. VREvent_EnterStandbyMode = 106,
  4371. VREvent_LeaveStandbyMode = 107,
  4372. VREvent_TrackedDeviceRoleChanged = 108,
  4373. VREvent_WatchdogWakeUpRequested = 109,
  4374. VREvent_LensDistortionChanged = 110,
  4375. VREvent_PropertyChanged = 111,
  4376. VREvent_WirelessDisconnect = 112,
  4377. VREvent_WirelessReconnect = 113,
  4378. VREvent_ButtonPress = 200,
  4379. VREvent_ButtonUnpress = 201,
  4380. VREvent_ButtonTouch = 202,
  4381. VREvent_ButtonUntouch = 203,
  4382. VREvent_Modal_Cancel = 257,
  4383. VREvent_MouseMove = 300,
  4384. VREvent_MouseButtonDown = 301,
  4385. VREvent_MouseButtonUp = 302,
  4386. VREvent_FocusEnter = 303,
  4387. VREvent_FocusLeave = 304,
  4388. VREvent_ScrollDiscrete = 305,
  4389. VREvent_TouchPadMove = 306,
  4390. VREvent_OverlayFocusChanged = 307,
  4391. VREvent_ReloadOverlays = 308,
  4392. VREvent_ScrollSmooth = 309,
  4393. VREvent_LockMousePosition = 310,
  4394. VREvent_UnlockMousePosition = 311,
  4395. VREvent_InputFocusCaptured = 400,
  4396. VREvent_InputFocusReleased = 401,
  4397. VREvent_SceneApplicationChanged = 404,
  4398. VREvent_SceneFocusChanged = 405,
  4399. VREvent_InputFocusChanged = 406,
  4400. VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408,
  4401. VREvent_ActionBindingReloaded = 409,
  4402. VREvent_HideRenderModels = 410,
  4403. VREvent_ShowRenderModels = 411,
  4404. VREvent_SceneApplicationStateChanged = 412,
  4405. VREvent_ConsoleOpened = 420,
  4406. VREvent_ConsoleClosed = 421,
  4407. VREvent_OverlayShown = 500,
  4408. VREvent_OverlayHidden = 501,
  4409. VREvent_DashboardActivated = 502,
  4410. VREvent_DashboardDeactivated = 503,
  4411. VREvent_DashboardRequested = 505,
  4412. VREvent_ResetDashboard = 506,
  4413. VREvent_ImageLoaded = 508,
  4414. VREvent_ShowKeyboard = 509,
  4415. VREvent_HideKeyboard = 510,
  4416. VREvent_OverlayGamepadFocusGained = 511,
  4417. VREvent_OverlayGamepadFocusLost = 512,
  4418. VREvent_OverlaySharedTextureChanged = 513,
  4419. VREvent_ScreenshotTriggered = 516,
  4420. VREvent_ImageFailed = 517,
  4421. VREvent_DashboardOverlayCreated = 518,
  4422. VREvent_SwitchGamepadFocus = 519,
  4423. VREvent_RequestScreenshot = 520,
  4424. VREvent_ScreenshotTaken = 521,
  4425. VREvent_ScreenshotFailed = 522,
  4426. VREvent_SubmitScreenshotToDashboard = 523,
  4427. VREvent_ScreenshotProgressToDashboard = 524,
  4428. VREvent_PrimaryDashboardDeviceChanged = 525,
  4429. VREvent_RoomViewShown = 526,
  4430. VREvent_RoomViewHidden = 527,
  4431. VREvent_ShowUI = 528,
  4432. VREvent_ShowDevTools = 529,
  4433. VREvent_Notification_Shown = 600,
  4434. VREvent_Notification_Hidden = 601,
  4435. VREvent_Notification_BeginInteraction = 602,
  4436. VREvent_Notification_Destroyed = 603,
  4437. VREvent_Quit = 700,
  4438. VREvent_ProcessQuit = 701,
  4439. VREvent_QuitAcknowledged = 703,
  4440. VREvent_DriverRequestedQuit = 704,
  4441. VREvent_RestartRequested = 705,
  4442. VREvent_ChaperoneDataHasChanged = 800,
  4443. VREvent_ChaperoneUniverseHasChanged = 801,
  4444. VREvent_ChaperoneTempDataHasChanged = 802,
  4445. VREvent_ChaperoneSettingsHaveChanged = 803,
  4446. VREvent_SeatedZeroPoseReset = 804,
  4447. VREvent_ChaperoneFlushCache = 805,
  4448. VREvent_ChaperoneRoomSetupStarting = 806,
  4449. VREvent_ChaperoneRoomSetupFinished = 807,
  4450. VREvent_StandingZeroPoseReset = 808,
  4451. VREvent_AudioSettingsHaveChanged = 820,
  4452. VREvent_BackgroundSettingHasChanged = 850,
  4453. VREvent_CameraSettingsHaveChanged = 851,
  4454. VREvent_ReprojectionSettingHasChanged = 852,
  4455. VREvent_ModelSkinSettingsHaveChanged = 853,
  4456. VREvent_EnvironmentSettingsHaveChanged = 854,
  4457. VREvent_PowerSettingsHaveChanged = 855,
  4458. VREvent_EnableHomeAppSettingsHaveChanged = 856,
  4459. VREvent_SteamVRSectionSettingChanged = 857,
  4460. VREvent_LighthouseSectionSettingChanged = 858,
  4461. VREvent_NullSectionSettingChanged = 859,
  4462. VREvent_UserInterfaceSectionSettingChanged = 860,
  4463. VREvent_NotificationsSectionSettingChanged = 861,
  4464. VREvent_KeyboardSectionSettingChanged = 862,
  4465. VREvent_PerfSectionSettingChanged = 863,
  4466. VREvent_DashboardSectionSettingChanged = 864,
  4467. VREvent_WebInterfaceSectionSettingChanged = 865,
  4468. VREvent_TrackersSectionSettingChanged = 866,
  4469. VREvent_LastKnownSectionSettingChanged = 867,
  4470. VREvent_DismissedWarningsSectionSettingChanged = 868,
  4471. VREvent_GpuSpeedSectionSettingChanged = 869,
  4472. VREvent_WindowsMRSectionSettingChanged = 870,
  4473. VREvent_OtherSectionSettingChanged = 871,
  4474. VREvent_StatusUpdate = 900,
  4475. VREvent_WebInterface_InstallDriverCompleted = 950,
  4476. VREvent_MCImageUpdated = 1000,
  4477. VREvent_FirmwareUpdateStarted = 1100,
  4478. VREvent_FirmwareUpdateFinished = 1101,
  4479. VREvent_KeyboardClosed = 1200,
  4480. VREvent_KeyboardCharInput = 1201,
  4481. VREvent_KeyboardDone = 1202,
  4482. VREvent_ApplicationListUpdated = 1303,
  4483. VREvent_ApplicationMimeTypeLoad = 1304,
  4484. VREvent_ProcessConnected = 1306,
  4485. VREvent_ProcessDisconnected = 1307,
  4486. VREvent_Compositor_ChaperoneBoundsShown = 1410,
  4487. VREvent_Compositor_ChaperoneBoundsHidden = 1411,
  4488. VREvent_Compositor_DisplayDisconnected = 1412,
  4489. VREvent_Compositor_DisplayReconnected = 1413,
  4490. VREvent_Compositor_HDCPError = 1414,
  4491. VREvent_Compositor_ApplicationNotResponding = 1415,
  4492. VREvent_Compositor_ApplicationResumed = 1416,
  4493. VREvent_Compositor_OutOfVideoMemory = 1417,
  4494. VREvent_Compositor_DisplayModeNotSupported = 1418,
  4495. VREvent_Compositor_StageOverrideReady = 1419,
  4496. VREvent_TrackedCamera_StartVideoStream = 1500,
  4497. VREvent_TrackedCamera_StopVideoStream = 1501,
  4498. VREvent_TrackedCamera_PauseVideoStream = 1502,
  4499. VREvent_TrackedCamera_ResumeVideoStream = 1503,
  4500. VREvent_TrackedCamera_EditingSurface = 1550,
  4501. VREvent_PerformanceTest_EnableCapture = 1600,
  4502. VREvent_PerformanceTest_DisableCapture = 1601,
  4503. VREvent_PerformanceTest_FidelityLevel = 1602,
  4504. VREvent_MessageOverlay_Closed = 1650,
  4505. VREvent_MessageOverlayCloseRequested = 1651,
  4506. VREvent_Input_HapticVibration = 1700,
  4507. VREvent_Input_BindingLoadFailed = 1701,
  4508. VREvent_Input_BindingLoadSuccessful = 1702,
  4509. VREvent_Input_ActionManifestReloaded = 1703,
  4510. VREvent_Input_ActionManifestLoadFailed = 1704,
  4511. VREvent_Input_ProgressUpdate = 1705,
  4512. VREvent_Input_TrackerActivated = 1706,
  4513. VREvent_Input_BindingsUpdated = 1707,
  4514. VREvent_Input_BindingSubscriptionChanged = 1708,
  4515. VREvent_SpatialAnchors_PoseUpdated = 1800,
  4516. VREvent_SpatialAnchors_DescriptorUpdated = 1801,
  4517. VREvent_SpatialAnchors_RequestPoseUpdate = 1802,
  4518. VREvent_SpatialAnchors_RequestDescriptorUpdate = 1803,
  4519. VREvent_SystemReport_Started = 1900,
  4520. VREvent_Monitor_ShowHeadsetView = 2000,
  4521. VREvent_Monitor_HideHeadsetView = 2001,
  4522. VREvent_VendorSpecific_Reserved_Start = 10000,
  4523. VREvent_VendorSpecific_Reserved_End = 19999,
  4524. }
  4525. public enum EDeviceActivityLevel
  4526. {
  4527. k_EDeviceActivityLevel_Unknown = -1,
  4528. k_EDeviceActivityLevel_Idle = 0,
  4529. k_EDeviceActivityLevel_UserInteraction = 1,
  4530. k_EDeviceActivityLevel_UserInteraction_Timeout = 2,
  4531. k_EDeviceActivityLevel_Standby = 3,
  4532. k_EDeviceActivityLevel_Idle_Timeout = 4,
  4533. }
  4534. public enum EVRButtonId
  4535. {
  4536. k_EButton_System = 0,
  4537. k_EButton_ApplicationMenu = 1,
  4538. k_EButton_Grip = 2,
  4539. k_EButton_DPad_Left = 3,
  4540. k_EButton_DPad_Up = 4,
  4541. k_EButton_DPad_Right = 5,
  4542. k_EButton_DPad_Down = 6,
  4543. k_EButton_A = 7,
  4544. k_EButton_ProximitySensor = 31,
  4545. k_EButton_Axis0 = 32,
  4546. k_EButton_Axis1 = 33,
  4547. k_EButton_Axis2 = 34,
  4548. k_EButton_Axis3 = 35,
  4549. k_EButton_Axis4 = 36,
  4550. k_EButton_SteamVR_Touchpad = 32,
  4551. k_EButton_SteamVR_Trigger = 33,
  4552. k_EButton_Dashboard_Back = 2,
  4553. k_EButton_IndexController_A = 2,
  4554. k_EButton_IndexController_B = 1,
  4555. k_EButton_IndexController_JoyStick = 35,
  4556. k_EButton_Max = 64,
  4557. }
  4558. public enum EVRMouseButton
  4559. {
  4560. Left = 1,
  4561. Right = 2,
  4562. Middle = 4,
  4563. }
  4564. public enum EShowUIType
  4565. {
  4566. ShowUI_ControllerBinding = 0,
  4567. ShowUI_ManageTrackers = 1,
  4568. ShowUI_Pairing = 3,
  4569. ShowUI_Settings = 4,
  4570. ShowUI_DebugCommands = 5,
  4571. ShowUI_FullControllerBinding = 6,
  4572. ShowUI_ManageDrivers = 7,
  4573. }
  4574. public enum EHDCPError
  4575. {
  4576. None = 0,
  4577. LinkLost = 1,
  4578. Tampered = 2,
  4579. DeviceRevoked = 3,
  4580. Unknown = 4,
  4581. }
  4582. public enum EVRComponentProperty
  4583. {
  4584. IsStatic = 1,
  4585. IsVisible = 2,
  4586. IsTouched = 4,
  4587. IsPressed = 8,
  4588. IsScrolled = 16,
  4589. IsHighlighted = 32,
  4590. }
  4591. public enum EVRInputError
  4592. {
  4593. None = 0,
  4594. NameNotFound = 1,
  4595. WrongType = 2,
  4596. InvalidHandle = 3,
  4597. InvalidParam = 4,
  4598. NoSteam = 5,
  4599. MaxCapacityReached = 6,
  4600. IPCError = 7,
  4601. NoActiveActionSet = 8,
  4602. InvalidDevice = 9,
  4603. InvalidSkeleton = 10,
  4604. InvalidBoneCount = 11,
  4605. InvalidCompressedData = 12,
  4606. NoData = 13,
  4607. BufferTooSmall = 14,
  4608. MismatchedActionManifest = 15,
  4609. MissingSkeletonData = 16,
  4610. InvalidBoneIndex = 17,
  4611. InvalidPriority = 18,
  4612. PermissionDenied = 19,
  4613. InvalidRenderModel = 20,
  4614. }
  4615. public enum EVRSpatialAnchorError
  4616. {
  4617. Success = 0,
  4618. Internal = 1,
  4619. UnknownHandle = 2,
  4620. ArrayTooSmall = 3,
  4621. InvalidDescriptorChar = 4,
  4622. NotYetAvailable = 5,
  4623. NotAvailableInThisUniverse = 6,
  4624. PermanentlyUnavailable = 7,
  4625. WrongDriver = 8,
  4626. DescriptorTooLong = 9,
  4627. Unknown = 10,
  4628. NoRoomCalibration = 11,
  4629. InvalidArgument = 12,
  4630. UnknownDriver = 13,
  4631. }
  4632. public enum EHiddenAreaMeshType
  4633. {
  4634. k_eHiddenAreaMesh_Standard = 0,
  4635. k_eHiddenAreaMesh_Inverse = 1,
  4636. k_eHiddenAreaMesh_LineLoop = 2,
  4637. k_eHiddenAreaMesh_Max = 3,
  4638. }
  4639. public enum EVRControllerAxisType
  4640. {
  4641. k_eControllerAxis_None = 0,
  4642. k_eControllerAxis_TrackPad = 1,
  4643. k_eControllerAxis_Joystick = 2,
  4644. k_eControllerAxis_Trigger = 3,
  4645. }
  4646. public enum EVRControllerEventOutputType
  4647. {
  4648. ControllerEventOutput_OSEvents = 0,
  4649. ControllerEventOutput_VREvents = 1,
  4650. }
  4651. public enum ECollisionBoundsStyle
  4652. {
  4653. COLLISION_BOUNDS_STYLE_BEGINNER = 0,
  4654. COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1,
  4655. COLLISION_BOUNDS_STYLE_SQUARES = 2,
  4656. COLLISION_BOUNDS_STYLE_ADVANCED = 3,
  4657. COLLISION_BOUNDS_STYLE_NONE = 4,
  4658. COLLISION_BOUNDS_STYLE_COUNT = 5,
  4659. }
  4660. public enum EVROverlayError
  4661. {
  4662. None = 0,
  4663. UnknownOverlay = 10,
  4664. InvalidHandle = 11,
  4665. PermissionDenied = 12,
  4666. OverlayLimitExceeded = 13,
  4667. WrongVisibilityType = 14,
  4668. KeyTooLong = 15,
  4669. NameTooLong = 16,
  4670. KeyInUse = 17,
  4671. WrongTransformType = 18,
  4672. InvalidTrackedDevice = 19,
  4673. InvalidParameter = 20,
  4674. ThumbnailCantBeDestroyed = 21,
  4675. ArrayTooSmall = 22,
  4676. RequestFailed = 23,
  4677. InvalidTexture = 24,
  4678. UnableToLoadFile = 25,
  4679. KeyboardAlreadyInUse = 26,
  4680. NoNeighbor = 27,
  4681. TooManyMaskPrimitives = 29,
  4682. BadMaskPrimitive = 30,
  4683. TextureAlreadyLocked = 31,
  4684. TextureLockCapacityReached = 32,
  4685. TextureNotLocked = 33,
  4686. }
  4687. public enum EVRApplicationType
  4688. {
  4689. VRApplication_Other = 0,
  4690. VRApplication_Scene = 1,
  4691. VRApplication_Overlay = 2,
  4692. VRApplication_Background = 3,
  4693. VRApplication_Utility = 4,
  4694. VRApplication_VRMonitor = 5,
  4695. VRApplication_SteamWatchdog = 6,
  4696. VRApplication_Bootstrapper = 7,
  4697. VRApplication_WebHelper = 8,
  4698. VRApplication_OpenXR = 9,
  4699. VRApplication_Max = 10,
  4700. }
  4701. public enum EVRFirmwareError
  4702. {
  4703. None = 0,
  4704. Success = 1,
  4705. Fail = 2,
  4706. }
  4707. public enum EVRNotificationError
  4708. {
  4709. OK = 0,
  4710. InvalidNotificationId = 100,
  4711. NotificationQueueFull = 101,
  4712. InvalidOverlayHandle = 102,
  4713. SystemWithUserValueAlreadyExists = 103,
  4714. }
  4715. public enum EVRSkeletalMotionRange
  4716. {
  4717. WithController = 0,
  4718. WithoutController = 1,
  4719. }
  4720. public enum EVRSkeletalTrackingLevel
  4721. {
  4722. VRSkeletalTracking_Estimated = 0,
  4723. VRSkeletalTracking_Partial = 1,
  4724. VRSkeletalTracking_Full = 2,
  4725. Count = 3,
  4726. Max = 2,
  4727. }
  4728. public enum EVRInitError
  4729. {
  4730. None = 0,
  4731. Unknown = 1,
  4732. Init_InstallationNotFound = 100,
  4733. Init_InstallationCorrupt = 101,
  4734. Init_VRClientDLLNotFound = 102,
  4735. Init_FileNotFound = 103,
  4736. Init_FactoryNotFound = 104,
  4737. Init_InterfaceNotFound = 105,
  4738. Init_InvalidInterface = 106,
  4739. Init_UserConfigDirectoryInvalid = 107,
  4740. Init_HmdNotFound = 108,
  4741. Init_NotInitialized = 109,
  4742. Init_PathRegistryNotFound = 110,
  4743. Init_NoConfigPath = 111,
  4744. Init_NoLogPath = 112,
  4745. Init_PathRegistryNotWritable = 113,
  4746. Init_AppInfoInitFailed = 114,
  4747. Init_Retry = 115,
  4748. Init_InitCanceledByUser = 116,
  4749. Init_AnotherAppLaunching = 117,
  4750. Init_SettingsInitFailed = 118,
  4751. Init_ShuttingDown = 119,
  4752. Init_TooManyObjects = 120,
  4753. Init_NoServerForBackgroundApp = 121,
  4754. Init_NotSupportedWithCompositor = 122,
  4755. Init_NotAvailableToUtilityApps = 123,
  4756. Init_Internal = 124,
  4757. Init_HmdDriverIdIsNone = 125,
  4758. Init_HmdNotFoundPresenceFailed = 126,
  4759. Init_VRMonitorNotFound = 127,
  4760. Init_VRMonitorStartupFailed = 128,
  4761. Init_LowPowerWatchdogNotSupported = 129,
  4762. Init_InvalidApplicationType = 130,
  4763. Init_NotAvailableToWatchdogApps = 131,
  4764. Init_WatchdogDisabledInSettings = 132,
  4765. Init_VRDashboardNotFound = 133,
  4766. Init_VRDashboardStartupFailed = 134,
  4767. Init_VRHomeNotFound = 135,
  4768. Init_VRHomeStartupFailed = 136,
  4769. Init_RebootingBusy = 137,
  4770. Init_FirmwareUpdateBusy = 138,
  4771. Init_FirmwareRecoveryBusy = 139,
  4772. Init_USBServiceBusy = 140,
  4773. Init_VRWebHelperStartupFailed = 141,
  4774. Init_TrackerManagerInitFailed = 142,
  4775. Init_AlreadyRunning = 143,
  4776. Init_FailedForVrMonitor = 144,
  4777. Init_PropertyManagerInitFailed = 145,
  4778. Init_WebServerFailed = 146,
  4779. Driver_Failed = 200,
  4780. Driver_Unknown = 201,
  4781. Driver_HmdUnknown = 202,
  4782. Driver_NotLoaded = 203,
  4783. Driver_RuntimeOutOfDate = 204,
  4784. Driver_HmdInUse = 205,
  4785. Driver_NotCalibrated = 206,
  4786. Driver_CalibrationInvalid = 207,
  4787. Driver_HmdDisplayNotFound = 208,
  4788. Driver_TrackedDeviceInterfaceUnknown = 209,
  4789. Driver_HmdDriverIdOutOfBounds = 211,
  4790. Driver_HmdDisplayMirrored = 212,
  4791. Driver_HmdDisplayNotFoundLaptop = 213,
  4792. IPC_ServerInitFailed = 300,
  4793. IPC_ConnectFailed = 301,
  4794. IPC_SharedStateInitFailed = 302,
  4795. IPC_CompositorInitFailed = 303,
  4796. IPC_MutexInitFailed = 304,
  4797. IPC_Failed = 305,
  4798. IPC_CompositorConnectFailed = 306,
  4799. IPC_CompositorInvalidConnectResponse = 307,
  4800. IPC_ConnectFailedAfterMultipleAttempts = 308,
  4801. IPC_ConnectFailedAfterTargetExited = 309,
  4802. IPC_NamespaceUnavailable = 310,
  4803. Compositor_Failed = 400,
  4804. Compositor_D3D11HardwareRequired = 401,
  4805. Compositor_FirmwareRequiresUpdate = 402,
  4806. Compositor_OverlayInitFailed = 403,
  4807. Compositor_ScreenshotsInitFailed = 404,
  4808. Compositor_UnableToCreateDevice = 405,
  4809. Compositor_SharedStateIsNull = 406,
  4810. Compositor_NotificationManagerIsNull = 407,
  4811. Compositor_ResourceManagerClientIsNull = 408,
  4812. Compositor_MessageOverlaySharedStateInitFailure = 409,
  4813. Compositor_PropertiesInterfaceIsNull = 410,
  4814. Compositor_CreateFullscreenWindowFailed = 411,
  4815. Compositor_SettingsInterfaceIsNull = 412,
  4816. Compositor_FailedToShowWindow = 413,
  4817. Compositor_DistortInterfaceIsNull = 414,
  4818. Compositor_DisplayFrequencyFailure = 415,
  4819. Compositor_RendererInitializationFailed = 416,
  4820. Compositor_DXGIFactoryInterfaceIsNull = 417,
  4821. Compositor_DXGIFactoryCreateFailed = 418,
  4822. Compositor_DXGIFactoryQueryFailed = 419,
  4823. Compositor_InvalidAdapterDesktop = 420,
  4824. Compositor_InvalidHmdAttachment = 421,
  4825. Compositor_InvalidOutputDesktop = 422,
  4826. Compositor_InvalidDeviceProvided = 423,
  4827. Compositor_D3D11RendererInitializationFailed = 424,
  4828. Compositor_FailedToFindDisplayMode = 425,
  4829. Compositor_FailedToCreateSwapChain = 426,
  4830. Compositor_FailedToGetBackBuffer = 427,
  4831. Compositor_FailedToCreateRenderTarget = 428,
  4832. Compositor_FailedToCreateDXGI2SwapChain = 429,
  4833. Compositor_FailedtoGetDXGI2BackBuffer = 430,
  4834. Compositor_FailedToCreateDXGI2RenderTarget = 431,
  4835. Compositor_FailedToGetDXGIDeviceInterface = 432,
  4836. Compositor_SelectDisplayMode = 433,
  4837. Compositor_FailedToCreateNvAPIRenderTargets = 434,
  4838. Compositor_NvAPISetDisplayMode = 435,
  4839. Compositor_FailedToCreateDirectModeDisplay = 436,
  4840. Compositor_InvalidHmdPropertyContainer = 437,
  4841. Compositor_UpdateDisplayFrequency = 438,
  4842. Compositor_CreateRasterizerState = 439,
  4843. Compositor_CreateWireframeRasterizerState = 440,
  4844. Compositor_CreateSamplerState = 441,
  4845. Compositor_CreateClampToBorderSamplerState = 442,
  4846. Compositor_CreateAnisoSamplerState = 443,
  4847. Compositor_CreateOverlaySamplerState = 444,
  4848. Compositor_CreatePanoramaSamplerState = 445,
  4849. Compositor_CreateFontSamplerState = 446,
  4850. Compositor_CreateNoBlendState = 447,
  4851. Compositor_CreateBlendState = 448,
  4852. Compositor_CreateAlphaBlendState = 449,
  4853. Compositor_CreateBlendStateMaskR = 450,
  4854. Compositor_CreateBlendStateMaskG = 451,
  4855. Compositor_CreateBlendStateMaskB = 452,
  4856. Compositor_CreateDepthStencilState = 453,
  4857. Compositor_CreateDepthStencilStateNoWrite = 454,
  4858. Compositor_CreateDepthStencilStateNoDepth = 455,
  4859. Compositor_CreateFlushTexture = 456,
  4860. Compositor_CreateDistortionSurfaces = 457,
  4861. Compositor_CreateConstantBuffer = 458,
  4862. Compositor_CreateHmdPoseConstantBuffer = 459,
  4863. Compositor_CreateHmdPoseStagingConstantBuffer = 460,
  4864. Compositor_CreateSharedFrameInfoConstantBuffer = 461,
  4865. Compositor_CreateOverlayConstantBuffer = 462,
  4866. Compositor_CreateSceneTextureIndexConstantBuffer = 463,
  4867. Compositor_CreateReadableSceneTextureIndexConstantBuffer = 464,
  4868. Compositor_CreateLayerGraphicsTextureIndexConstantBuffer = 465,
  4869. Compositor_CreateLayerComputeTextureIndexConstantBuffer = 466,
  4870. Compositor_CreateLayerComputeSceneTextureIndexConstantBuffer = 467,
  4871. Compositor_CreateComputeHmdPoseConstantBuffer = 468,
  4872. Compositor_CreateGeomConstantBuffer = 469,
  4873. Compositor_CreatePanelMaskConstantBuffer = 470,
  4874. Compositor_CreatePixelSimUBO = 471,
  4875. Compositor_CreateMSAARenderTextures = 472,
  4876. Compositor_CreateResolveRenderTextures = 473,
  4877. Compositor_CreateComputeResolveRenderTextures = 474,
  4878. Compositor_CreateDriverDirectModeResolveTextures = 475,
  4879. Compositor_OpenDriverDirectModeResolveTextures = 476,
  4880. Compositor_CreateFallbackSyncTexture = 477,
  4881. Compositor_ShareFallbackSyncTexture = 478,
  4882. Compositor_CreateOverlayIndexBuffer = 479,
  4883. Compositor_CreateOverlayVertexBuffer = 480,
  4884. Compositor_CreateTextVertexBuffer = 481,
  4885. Compositor_CreateTextIndexBuffer = 482,
  4886. Compositor_CreateMirrorTextures = 483,
  4887. Compositor_CreateLastFrameRenderTexture = 484,
  4888. Compositor_CreateMirrorOverlay = 485,
  4889. Compositor_FailedToCreateVirtualDisplayBackbuffer = 486,
  4890. Compositor_DisplayModeNotSupported = 487,
  4891. Compositor_CreateOverlayInvalidCall = 488,
  4892. Compositor_CreateOverlayAlreadyInitialized = 489,
  4893. Compositor_FailedToCreateMailbox = 490,
  4894. VendorSpecific_UnableToConnectToOculusRuntime = 1000,
  4895. VendorSpecific_WindowsNotInDevMode = 1001,
  4896. VendorSpecific_HmdFound_CantOpenDevice = 1101,
  4897. VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102,
  4898. VendorSpecific_HmdFound_NoStoredConfig = 1103,
  4899. VendorSpecific_HmdFound_ConfigTooBig = 1104,
  4900. VendorSpecific_HmdFound_ConfigTooSmall = 1105,
  4901. VendorSpecific_HmdFound_UnableToInitZLib = 1106,
  4902. VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107,
  4903. VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108,
  4904. VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109,
  4905. VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110,
  4906. VendorSpecific_HmdFound_UserDataAddressRange = 1111,
  4907. VendorSpecific_HmdFound_UserDataError = 1112,
  4908. VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113,
  4909. VendorSpecific_OculusRuntimeBadInstall = 1114,
  4910. Steam_SteamInstallationNotFound = 2000,
  4911. LastError = 2001,
  4912. }
  4913. public enum EVRScreenshotType
  4914. {
  4915. None = 0,
  4916. Mono = 1,
  4917. Stereo = 2,
  4918. Cubemap = 3,
  4919. MonoPanorama = 4,
  4920. StereoPanorama = 5,
  4921. }
  4922. public enum EVRScreenshotPropertyFilenames
  4923. {
  4924. Preview = 0,
  4925. VR = 1,
  4926. }
  4927. public enum EVRTrackedCameraError
  4928. {
  4929. None = 0,
  4930. OperationFailed = 100,
  4931. InvalidHandle = 101,
  4932. InvalidFrameHeaderVersion = 102,
  4933. OutOfHandles = 103,
  4934. IPCFailure = 104,
  4935. NotSupportedForThisDevice = 105,
  4936. SharedMemoryFailure = 106,
  4937. FrameBufferingFailure = 107,
  4938. StreamSetupFailure = 108,
  4939. InvalidGLTextureId = 109,
  4940. InvalidSharedTextureHandle = 110,
  4941. FailedToGetGLTextureId = 111,
  4942. SharedTextureFailure = 112,
  4943. NoFrameAvailable = 113,
  4944. InvalidArgument = 114,
  4945. InvalidFrameBufferSize = 115,
  4946. }
  4947. public enum EVRTrackedCameraFrameLayout
  4948. {
  4949. Mono = 1,
  4950. Stereo = 2,
  4951. VerticalLayout = 16,
  4952. HorizontalLayout = 32,
  4953. }
  4954. public enum EVRTrackedCameraFrameType
  4955. {
  4956. Distorted = 0,
  4957. Undistorted = 1,
  4958. MaximumUndistorted = 2,
  4959. MAX_CAMERA_FRAME_TYPES = 3,
  4960. }
  4961. public enum EVRDistortionFunctionType
  4962. {
  4963. None = 0,
  4964. FTheta = 1,
  4965. Extended_FTheta = 2,
  4966. MAX_DISTORTION_FUNCTION_TYPES = 3,
  4967. }
  4968. public enum EVSync
  4969. {
  4970. None = 0,
  4971. WaitRender = 1,
  4972. NoWaitRender = 2,
  4973. }
  4974. public enum EVRMuraCorrectionMode
  4975. {
  4976. Default = 0,
  4977. NoCorrection = 1,
  4978. }
  4979. public enum Imu_OffScaleFlags
  4980. {
  4981. OffScale_AccelX = 1,
  4982. OffScale_AccelY = 2,
  4983. OffScale_AccelZ = 4,
  4984. OffScale_GyroX = 8,
  4985. OffScale_GyroY = 16,
  4986. OffScale_GyroZ = 32,
  4987. }
  4988. public enum EVRApplicationError
  4989. {
  4990. None = 0,
  4991. AppKeyAlreadyExists = 100,
  4992. NoManifest = 101,
  4993. NoApplication = 102,
  4994. InvalidIndex = 103,
  4995. UnknownApplication = 104,
  4996. IPCFailed = 105,
  4997. ApplicationAlreadyRunning = 106,
  4998. InvalidManifest = 107,
  4999. InvalidApplication = 108,
  5000. LaunchFailed = 109,
  5001. ApplicationAlreadyStarting = 110,
  5002. LaunchInProgress = 111,
  5003. OldApplicationQuitting = 112,
  5004. TransitionAborted = 113,
  5005. IsTemplate = 114,
  5006. SteamVRIsExiting = 115,
  5007. BufferTooSmall = 200,
  5008. PropertyNotSet = 201,
  5009. UnknownProperty = 202,
  5010. InvalidParameter = 203,
  5011. }
  5012. public enum EVRApplicationProperty
  5013. {
  5014. Name_String = 0,
  5015. LaunchType_String = 11,
  5016. WorkingDirectory_String = 12,
  5017. BinaryPath_String = 13,
  5018. Arguments_String = 14,
  5019. URL_String = 15,
  5020. Description_String = 50,
  5021. NewsURL_String = 51,
  5022. ImagePath_String = 52,
  5023. Source_String = 53,
  5024. ActionManifestURL_String = 54,
  5025. IsDashboardOverlay_Bool = 60,
  5026. IsTemplate_Bool = 61,
  5027. IsInstanced_Bool = 62,
  5028. IsInternal_Bool = 63,
  5029. WantsCompositorPauseInStandby_Bool = 64,
  5030. IsHidden_Bool = 65,
  5031. LastLaunchTime_Uint64 = 70,
  5032. }
  5033. public enum EVRSceneApplicationState
  5034. {
  5035. None = 0,
  5036. Starting = 1,
  5037. Quitting = 2,
  5038. Running = 3,
  5039. Waiting = 4,
  5040. }
  5041. public enum ChaperoneCalibrationState
  5042. {
  5043. OK = 1,
  5044. Warning = 100,
  5045. Warning_BaseStationMayHaveMoved = 101,
  5046. Warning_BaseStationRemoved = 102,
  5047. Warning_SeatedBoundsInvalid = 103,
  5048. Error = 200,
  5049. Error_BaseStationUninitialized = 201,
  5050. Error_BaseStationConflict = 202,
  5051. Error_PlayAreaInvalid = 203,
  5052. Error_CollisionBoundsInvalid = 204,
  5053. }
  5054. public enum EChaperoneConfigFile
  5055. {
  5056. Live = 1,
  5057. Temp = 2,
  5058. }
  5059. public enum EChaperoneImportFlags
  5060. {
  5061. EChaperoneImport_BoundsOnly = 1,
  5062. }
  5063. public enum EVRCompositorError
  5064. {
  5065. None = 0,
  5066. RequestFailed = 1,
  5067. IncompatibleVersion = 100,
  5068. DoNotHaveFocus = 101,
  5069. InvalidTexture = 102,
  5070. IsNotSceneApplication = 103,
  5071. TextureIsOnWrongDevice = 104,
  5072. TextureUsesUnsupportedFormat = 105,
  5073. SharedTexturesNotSupported = 106,
  5074. IndexOutOfRange = 107,
  5075. AlreadySubmitted = 108,
  5076. InvalidBounds = 109,
  5077. AlreadySet = 110,
  5078. }
  5079. public enum EVRCompositorTimingMode
  5080. {
  5081. Implicit = 0,
  5082. Explicit_RuntimePerformsPostPresentHandoff = 1,
  5083. Explicit_ApplicationPerformsPostPresentHandoff = 2,
  5084. }
  5085. public enum VROverlayInputMethod
  5086. {
  5087. None = 0,
  5088. Mouse = 1,
  5089. }
  5090. public enum VROverlayTransformType
  5091. {
  5092. VROverlayTransform_Invalid = -1,
  5093. VROverlayTransform_Absolute = 0,
  5094. VROverlayTransform_TrackedDeviceRelative = 1,
  5095. VROverlayTransform_SystemOverlay = 2,
  5096. VROverlayTransform_TrackedComponent = 3,
  5097. VROverlayTransform_Cursor = 4,
  5098. VROverlayTransform_DashboardTab = 5,
  5099. VROverlayTransform_DashboardThumb = 6,
  5100. VROverlayTransform_Mountable = 7,
  5101. }
  5102. public enum VROverlayFlags
  5103. {
  5104. NoDashboardTab = 8,
  5105. SendVRDiscreteScrollEvents = 64,
  5106. SendVRTouchpadEvents = 128,
  5107. ShowTouchPadScrollWheel = 256,
  5108. TransferOwnershipToInternalProcess = 512,
  5109. SideBySide_Parallel = 1024,
  5110. SideBySide_Crossed = 2048,
  5111. Panorama = 4096,
  5112. StereoPanorama = 8192,
  5113. SortWithNonSceneOverlays = 16384,
  5114. VisibleInDashboard = 32768,
  5115. MakeOverlaysInteractiveIfVisible = 65536,
  5116. SendVRSmoothScrollEvents = 131072,
  5117. ProtectedContent = 262144,
  5118. HideLaserIntersection = 524288,
  5119. WantsModalBehavior = 1048576,
  5120. IsPremultiplied = 2097152,
  5121. }
  5122. public enum VRMessageOverlayResponse
  5123. {
  5124. ButtonPress_0 = 0,
  5125. ButtonPress_1 = 1,
  5126. ButtonPress_2 = 2,
  5127. ButtonPress_3 = 3,
  5128. CouldntFindSystemOverlay = 4,
  5129. CouldntFindOrCreateClientOverlay = 5,
  5130. ApplicationQuit = 6,
  5131. }
  5132. public enum EGamepadTextInputMode
  5133. {
  5134. k_EGamepadTextInputModeNormal = 0,
  5135. k_EGamepadTextInputModePassword = 1,
  5136. k_EGamepadTextInputModeSubmit = 2,
  5137. }
  5138. public enum EGamepadTextInputLineMode
  5139. {
  5140. k_EGamepadTextInputLineModeSingleLine = 0,
  5141. k_EGamepadTextInputLineModeMultipleLines = 1,
  5142. }
  5143. public enum EVROverlayIntersectionMaskPrimitiveType
  5144. {
  5145. OverlayIntersectionPrimitiveType_Rectangle = 0,
  5146. OverlayIntersectionPrimitiveType_Circle = 1,
  5147. }
  5148. public enum EKeyboardFlags
  5149. {
  5150. KeyboardFlag_Minimal = 1,
  5151. KeyboardFlag_Modal = 2,
  5152. }
  5153. public enum EDeviceType
  5154. {
  5155. Invalid = -1,
  5156. DirectX11 = 0,
  5157. Vulkan = 1,
  5158. }
  5159. public enum HeadsetViewMode_t
  5160. {
  5161. HeadsetViewMode_Left = 0,
  5162. HeadsetViewMode_Right = 1,
  5163. HeadsetViewMode_Both = 2,
  5164. }
  5165. public enum EVRRenderModelError
  5166. {
  5167. None = 0,
  5168. Loading = 100,
  5169. NotSupported = 200,
  5170. InvalidArg = 300,
  5171. InvalidModel = 301,
  5172. NoShapes = 302,
  5173. MultipleShapes = 303,
  5174. TooManyVertices = 304,
  5175. MultipleTextures = 305,
  5176. BufferTooSmall = 306,
  5177. NotEnoughNormals = 307,
  5178. NotEnoughTexCoords = 308,
  5179. InvalidTexture = 400,
  5180. }
  5181. public enum EVRRenderModelTextureFormat
  5182. {
  5183. RGBA8_SRGB = 0,
  5184. BC2 = 1,
  5185. BC4 = 2,
  5186. BC7 = 3,
  5187. BC7_SRGB = 4,
  5188. }
  5189. public enum EVRNotificationType
  5190. {
  5191. Transient = 0,
  5192. Persistent = 1,
  5193. Transient_SystemWithUserValue = 2,
  5194. }
  5195. public enum EVRNotificationStyle
  5196. {
  5197. None = 0,
  5198. Application = 100,
  5199. Contact_Disabled = 200,
  5200. Contact_Enabled = 201,
  5201. Contact_Active = 202,
  5202. }
  5203. public enum EVRSettingsError
  5204. {
  5205. None = 0,
  5206. IPCFailed = 1,
  5207. WriteFailed = 2,
  5208. ReadFailed = 3,
  5209. JsonParseFailed = 4,
  5210. UnsetSettingHasNoDefault = 5,
  5211. }
  5212. public enum EVRScreenshotError
  5213. {
  5214. None = 0,
  5215. RequestFailed = 1,
  5216. IncompatibleVersion = 100,
  5217. NotFound = 101,
  5218. BufferTooSmall = 102,
  5219. ScreenshotAlreadyInProgress = 108,
  5220. }
  5221. public enum EVRSkeletalTransformSpace
  5222. {
  5223. Model = 0,
  5224. Parent = 1,
  5225. }
  5226. public enum EVRSkeletalReferencePose
  5227. {
  5228. BindPose = 0,
  5229. OpenHand = 1,
  5230. Fist = 2,
  5231. GripLimit = 3,
  5232. }
  5233. public enum EVRFinger
  5234. {
  5235. Thumb = 0,
  5236. Index = 1,
  5237. Middle = 2,
  5238. Ring = 3,
  5239. Pinky = 4,
  5240. Count = 5,
  5241. }
  5242. public enum EVRFingerSplay
  5243. {
  5244. Thumb_Index = 0,
  5245. Index_Middle = 1,
  5246. Middle_Ring = 2,
  5247. Ring_Pinky = 3,
  5248. Count = 4,
  5249. }
  5250. public enum EVRSummaryType
  5251. {
  5252. FromAnimation = 0,
  5253. FromDevice = 1,
  5254. }
  5255. public enum EVRInputFilterCancelType
  5256. {
  5257. VRInputFilterCancel_Timers = 0,
  5258. VRInputFilterCancel_Momentum = 1,
  5259. }
  5260. public enum EVRInputStringBits
  5261. {
  5262. VRInputString_Hand = 1,
  5263. VRInputString_ControllerType = 2,
  5264. VRInputString_InputSource = 4,
  5265. VRInputString_All = -1,
  5266. }
  5267. public enum EIOBufferError
  5268. {
  5269. IOBuffer_Success = 0,
  5270. IOBuffer_OperationFailed = 100,
  5271. IOBuffer_InvalidHandle = 101,
  5272. IOBuffer_InvalidArgument = 102,
  5273. IOBuffer_PathExists = 103,
  5274. IOBuffer_PathDoesNotExist = 104,
  5275. IOBuffer_Permission = 105,
  5276. }
  5277. public enum EIOBufferMode
  5278. {
  5279. Read = 1,
  5280. Write = 2,
  5281. Create = 512,
  5282. }
  5283. public enum EVRDebugError
  5284. {
  5285. Success = 0,
  5286. BadParameter = 1,
  5287. }
  5288. public enum EPropertyWriteType
  5289. {
  5290. PropertyWrite_Set = 0,
  5291. PropertyWrite_Erase = 1,
  5292. PropertyWrite_SetError = 2,
  5293. }
  5294. public enum EBlockQueueError
  5295. {
  5296. None = 0,
  5297. QueueAlreadyExists = 1,
  5298. QueueNotFound = 2,
  5299. BlockNotAvailable = 3,
  5300. InvalidHandle = 4,
  5301. InvalidParam = 5,
  5302. ParamMismatch = 6,
  5303. InternalError = 7,
  5304. AlreadyInitialized = 8,
  5305. OperationIsServerOnly = 9,
  5306. TooManyConnections = 10,
  5307. }
  5308. public enum EBlockQueueReadType
  5309. {
  5310. BlockQueueRead_Latest = 0,
  5311. BlockQueueRead_New = 1,
  5312. BlockQueueRead_Next = 2,
  5313. }
  5314. [StructLayout(LayoutKind.Explicit)] public struct VREvent_Data_t
  5315. {
  5316. [FieldOffset(0)] public VREvent_Reserved_t reserved;
  5317. [FieldOffset(0)] public VREvent_Controller_t controller;
  5318. [FieldOffset(0)] public VREvent_Mouse_t mouse;
  5319. [FieldOffset(0)] public VREvent_Scroll_t scroll;
  5320. [FieldOffset(0)] public VREvent_Process_t process;
  5321. [FieldOffset(0)] public VREvent_Notification_t notification;
  5322. [FieldOffset(0)] public VREvent_Overlay_t overlay;
  5323. [FieldOffset(0)] public VREvent_Status_t status;
  5324. [FieldOffset(0)] public VREvent_Ipd_t ipd;
  5325. [FieldOffset(0)] public VREvent_Chaperone_t chaperone;
  5326. [FieldOffset(0)] public VREvent_PerformanceTest_t performanceTest;
  5327. [FieldOffset(0)] public VREvent_TouchPadMove_t touchPadMove;
  5328. [FieldOffset(0)] public VREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;
  5329. [FieldOffset(0)] public VREvent_Screenshot_t screenshot;
  5330. [FieldOffset(0)] public VREvent_ScreenshotProgress_t screenshotProgress;
  5331. [FieldOffset(0)] public VREvent_ApplicationLaunch_t applicationLaunch;
  5332. [FieldOffset(0)] public VREvent_EditingCameraSurface_t cameraSurface;
  5333. [FieldOffset(0)] public VREvent_MessageOverlay_t messageOverlay;
  5334. [FieldOffset(0)] public VREvent_Property_t property;
  5335. [FieldOffset(0)] public VREvent_HapticVibration_t hapticVibration;
  5336. [FieldOffset(0)] public VREvent_WebConsole_t webConsole;
  5337. [FieldOffset(0)] public VREvent_InputBindingLoad_t inputBinding;
  5338. [FieldOffset(0)] public VREvent_SpatialAnchor_t spatialAnchor;
  5339. [FieldOffset(0)] public VREvent_InputActionManifestLoad_t actionManifest;
  5340. [FieldOffset(0)] public VREvent_ProgressUpdate_t progressUpdate;
  5341. [FieldOffset(0)] public VREvent_ShowUI_t showUi;
  5342. [FieldOffset(0)] public VREvent_ShowDevTools_t showDevTools;
  5343. [FieldOffset(0)] public VREvent_HDCPError_t hdcpError;
  5344. [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug
  5345. }
  5346. [StructLayout(LayoutKind.Explicit)] public struct VROverlayIntersectionMaskPrimitive_Data_t
  5347. {
  5348. [FieldOffset(0)] public IntersectionMaskRectangle_t m_Rectangle;
  5349. [FieldOffset(0)] public IntersectionMaskCircle_t m_Circle;
  5350. }
  5351. [StructLayout(LayoutKind.Sequential)] public struct HmdMatrix34_t
  5352. {
  5353. public float m0; //float[3][4]
  5354. public float m1;
  5355. public float m2;
  5356. public float m3;
  5357. public float m4;
  5358. public float m5;
  5359. public float m6;
  5360. public float m7;
  5361. public float m8;
  5362. public float m9;
  5363. public float m10;
  5364. public float m11;
  5365. #if UNITY_5_3_OR_NEWER
  5366. public Vector3 GetPosition()
  5367. {
  5368. return new Vector3(m3, m7, -m11);
  5369. }
  5370. public bool IsRotationValid()
  5371. {
  5372. return ((m2 != 0 || m6 != 0 || m10 != 0) && (m1 != 0 || m5 != 0 || m9 != 0));
  5373. }
  5374. public Quaternion GetRotation()
  5375. {
  5376. if (IsRotationValid())
  5377. {
  5378. float w = Mathf.Sqrt(Mathf.Max(0, 1 + m0 + m5 + m10)) / 2;
  5379. float x = Mathf.Sqrt(Mathf.Max(0, 1 + m0 - m5 - m10)) / 2;
  5380. float y = Mathf.Sqrt(Mathf.Max(0, 1 - m0 + m5 - m10)) / 2;
  5381. float z = Mathf.Sqrt(Mathf.Max(0, 1 - m0 - m5 + m10)) / 2;
  5382. _copysign(ref x, -m9 - -m6);
  5383. _copysign(ref y, -m2 - -m8);
  5384. _copysign(ref z, m4 - m1);
  5385. return new Quaternion(x, y, z, w);
  5386. }
  5387. return Quaternion.identity;
  5388. }
  5389. private static void _copysign(ref float sizeval, float signval)
  5390. {
  5391. if (signval > 0 != sizeval > 0)
  5392. sizeval = -sizeval;
  5393. }
  5394. #endif
  5395. }
  5396. [StructLayout(LayoutKind.Sequential)] public struct HmdMatrix33_t
  5397. {
  5398. public float m0; //float[3][3]
  5399. public float m1;
  5400. public float m2;
  5401. public float m3;
  5402. public float m4;
  5403. public float m5;
  5404. public float m6;
  5405. public float m7;
  5406. public float m8;
  5407. }
  5408. [StructLayout(LayoutKind.Sequential)] public struct HmdMatrix44_t
  5409. {
  5410. public float m0; //float[4][4]
  5411. public float m1;
  5412. public float m2;
  5413. public float m3;
  5414. public float m4;
  5415. public float m5;
  5416. public float m6;
  5417. public float m7;
  5418. public float m8;
  5419. public float m9;
  5420. public float m10;
  5421. public float m11;
  5422. public float m12;
  5423. public float m13;
  5424. public float m14;
  5425. public float m15;
  5426. }
  5427. [StructLayout(LayoutKind.Sequential)] public struct HmdVector3_t
  5428. {
  5429. public float v0; //float[3]
  5430. public float v1;
  5431. public float v2;
  5432. }
  5433. [StructLayout(LayoutKind.Sequential)] public struct HmdVector4_t
  5434. {
  5435. public float v0; //float[4]
  5436. public float v1;
  5437. public float v2;
  5438. public float v3;
  5439. }
  5440. [StructLayout(LayoutKind.Sequential)] public struct HmdVector3d_t
  5441. {
  5442. public double v0; //double[3]
  5443. public double v1;
  5444. public double v2;
  5445. }
  5446. [StructLayout(LayoutKind.Sequential)] public struct HmdVector2_t
  5447. {
  5448. public float v0; //float[2]
  5449. public float v1;
  5450. }
  5451. [StructLayout(LayoutKind.Sequential)] public struct HmdQuaternion_t
  5452. {
  5453. public double w;
  5454. public double x;
  5455. public double y;
  5456. public double z;
  5457. }
  5458. [StructLayout(LayoutKind.Sequential)] public struct HmdQuaternionf_t
  5459. {
  5460. public float w;
  5461. public float x;
  5462. public float y;
  5463. public float z;
  5464. }
  5465. [StructLayout(LayoutKind.Sequential)] public struct HmdColor_t
  5466. {
  5467. public float r;
  5468. public float g;
  5469. public float b;
  5470. public float a;
  5471. }
  5472. [StructLayout(LayoutKind.Sequential)] public struct HmdQuad_t
  5473. {
  5474. public HmdVector3_t vCorners0; //HmdVector3_t[4]
  5475. public HmdVector3_t vCorners1;
  5476. public HmdVector3_t vCorners2;
  5477. public HmdVector3_t vCorners3;
  5478. }
  5479. [StructLayout(LayoutKind.Sequential)] public struct HmdRect2_t
  5480. {
  5481. public HmdVector2_t vTopLeft;
  5482. public HmdVector2_t vBottomRight;
  5483. }
  5484. [StructLayout(LayoutKind.Sequential)] public struct DistortionCoordinates_t
  5485. {
  5486. public float rfRed0; //float[2]
  5487. public float rfRed1;
  5488. public float rfGreen0; //float[2]
  5489. public float rfGreen1;
  5490. public float rfBlue0; //float[2]
  5491. public float rfBlue1;
  5492. }
  5493. [StructLayout(LayoutKind.Sequential)] public struct Texture_t
  5494. {
  5495. public IntPtr handle; // void *
  5496. public ETextureType eType;
  5497. public EColorSpace eColorSpace;
  5498. }
  5499. [StructLayout(LayoutKind.Sequential)] public struct TrackedDevicePose_t
  5500. {
  5501. public HmdMatrix34_t mDeviceToAbsoluteTracking;
  5502. public HmdVector3_t vVelocity;
  5503. public HmdVector3_t vAngularVelocity;
  5504. public ETrackingResult eTrackingResult;
  5505. [MarshalAs(UnmanagedType.I1)]
  5506. public bool bPoseIsValid;
  5507. [MarshalAs(UnmanagedType.I1)]
  5508. public bool bDeviceIsConnected;
  5509. }
  5510. [StructLayout(LayoutKind.Sequential)] public struct VRTextureBounds_t
  5511. {
  5512. public float uMin;
  5513. public float vMin;
  5514. public float uMax;
  5515. public float vMax;
  5516. }
  5517. [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithPose_t
  5518. {
  5519. public IntPtr handle; // void *
  5520. public ETextureType eType;
  5521. public EColorSpace eColorSpace;
  5522. public HmdMatrix34_t mDeviceToAbsoluteTracking;
  5523. }
  5524. [StructLayout(LayoutKind.Sequential)] public struct VRTextureDepthInfo_t
  5525. {
  5526. public IntPtr handle; // void *
  5527. public HmdMatrix44_t mProjection;
  5528. public HmdVector2_t vRange;
  5529. }
  5530. [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithDepth_t
  5531. {
  5532. public IntPtr handle; // void *
  5533. public ETextureType eType;
  5534. public EColorSpace eColorSpace;
  5535. public VRTextureDepthInfo_t depth;
  5536. }
  5537. [StructLayout(LayoutKind.Sequential)] public struct VRTextureWithPoseAndDepth_t
  5538. {
  5539. public IntPtr handle; // void *
  5540. public ETextureType eType;
  5541. public EColorSpace eColorSpace;
  5542. public HmdMatrix34_t mDeviceToAbsoluteTracking;
  5543. public VRTextureDepthInfo_t depth;
  5544. }
  5545. [StructLayout(LayoutKind.Sequential)] public struct VRVulkanTextureData_t
  5546. {
  5547. public ulong m_nImage;
  5548. public IntPtr m_pDevice; // struct VkDevice_T *
  5549. public IntPtr m_pPhysicalDevice; // struct VkPhysicalDevice_T *
  5550. public IntPtr m_pInstance; // struct VkInstance_T *
  5551. public IntPtr m_pQueue; // struct VkQueue_T *
  5552. public uint m_nQueueFamilyIndex;
  5553. public uint m_nWidth;
  5554. public uint m_nHeight;
  5555. public uint m_nFormat;
  5556. public uint m_nSampleCount;
  5557. }
  5558. [StructLayout(LayoutKind.Sequential)] public struct VRVulkanTextureArrayData_t
  5559. {
  5560. public uint m_unArrayIndex;
  5561. public uint m_unArraySize;
  5562. }
  5563. [StructLayout(LayoutKind.Sequential)] public struct D3D12TextureData_t
  5564. {
  5565. public IntPtr m_pResource; // struct ID3D12Resource *
  5566. public IntPtr m_pCommandQueue; // struct ID3D12CommandQueue *
  5567. public uint m_nNodeMask;
  5568. }
  5569. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Controller_t
  5570. {
  5571. public uint button;
  5572. }
  5573. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Mouse_t
  5574. {
  5575. public float x;
  5576. public float y;
  5577. public uint button;
  5578. }
  5579. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Scroll_t
  5580. {
  5581. public float xdelta;
  5582. public float ydelta;
  5583. public uint unused;
  5584. public float viewportscale;
  5585. }
  5586. [StructLayout(LayoutKind.Sequential)] public struct VREvent_TouchPadMove_t
  5587. {
  5588. [MarshalAs(UnmanagedType.I1)]
  5589. public bool bFingerDown;
  5590. public float flSecondsFingerDown;
  5591. public float fValueXFirst;
  5592. public float fValueYFirst;
  5593. public float fValueXRaw;
  5594. public float fValueYRaw;
  5595. }
  5596. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Notification_t
  5597. {
  5598. public ulong ulUserValue;
  5599. public uint notificationId;
  5600. }
  5601. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Process_t
  5602. {
  5603. public uint pid;
  5604. public uint oldPid;
  5605. [MarshalAs(UnmanagedType.I1)]
  5606. public bool bForced;
  5607. [MarshalAs(UnmanagedType.I1)]
  5608. public bool bConnectionLost;
  5609. }
  5610. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Overlay_t
  5611. {
  5612. public ulong overlayHandle;
  5613. public ulong devicePath;
  5614. }
  5615. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Status_t
  5616. {
  5617. public uint statusState;
  5618. }
  5619. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Keyboard_t
  5620. {
  5621. public byte cNewInput0,cNewInput1,cNewInput2,cNewInput3,cNewInput4,cNewInput5,cNewInput6,cNewInput7;
  5622. public string cNewInput
  5623. {
  5624. get
  5625. {
  5626. return new string(new char[] {
  5627. (char)cNewInput0,
  5628. (char)cNewInput1,
  5629. (char)cNewInput2,
  5630. (char)cNewInput3,
  5631. (char)cNewInput4,
  5632. (char)cNewInput5,
  5633. (char)cNewInput6,
  5634. (char)cNewInput7
  5635. }).TrimEnd('\0');
  5636. }
  5637. }
  5638. public ulong uUserValue;
  5639. }
  5640. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Ipd_t
  5641. {
  5642. public float ipdMeters;
  5643. }
  5644. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Chaperone_t
  5645. {
  5646. public ulong m_nPreviousUniverse;
  5647. public ulong m_nCurrentUniverse;
  5648. }
  5649. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Reserved_t
  5650. {
  5651. public ulong reserved0;
  5652. public ulong reserved1;
  5653. public ulong reserved2;
  5654. public ulong reserved3;
  5655. public ulong reserved4;
  5656. public ulong reserved5;
  5657. }
  5658. [StructLayout(LayoutKind.Sequential)] public struct VREvent_PerformanceTest_t
  5659. {
  5660. public uint m_nFidelityLevel;
  5661. }
  5662. [StructLayout(LayoutKind.Sequential)] public struct VREvent_SeatedZeroPoseReset_t
  5663. {
  5664. [MarshalAs(UnmanagedType.I1)]
  5665. public bool bResetBySystemMenu;
  5666. }
  5667. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Screenshot_t
  5668. {
  5669. public uint handle;
  5670. public uint type;
  5671. }
  5672. [StructLayout(LayoutKind.Sequential)] public struct VREvent_ScreenshotProgress_t
  5673. {
  5674. public float progress;
  5675. }
  5676. [StructLayout(LayoutKind.Sequential)] public struct VREvent_ApplicationLaunch_t
  5677. {
  5678. public uint pid;
  5679. public uint unArgsHandle;
  5680. }
  5681. [StructLayout(LayoutKind.Sequential)] public struct VREvent_EditingCameraSurface_t
  5682. {
  5683. public ulong overlayHandle;
  5684. public uint nVisualMode;
  5685. }
  5686. [StructLayout(LayoutKind.Sequential)] public struct VREvent_MessageOverlay_t
  5687. {
  5688. public uint unVRMessageOverlayResponse;
  5689. }
  5690. [StructLayout(LayoutKind.Sequential)] public struct VREvent_Property_t
  5691. {
  5692. public ulong container;
  5693. public ETrackedDeviceProperty prop;
  5694. }
  5695. [StructLayout(LayoutKind.Sequential)] public struct VREvent_HapticVibration_t
  5696. {
  5697. public ulong containerHandle;
  5698. public ulong componentHandle;
  5699. public float fDurationSeconds;
  5700. public float fFrequency;
  5701. public float fAmplitude;
  5702. }
  5703. [StructLayout(LayoutKind.Sequential)] public struct VREvent_WebConsole_t
  5704. {
  5705. public ulong webConsoleHandle;
  5706. }
  5707. [StructLayout(LayoutKind.Sequential)] public struct VREvent_InputBindingLoad_t
  5708. {
  5709. public ulong ulAppContainer;
  5710. public ulong pathMessage;
  5711. public ulong pathUrl;
  5712. public ulong pathControllerType;
  5713. }
  5714. [StructLayout(LayoutKind.Sequential)] public struct VREvent_InputActionManifestLoad_t
  5715. {
  5716. public ulong pathAppKey;
  5717. public ulong pathMessage;
  5718. public ulong pathMessageParam;
  5719. public ulong pathManifestPath;
  5720. }
  5721. [StructLayout(LayoutKind.Sequential)] public struct VREvent_SpatialAnchor_t
  5722. {
  5723. public uint unHandle;
  5724. }
  5725. [StructLayout(LayoutKind.Sequential)] public struct VREvent_ProgressUpdate_t
  5726. {
  5727. public ulong ulApplicationPropertyContainer;
  5728. public ulong pathDevice;
  5729. public ulong pathInputSource;
  5730. public ulong pathProgressAction;
  5731. public ulong pathIcon;
  5732. public float fProgress;
  5733. }
  5734. [StructLayout(LayoutKind.Sequential)] public struct VREvent_ShowUI_t
  5735. {
  5736. public EShowUIType eType;
  5737. }
  5738. [StructLayout(LayoutKind.Sequential)] public struct VREvent_ShowDevTools_t
  5739. {
  5740. public int nBrowserIdentifier;
  5741. }
  5742. [StructLayout(LayoutKind.Sequential)] public struct VREvent_HDCPError_t
  5743. {
  5744. public EHDCPError eCode;
  5745. }
  5746. [StructLayout(LayoutKind.Sequential)] public struct VREvent_t
  5747. {
  5748. public uint eventType;
  5749. public uint trackedDeviceIndex;
  5750. public float eventAgeSeconds;
  5751. public VREvent_Data_t data;
  5752. }
  5753. // This structure is for backwards binary compatibility on Linux and OSX only
  5754. [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct VREvent_t_Packed
  5755. {
  5756. public uint eventType;
  5757. public uint trackedDeviceIndex;
  5758. public float eventAgeSeconds;
  5759. public VREvent_Data_t data;
  5760. public VREvent_t_Packed(VREvent_t unpacked)
  5761. {
  5762. this.eventType = unpacked.eventType;
  5763. this.trackedDeviceIndex = unpacked.trackedDeviceIndex;
  5764. this.eventAgeSeconds = unpacked.eventAgeSeconds;
  5765. this.data = unpacked.data;
  5766. }
  5767. public void Unpack(ref VREvent_t unpacked)
  5768. {
  5769. unpacked.eventType = this.eventType;
  5770. unpacked.trackedDeviceIndex = this.trackedDeviceIndex;
  5771. unpacked.eventAgeSeconds = this.eventAgeSeconds;
  5772. unpacked.data = this.data;
  5773. }
  5774. }
  5775. [StructLayout(LayoutKind.Sequential)] public struct RenderModel_ComponentState_t
  5776. {
  5777. public HmdMatrix34_t mTrackingToComponentRenderModel;
  5778. public HmdMatrix34_t mTrackingToComponentLocal;
  5779. public uint uProperties;
  5780. }
  5781. [StructLayout(LayoutKind.Sequential)] public struct HiddenAreaMesh_t
  5782. {
  5783. public IntPtr pVertexData; // const struct vr::HmdVector2_t *
  5784. public uint unTriangleCount;
  5785. }
  5786. [StructLayout(LayoutKind.Sequential)] public struct VRControllerAxis_t
  5787. {
  5788. public float x;
  5789. public float y;
  5790. }
  5791. [StructLayout(LayoutKind.Sequential)] public struct VRControllerState_t
  5792. {
  5793. public uint unPacketNum;
  5794. public ulong ulButtonPressed;
  5795. public ulong ulButtonTouched;
  5796. public VRControllerAxis_t rAxis0; //VRControllerAxis_t[5]
  5797. public VRControllerAxis_t rAxis1;
  5798. public VRControllerAxis_t rAxis2;
  5799. public VRControllerAxis_t rAxis3;
  5800. public VRControllerAxis_t rAxis4;
  5801. }
  5802. // This structure is for backwards binary compatibility on Linux and OSX only
  5803. [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct VRControllerState_t_Packed
  5804. {
  5805. public uint unPacketNum;
  5806. public ulong ulButtonPressed;
  5807. public ulong ulButtonTouched;
  5808. public VRControllerAxis_t rAxis0; //VRControllerAxis_t[5]
  5809. public VRControllerAxis_t rAxis1;
  5810. public VRControllerAxis_t rAxis2;
  5811. public VRControllerAxis_t rAxis3;
  5812. public VRControllerAxis_t rAxis4;
  5813. public VRControllerState_t_Packed(VRControllerState_t unpacked)
  5814. {
  5815. this.unPacketNum = unpacked.unPacketNum;
  5816. this.ulButtonPressed = unpacked.ulButtonPressed;
  5817. this.ulButtonTouched = unpacked.ulButtonTouched;
  5818. this.rAxis0 = unpacked.rAxis0;
  5819. this.rAxis1 = unpacked.rAxis1;
  5820. this.rAxis2 = unpacked.rAxis2;
  5821. this.rAxis3 = unpacked.rAxis3;
  5822. this.rAxis4 = unpacked.rAxis4;
  5823. }
  5824. public void Unpack(ref VRControllerState_t unpacked)
  5825. {
  5826. unpacked.unPacketNum = this.unPacketNum;
  5827. unpacked.ulButtonPressed = this.ulButtonPressed;
  5828. unpacked.ulButtonTouched = this.ulButtonTouched;
  5829. unpacked.rAxis0 = this.rAxis0;
  5830. unpacked.rAxis1 = this.rAxis1;
  5831. unpacked.rAxis2 = this.rAxis2;
  5832. unpacked.rAxis3 = this.rAxis3;
  5833. unpacked.rAxis4 = this.rAxis4;
  5834. }
  5835. }
  5836. [StructLayout(LayoutKind.Sequential)] public struct VRBoneTransform_t
  5837. {
  5838. public HmdVector4_t position;
  5839. public HmdQuaternionf_t orientation;
  5840. }
  5841. [StructLayout(LayoutKind.Sequential)] public struct CameraVideoStreamFrameHeader_t
  5842. {
  5843. public EVRTrackedCameraFrameType eFrameType;
  5844. public uint nWidth;
  5845. public uint nHeight;
  5846. public uint nBytesPerPixel;
  5847. public uint nFrameSequence;
  5848. public TrackedDevicePose_t trackedDevicePose;
  5849. public ulong ulFrameExposureTime;
  5850. }
  5851. [StructLayout(LayoutKind.Sequential)] public struct Compositor_FrameTiming
  5852. {
  5853. public uint m_nSize;
  5854. public uint m_nFrameIndex;
  5855. public uint m_nNumFramePresents;
  5856. public uint m_nNumMisPresented;
  5857. public uint m_nNumDroppedFrames;
  5858. public uint m_nReprojectionFlags;
  5859. public double m_flSystemTimeInSeconds;
  5860. public float m_flPreSubmitGpuMs;
  5861. public float m_flPostSubmitGpuMs;
  5862. public float m_flTotalRenderGpuMs;
  5863. public float m_flCompositorRenderGpuMs;
  5864. public float m_flCompositorRenderCpuMs;
  5865. public float m_flCompositorIdleCpuMs;
  5866. public float m_flClientFrameIntervalMs;
  5867. public float m_flPresentCallCpuMs;
  5868. public float m_flWaitForPresentCpuMs;
  5869. public float m_flSubmitFrameMs;
  5870. public float m_flWaitGetPosesCalledMs;
  5871. public float m_flNewPosesReadyMs;
  5872. public float m_flNewFrameReadyMs;
  5873. public float m_flCompositorUpdateStartMs;
  5874. public float m_flCompositorUpdateEndMs;
  5875. public float m_flCompositorRenderStartMs;
  5876. public TrackedDevicePose_t m_HmdPose;
  5877. public uint m_nNumVSyncsReadyForUse;
  5878. public uint m_nNumVSyncsToFirstView;
  5879. }
  5880. [StructLayout(LayoutKind.Sequential)] public struct Compositor_BenchmarkResults
  5881. {
  5882. public float m_flMegaPixelsPerSecond;
  5883. public float m_flHmdRecommendedMegaPixelsPerSecond;
  5884. }
  5885. [StructLayout(LayoutKind.Sequential)] public struct DriverDirectMode_FrameTiming
  5886. {
  5887. public uint m_nSize;
  5888. public uint m_nNumFramePresents;
  5889. public uint m_nNumMisPresented;
  5890. public uint m_nNumDroppedFrames;
  5891. public uint m_nReprojectionFlags;
  5892. }
  5893. [StructLayout(LayoutKind.Sequential)] public struct ImuSample_t
  5894. {
  5895. public double fSampleTime;
  5896. public HmdVector3d_t vAccel;
  5897. public HmdVector3d_t vGyro;
  5898. public uint unOffScaleFlags;
  5899. }
  5900. [StructLayout(LayoutKind.Sequential)] public struct AppOverrideKeys_t
  5901. {
  5902. public IntPtr pchKey; // const char *
  5903. public IntPtr pchValue; // const char *
  5904. }
  5905. [StructLayout(LayoutKind.Sequential)] public struct Compositor_CumulativeStats
  5906. {
  5907. public uint m_nPid;
  5908. public uint m_nNumFramePresents;
  5909. public uint m_nNumDroppedFrames;
  5910. public uint m_nNumReprojectedFrames;
  5911. public uint m_nNumFramePresentsOnStartup;
  5912. public uint m_nNumDroppedFramesOnStartup;
  5913. public uint m_nNumReprojectedFramesOnStartup;
  5914. public uint m_nNumLoading;
  5915. public uint m_nNumFramePresentsLoading;
  5916. public uint m_nNumDroppedFramesLoading;
  5917. public uint m_nNumReprojectedFramesLoading;
  5918. public uint m_nNumTimedOut;
  5919. public uint m_nNumFramePresentsTimedOut;
  5920. public uint m_nNumDroppedFramesTimedOut;
  5921. public uint m_nNumReprojectedFramesTimedOut;
  5922. }
  5923. [StructLayout(LayoutKind.Sequential)] public struct Compositor_StageRenderSettings
  5924. {
  5925. public HmdColor_t m_PrimaryColor;
  5926. public HmdColor_t m_SecondaryColor;
  5927. public float m_flVignetteInnerRadius;
  5928. public float m_flVignetteOuterRadius;
  5929. public float m_flFresnelStrength;
  5930. [MarshalAs(UnmanagedType.I1)]
  5931. public bool m_bBackfaceCulling;
  5932. [MarshalAs(UnmanagedType.I1)]
  5933. public bool m_bGreyscale;
  5934. [MarshalAs(UnmanagedType.I1)]
  5935. public bool m_bWireframe;
  5936. }
  5937. [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionParams_t
  5938. {
  5939. public HmdVector3_t vSource;
  5940. public HmdVector3_t vDirection;
  5941. public ETrackingUniverseOrigin eOrigin;
  5942. }
  5943. [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionResults_t
  5944. {
  5945. public HmdVector3_t vPoint;
  5946. public HmdVector3_t vNormal;
  5947. public HmdVector2_t vUVs;
  5948. public float fDistance;
  5949. }
  5950. [StructLayout(LayoutKind.Sequential)] public struct IntersectionMaskRectangle_t
  5951. {
  5952. public float m_flTopLeftX;
  5953. public float m_flTopLeftY;
  5954. public float m_flWidth;
  5955. public float m_flHeight;
  5956. }
  5957. [StructLayout(LayoutKind.Sequential)] public struct IntersectionMaskCircle_t
  5958. {
  5959. public float m_flCenterX;
  5960. public float m_flCenterY;
  5961. public float m_flRadius;
  5962. }
  5963. [StructLayout(LayoutKind.Sequential)] public struct VROverlayIntersectionMaskPrimitive_t
  5964. {
  5965. public EVROverlayIntersectionMaskPrimitiveType m_nPrimitiveType;
  5966. public VROverlayIntersectionMaskPrimitive_Data_t m_Primitive;
  5967. }
  5968. [StructLayout(LayoutKind.Sequential)] public struct VROverlayView_t
  5969. {
  5970. public ulong overlayHandle;
  5971. public Texture_t texture;
  5972. public VRTextureBounds_t textureBounds;
  5973. }
  5974. [StructLayout(LayoutKind.Sequential)] public struct VRVulkanDevice_t
  5975. {
  5976. public IntPtr m_pInstance; // struct VkInstance_T *
  5977. public IntPtr m_pDevice; // struct VkDevice_T *
  5978. public IntPtr m_pPhysicalDevice; // struct VkPhysicalDevice_T *
  5979. public IntPtr m_pQueue; // struct VkQueue_T *
  5980. public uint m_uQueueFamilyIndex;
  5981. }
  5982. [StructLayout(LayoutKind.Sequential)] public struct VRNativeDevice_t
  5983. {
  5984. public IntPtr handle; // void *
  5985. public EDeviceType eType;
  5986. }
  5987. [StructLayout(LayoutKind.Sequential)] public struct RenderModel_Vertex_t
  5988. {
  5989. public HmdVector3_t vPosition;
  5990. public HmdVector3_t vNormal;
  5991. public float rfTextureCoord0; //float[2]
  5992. public float rfTextureCoord1;
  5993. }
  5994. [StructLayout(LayoutKind.Sequential)] public struct RenderModel_TextureMap_t
  5995. {
  5996. public ushort unWidth;
  5997. public ushort unHeight;
  5998. public IntPtr rubTextureMapData; // const uint8_t *
  5999. public EVRRenderModelTextureFormat format;
  6000. }
  6001. // This structure is for backwards binary compatibility on Linux and OSX only
  6002. [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_TextureMap_t_Packed
  6003. {
  6004. public ushort unWidth;
  6005. public ushort unHeight;
  6006. public IntPtr rubTextureMapData; // const uint8_t *
  6007. public EVRRenderModelTextureFormat format;
  6008. public RenderModel_TextureMap_t_Packed(RenderModel_TextureMap_t unpacked)
  6009. {
  6010. this.unWidth = unpacked.unWidth;
  6011. this.unHeight = unpacked.unHeight;
  6012. this.rubTextureMapData = unpacked.rubTextureMapData;
  6013. this.format = unpacked.format;
  6014. }
  6015. public void Unpack(ref RenderModel_TextureMap_t unpacked)
  6016. {
  6017. unpacked.unWidth = this.unWidth;
  6018. unpacked.unHeight = this.unHeight;
  6019. unpacked.rubTextureMapData = this.rubTextureMapData;
  6020. unpacked.format = this.format;
  6021. }
  6022. }
  6023. [StructLayout(LayoutKind.Sequential)] public struct RenderModel_t
  6024. {
  6025. public IntPtr rVertexData; // const struct vr::RenderModel_Vertex_t *
  6026. public uint unVertexCount;
  6027. public IntPtr rIndexData; // const uint16_t *
  6028. public uint unTriangleCount;
  6029. public int diffuseTextureId;
  6030. }
  6031. // This structure is for backwards binary compatibility on Linux and OSX only
  6032. [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_t_Packed
  6033. {
  6034. public IntPtr rVertexData; // const struct vr::RenderModel_Vertex_t *
  6035. public uint unVertexCount;
  6036. public IntPtr rIndexData; // const uint16_t *
  6037. public uint unTriangleCount;
  6038. public int diffuseTextureId;
  6039. public RenderModel_t_Packed(RenderModel_t unpacked)
  6040. {
  6041. this.rVertexData = unpacked.rVertexData;
  6042. this.unVertexCount = unpacked.unVertexCount;
  6043. this.rIndexData = unpacked.rIndexData;
  6044. this.unTriangleCount = unpacked.unTriangleCount;
  6045. this.diffuseTextureId = unpacked.diffuseTextureId;
  6046. }
  6047. public void Unpack(ref RenderModel_t unpacked)
  6048. {
  6049. unpacked.rVertexData = this.rVertexData;
  6050. unpacked.unVertexCount = this.unVertexCount;
  6051. unpacked.rIndexData = this.rIndexData;
  6052. unpacked.unTriangleCount = this.unTriangleCount;
  6053. unpacked.diffuseTextureId = this.diffuseTextureId;
  6054. }
  6055. }
  6056. [StructLayout(LayoutKind.Sequential)] public struct RenderModel_ControllerMode_State_t
  6057. {
  6058. [MarshalAs(UnmanagedType.I1)]
  6059. public bool bScrollWheelVisible;
  6060. }
  6061. [StructLayout(LayoutKind.Sequential)] public struct NotificationBitmap_t
  6062. {
  6063. public IntPtr m_pImageData; // void *
  6064. public int m_nWidth;
  6065. public int m_nHeight;
  6066. public int m_nBytesPerPixel;
  6067. }
  6068. [StructLayout(LayoutKind.Sequential)] public struct CVRSettingHelper
  6069. {
  6070. public IntPtr m_pSettings; // class vr::IVRSettings *
  6071. }
  6072. [StructLayout(LayoutKind.Sequential)] public struct InputAnalogActionData_t
  6073. {
  6074. [MarshalAs(UnmanagedType.I1)]
  6075. public bool bActive;
  6076. public ulong activeOrigin;
  6077. public float x;
  6078. public float y;
  6079. public float z;
  6080. public float deltaX;
  6081. public float deltaY;
  6082. public float deltaZ;
  6083. public float fUpdateTime;
  6084. }
  6085. [StructLayout(LayoutKind.Sequential)] public struct InputDigitalActionData_t
  6086. {
  6087. [MarshalAs(UnmanagedType.I1)]
  6088. public bool bActive;
  6089. public ulong activeOrigin;
  6090. [MarshalAs(UnmanagedType.I1)]
  6091. public bool bState;
  6092. [MarshalAs(UnmanagedType.I1)]
  6093. public bool bChanged;
  6094. public float fUpdateTime;
  6095. }
  6096. [StructLayout(LayoutKind.Sequential)] public struct InputPoseActionData_t
  6097. {
  6098. [MarshalAs(UnmanagedType.I1)]
  6099. public bool bActive;
  6100. public ulong activeOrigin;
  6101. public TrackedDevicePose_t pose;
  6102. }
  6103. [StructLayout(LayoutKind.Sequential)] public struct InputSkeletalActionData_t
  6104. {
  6105. [MarshalAs(UnmanagedType.I1)]
  6106. public bool bActive;
  6107. public ulong activeOrigin;
  6108. }
  6109. [StructLayout(LayoutKind.Sequential)] public struct InputOriginInfo_t
  6110. {
  6111. public ulong devicePath;
  6112. public uint trackedDeviceIndex;
  6113. public byte rchRenderModelComponentName0,rchRenderModelComponentName1,rchRenderModelComponentName2,rchRenderModelComponentName3,rchRenderModelComponentName4,rchRenderModelComponentName5,rchRenderModelComponentName6,rchRenderModelComponentName7,rchRenderModelComponentName8,rchRenderModelComponentName9,rchRenderModelComponentName10,rchRenderModelComponentName11,rchRenderModelComponentName12,rchRenderModelComponentName13,rchRenderModelComponentName14,rchRenderModelComponentName15,rchRenderModelComponentName16,rchRenderModelComponentName17,rchRenderModelComponentName18,rchRenderModelComponentName19,rchRenderModelComponentName20,rchRenderModelComponentName21,rchRenderModelComponentName22,rchRenderModelComponentName23,rchRenderModelComponentName24,rchRenderModelComponentName25,rchRenderModelComponentName26,rchRenderModelComponentName27,rchRenderModelComponentName28,rchRenderModelComponentName29,rchRenderModelComponentName30,rchRenderModelComponentName31,rchRenderModelComponentName32,rchRenderModelComponentName33,rchRenderModelComponentName34,rchRenderModelComponentName35,rchRenderModelComponentName36,rchRenderModelComponentName37,rchRenderModelComponentName38,rchRenderModelComponentName39,rchRenderModelComponentName40,rchRenderModelComponentName41,rchRenderModelComponentName42,rchRenderModelComponentName43,rchRenderModelComponentName44,rchRenderModelComponentName45,rchRenderModelComponentName46,rchRenderModelComponentName47,rchRenderModelComponentName48,rchRenderModelComponentName49,rchRenderModelComponentName50,rchRenderModelComponentName51,rchRenderModelComponentName52,rchRenderModelComponentName53,rchRenderModelComponentName54,rchRenderModelComponentName55,rchRenderModelComponentName56,rchRenderModelComponentName57,rchRenderModelComponentName58,rchRenderModelComponentName59,rchRenderModelComponentName60,rchRenderModelComponentName61,rchRenderModelComponentName62,rchRenderModelComponentName63,rchRenderModelComponentName64,rchRenderModelComponentName65,rchRenderModelComponentName66,rchRenderModelComponentName67,rchRenderModelComponentName68,rchRenderModelComponentName69,rchRenderModelComponentName70,rchRenderModelComponentName71,rchRenderModelComponentName72,rchRenderModelComponentName73,rchRenderModelComponentName74,rchRenderModelComponentName75,rchRenderModelComponentName76,rchRenderModelComponentName77,rchRenderModelComponentName78,rchRenderModelComponentName79,rchRenderModelComponentName80,rchRenderModelComponentName81,rchRenderModelComponentName82,rchRenderModelComponentName83,rchRenderModelComponentName84,rchRenderModelComponentName85,rchRenderModelComponentName86,rchRenderModelComponentName87,rchRenderModelComponentName88,rchRenderModelComponentName89,rchRenderModelComponentName90,rchRenderModelComponentName91,rchRenderModelComponentName92,rchRenderModelComponentName93,rchRenderModelComponentName94,rchRenderModelComponentName95,rchRenderModelComponentName96,rchRenderModelComponentName97,rchRenderModelComponentName98,rchRenderModelComponentName99,rchRenderModelComponentName100,rchRenderModelComponentName101,rchRenderModelComponentName102,rchRenderModelComponentName103,rchRenderModelComponentName104,rchRenderModelComponentName105,rchRenderModelComponentName106,rchRenderModelComponentName107,rchRenderModelComponentName108,rchRenderModelComponentName109,rchRenderModelComponentName110,rchRenderModelComponentName111,rchRenderModelComponentName112,rchRenderModelComponentName113,rchRenderModelComponentName114,rchRenderModelComponentName115,rchRenderModelComponentName116,rchRenderModelComponentName117,rchRenderModelComponentName118,rchRenderModelComponentName119,rchRenderModelComponentName120,rchRenderModelComponentName121,rchRenderModelComponentName122,rchRenderModelComponentName123,rchRenderModelComponentName124,rchRenderModelComponentName125,rchRenderModelComponentName126,rchRenderModelComponentName127;
  6114. public string rchRenderModelComponentName
  6115. {
  6116. get
  6117. {
  6118. return new string(new char[] {
  6119. (char)rchRenderModelComponentName0,
  6120. (char)rchRenderModelComponentName1,
  6121. (char)rchRenderModelComponentName2,
  6122. (char)rchRenderModelComponentName3,
  6123. (char)rchRenderModelComponentName4,
  6124. (char)rchRenderModelComponentName5,
  6125. (char)rchRenderModelComponentName6,
  6126. (char)rchRenderModelComponentName7,
  6127. (char)rchRenderModelComponentName8,
  6128. (char)rchRenderModelComponentName9,
  6129. (char)rchRenderModelComponentName10,
  6130. (char)rchRenderModelComponentName11,
  6131. (char)rchRenderModelComponentName12,
  6132. (char)rchRenderModelComponentName13,
  6133. (char)rchRenderModelComponentName14,
  6134. (char)rchRenderModelComponentName15,
  6135. (char)rchRenderModelComponentName16,
  6136. (char)rchRenderModelComponentName17,
  6137. (char)rchRenderModelComponentName18,
  6138. (char)rchRenderModelComponentName19,
  6139. (char)rchRenderModelComponentName20,
  6140. (char)rchRenderModelComponentName21,
  6141. (char)rchRenderModelComponentName22,
  6142. (char)rchRenderModelComponentName23,
  6143. (char)rchRenderModelComponentName24,
  6144. (char)rchRenderModelComponentName25,
  6145. (char)rchRenderModelComponentName26,
  6146. (char)rchRenderModelComponentName27,
  6147. (char)rchRenderModelComponentName28,
  6148. (char)rchRenderModelComponentName29,
  6149. (char)rchRenderModelComponentName30,
  6150. (char)rchRenderModelComponentName31,
  6151. (char)rchRenderModelComponentName32,
  6152. (char)rchRenderModelComponentName33,
  6153. (char)rchRenderModelComponentName34,
  6154. (char)rchRenderModelComponentName35,
  6155. (char)rchRenderModelComponentName36,
  6156. (char)rchRenderModelComponentName37,
  6157. (char)rchRenderModelComponentName38,
  6158. (char)rchRenderModelComponentName39,
  6159. (char)rchRenderModelComponentName40,
  6160. (char)rchRenderModelComponentName41,
  6161. (char)rchRenderModelComponentName42,
  6162. (char)rchRenderModelComponentName43,
  6163. (char)rchRenderModelComponentName44,
  6164. (char)rchRenderModelComponentName45,
  6165. (char)rchRenderModelComponentName46,
  6166. (char)rchRenderModelComponentName47,
  6167. (char)rchRenderModelComponentName48,
  6168. (char)rchRenderModelComponentName49,
  6169. (char)rchRenderModelComponentName50,
  6170. (char)rchRenderModelComponentName51,
  6171. (char)rchRenderModelComponentName52,
  6172. (char)rchRenderModelComponentName53,
  6173. (char)rchRenderModelComponentName54,
  6174. (char)rchRenderModelComponentName55,
  6175. (char)rchRenderModelComponentName56,
  6176. (char)rchRenderModelComponentName57,
  6177. (char)rchRenderModelComponentName58,
  6178. (char)rchRenderModelComponentName59,
  6179. (char)rchRenderModelComponentName60,
  6180. (char)rchRenderModelComponentName61,
  6181. (char)rchRenderModelComponentName62,
  6182. (char)rchRenderModelComponentName63,
  6183. (char)rchRenderModelComponentName64,
  6184. (char)rchRenderModelComponentName65,
  6185. (char)rchRenderModelComponentName66,
  6186. (char)rchRenderModelComponentName67,
  6187. (char)rchRenderModelComponentName68,
  6188. (char)rchRenderModelComponentName69,
  6189. (char)rchRenderModelComponentName70,
  6190. (char)rchRenderModelComponentName71,
  6191. (char)rchRenderModelComponentName72,
  6192. (char)rchRenderModelComponentName73,
  6193. (char)rchRenderModelComponentName74,
  6194. (char)rchRenderModelComponentName75,
  6195. (char)rchRenderModelComponentName76,
  6196. (char)rchRenderModelComponentName77,
  6197. (char)rchRenderModelComponentName78,
  6198. (char)rchRenderModelComponentName79,
  6199. (char)rchRenderModelComponentName80,
  6200. (char)rchRenderModelComponentName81,
  6201. (char)rchRenderModelComponentName82,
  6202. (char)rchRenderModelComponentName83,
  6203. (char)rchRenderModelComponentName84,
  6204. (char)rchRenderModelComponentName85,
  6205. (char)rchRenderModelComponentName86,
  6206. (char)rchRenderModelComponentName87,
  6207. (char)rchRenderModelComponentName88,
  6208. (char)rchRenderModelComponentName89,
  6209. (char)rchRenderModelComponentName90,
  6210. (char)rchRenderModelComponentName91,
  6211. (char)rchRenderModelComponentName92,
  6212. (char)rchRenderModelComponentName93,
  6213. (char)rchRenderModelComponentName94,
  6214. (char)rchRenderModelComponentName95,
  6215. (char)rchRenderModelComponentName96,
  6216. (char)rchRenderModelComponentName97,
  6217. (char)rchRenderModelComponentName98,
  6218. (char)rchRenderModelComponentName99,
  6219. (char)rchRenderModelComponentName100,
  6220. (char)rchRenderModelComponentName101,
  6221. (char)rchRenderModelComponentName102,
  6222. (char)rchRenderModelComponentName103,
  6223. (char)rchRenderModelComponentName104,
  6224. (char)rchRenderModelComponentName105,
  6225. (char)rchRenderModelComponentName106,
  6226. (char)rchRenderModelComponentName107,
  6227. (char)rchRenderModelComponentName108,
  6228. (char)rchRenderModelComponentName109,
  6229. (char)rchRenderModelComponentName110,
  6230. (char)rchRenderModelComponentName111,
  6231. (char)rchRenderModelComponentName112,
  6232. (char)rchRenderModelComponentName113,
  6233. (char)rchRenderModelComponentName114,
  6234. (char)rchRenderModelComponentName115,
  6235. (char)rchRenderModelComponentName116,
  6236. (char)rchRenderModelComponentName117,
  6237. (char)rchRenderModelComponentName118,
  6238. (char)rchRenderModelComponentName119,
  6239. (char)rchRenderModelComponentName120,
  6240. (char)rchRenderModelComponentName121,
  6241. (char)rchRenderModelComponentName122,
  6242. (char)rchRenderModelComponentName123,
  6243. (char)rchRenderModelComponentName124,
  6244. (char)rchRenderModelComponentName125,
  6245. (char)rchRenderModelComponentName126,
  6246. (char)rchRenderModelComponentName127
  6247. }).TrimEnd('\0');
  6248. }
  6249. }
  6250. }
  6251. [StructLayout(LayoutKind.Sequential)] public struct InputBindingInfo_t
  6252. {
  6253. public byte rchDevicePathName0,rchDevicePathName1,rchDevicePathName2,rchDevicePathName3,rchDevicePathName4,rchDevicePathName5,rchDevicePathName6,rchDevicePathName7,rchDevicePathName8,rchDevicePathName9,rchDevicePathName10,rchDevicePathName11,rchDevicePathName12,rchDevicePathName13,rchDevicePathName14,rchDevicePathName15,rchDevicePathName16,rchDevicePathName17,rchDevicePathName18,rchDevicePathName19,rchDevicePathName20,rchDevicePathName21,rchDevicePathName22,rchDevicePathName23,rchDevicePathName24,rchDevicePathName25,rchDevicePathName26,rchDevicePathName27,rchDevicePathName28,rchDevicePathName29,rchDevicePathName30,rchDevicePathName31,rchDevicePathName32,rchDevicePathName33,rchDevicePathName34,rchDevicePathName35,rchDevicePathName36,rchDevicePathName37,rchDevicePathName38,rchDevicePathName39,rchDevicePathName40,rchDevicePathName41,rchDevicePathName42,rchDevicePathName43,rchDevicePathName44,rchDevicePathName45,rchDevicePathName46,rchDevicePathName47,rchDevicePathName48,rchDevicePathName49,rchDevicePathName50,rchDevicePathName51,rchDevicePathName52,rchDevicePathName53,rchDevicePathName54,rchDevicePathName55,rchDevicePathName56,rchDevicePathName57,rchDevicePathName58,rchDevicePathName59,rchDevicePathName60,rchDevicePathName61,rchDevicePathName62,rchDevicePathName63,rchDevicePathName64,rchDevicePathName65,rchDevicePathName66,rchDevicePathName67,rchDevicePathName68,rchDevicePathName69,rchDevicePathName70,rchDevicePathName71,rchDevicePathName72,rchDevicePathName73,rchDevicePathName74,rchDevicePathName75,rchDevicePathName76,rchDevicePathName77,rchDevicePathName78,rchDevicePathName79,rchDevicePathName80,rchDevicePathName81,rchDevicePathName82,rchDevicePathName83,rchDevicePathName84,rchDevicePathName85,rchDevicePathName86,rchDevicePathName87,rchDevicePathName88,rchDevicePathName89,rchDevicePathName90,rchDevicePathName91,rchDevicePathName92,rchDevicePathName93,rchDevicePathName94,rchDevicePathName95,rchDevicePathName96,rchDevicePathName97,rchDevicePathName98,rchDevicePathName99,rchDevicePathName100,rchDevicePathName101,rchDevicePathName102,rchDevicePathName103,rchDevicePathName104,rchDevicePathName105,rchDevicePathName106,rchDevicePathName107,rchDevicePathName108,rchDevicePathName109,rchDevicePathName110,rchDevicePathName111,rchDevicePathName112,rchDevicePathName113,rchDevicePathName114,rchDevicePathName115,rchDevicePathName116,rchDevicePathName117,rchDevicePathName118,rchDevicePathName119,rchDevicePathName120,rchDevicePathName121,rchDevicePathName122,rchDevicePathName123,rchDevicePathName124,rchDevicePathName125,rchDevicePathName126,rchDevicePathName127;
  6254. public string rchDevicePathName
  6255. {
  6256. get
  6257. {
  6258. return new string(new char[] {
  6259. (char)rchDevicePathName0,
  6260. (char)rchDevicePathName1,
  6261. (char)rchDevicePathName2,
  6262. (char)rchDevicePathName3,
  6263. (char)rchDevicePathName4,
  6264. (char)rchDevicePathName5,
  6265. (char)rchDevicePathName6,
  6266. (char)rchDevicePathName7,
  6267. (char)rchDevicePathName8,
  6268. (char)rchDevicePathName9,
  6269. (char)rchDevicePathName10,
  6270. (char)rchDevicePathName11,
  6271. (char)rchDevicePathName12,
  6272. (char)rchDevicePathName13,
  6273. (char)rchDevicePathName14,
  6274. (char)rchDevicePathName15,
  6275. (char)rchDevicePathName16,
  6276. (char)rchDevicePathName17,
  6277. (char)rchDevicePathName18,
  6278. (char)rchDevicePathName19,
  6279. (char)rchDevicePathName20,
  6280. (char)rchDevicePathName21,
  6281. (char)rchDevicePathName22,
  6282. (char)rchDevicePathName23,
  6283. (char)rchDevicePathName24,
  6284. (char)rchDevicePathName25,
  6285. (char)rchDevicePathName26,
  6286. (char)rchDevicePathName27,
  6287. (char)rchDevicePathName28,
  6288. (char)rchDevicePathName29,
  6289. (char)rchDevicePathName30,
  6290. (char)rchDevicePathName31,
  6291. (char)rchDevicePathName32,
  6292. (char)rchDevicePathName33,
  6293. (char)rchDevicePathName34,
  6294. (char)rchDevicePathName35,
  6295. (char)rchDevicePathName36,
  6296. (char)rchDevicePathName37,
  6297. (char)rchDevicePathName38,
  6298. (char)rchDevicePathName39,
  6299. (char)rchDevicePathName40,
  6300. (char)rchDevicePathName41,
  6301. (char)rchDevicePathName42,
  6302. (char)rchDevicePathName43,
  6303. (char)rchDevicePathName44,
  6304. (char)rchDevicePathName45,
  6305. (char)rchDevicePathName46,
  6306. (char)rchDevicePathName47,
  6307. (char)rchDevicePathName48,
  6308. (char)rchDevicePathName49,
  6309. (char)rchDevicePathName50,
  6310. (char)rchDevicePathName51,
  6311. (char)rchDevicePathName52,
  6312. (char)rchDevicePathName53,
  6313. (char)rchDevicePathName54,
  6314. (char)rchDevicePathName55,
  6315. (char)rchDevicePathName56,
  6316. (char)rchDevicePathName57,
  6317. (char)rchDevicePathName58,
  6318. (char)rchDevicePathName59,
  6319. (char)rchDevicePathName60,
  6320. (char)rchDevicePathName61,
  6321. (char)rchDevicePathName62,
  6322. (char)rchDevicePathName63,
  6323. (char)rchDevicePathName64,
  6324. (char)rchDevicePathName65,
  6325. (char)rchDevicePathName66,
  6326. (char)rchDevicePathName67,
  6327. (char)rchDevicePathName68,
  6328. (char)rchDevicePathName69,
  6329. (char)rchDevicePathName70,
  6330. (char)rchDevicePathName71,
  6331. (char)rchDevicePathName72,
  6332. (char)rchDevicePathName73,
  6333. (char)rchDevicePathName74,
  6334. (char)rchDevicePathName75,
  6335. (char)rchDevicePathName76,
  6336. (char)rchDevicePathName77,
  6337. (char)rchDevicePathName78,
  6338. (char)rchDevicePathName79,
  6339. (char)rchDevicePathName80,
  6340. (char)rchDevicePathName81,
  6341. (char)rchDevicePathName82,
  6342. (char)rchDevicePathName83,
  6343. (char)rchDevicePathName84,
  6344. (char)rchDevicePathName85,
  6345. (char)rchDevicePathName86,
  6346. (char)rchDevicePathName87,
  6347. (char)rchDevicePathName88,
  6348. (char)rchDevicePathName89,
  6349. (char)rchDevicePathName90,
  6350. (char)rchDevicePathName91,
  6351. (char)rchDevicePathName92,
  6352. (char)rchDevicePathName93,
  6353. (char)rchDevicePathName94,
  6354. (char)rchDevicePathName95,
  6355. (char)rchDevicePathName96,
  6356. (char)rchDevicePathName97,
  6357. (char)rchDevicePathName98,
  6358. (char)rchDevicePathName99,
  6359. (char)rchDevicePathName100,
  6360. (char)rchDevicePathName101,
  6361. (char)rchDevicePathName102,
  6362. (char)rchDevicePathName103,
  6363. (char)rchDevicePathName104,
  6364. (char)rchDevicePathName105,
  6365. (char)rchDevicePathName106,
  6366. (char)rchDevicePathName107,
  6367. (char)rchDevicePathName108,
  6368. (char)rchDevicePathName109,
  6369. (char)rchDevicePathName110,
  6370. (char)rchDevicePathName111,
  6371. (char)rchDevicePathName112,
  6372. (char)rchDevicePathName113,
  6373. (char)rchDevicePathName114,
  6374. (char)rchDevicePathName115,
  6375. (char)rchDevicePathName116,
  6376. (char)rchDevicePathName117,
  6377. (char)rchDevicePathName118,
  6378. (char)rchDevicePathName119,
  6379. (char)rchDevicePathName120,
  6380. (char)rchDevicePathName121,
  6381. (char)rchDevicePathName122,
  6382. (char)rchDevicePathName123,
  6383. (char)rchDevicePathName124,
  6384. (char)rchDevicePathName125,
  6385. (char)rchDevicePathName126,
  6386. (char)rchDevicePathName127
  6387. }).TrimEnd('\0');
  6388. }
  6389. }
  6390. public byte rchInputPathName0,rchInputPathName1,rchInputPathName2,rchInputPathName3,rchInputPathName4,rchInputPathName5,rchInputPathName6,rchInputPathName7,rchInputPathName8,rchInputPathName9,rchInputPathName10,rchInputPathName11,rchInputPathName12,rchInputPathName13,rchInputPathName14,rchInputPathName15,rchInputPathName16,rchInputPathName17,rchInputPathName18,rchInputPathName19,rchInputPathName20,rchInputPathName21,rchInputPathName22,rchInputPathName23,rchInputPathName24,rchInputPathName25,rchInputPathName26,rchInputPathName27,rchInputPathName28,rchInputPathName29,rchInputPathName30,rchInputPathName31,rchInputPathName32,rchInputPathName33,rchInputPathName34,rchInputPathName35,rchInputPathName36,rchInputPathName37,rchInputPathName38,rchInputPathName39,rchInputPathName40,rchInputPathName41,rchInputPathName42,rchInputPathName43,rchInputPathName44,rchInputPathName45,rchInputPathName46,rchInputPathName47,rchInputPathName48,rchInputPathName49,rchInputPathName50,rchInputPathName51,rchInputPathName52,rchInputPathName53,rchInputPathName54,rchInputPathName55,rchInputPathName56,rchInputPathName57,rchInputPathName58,rchInputPathName59,rchInputPathName60,rchInputPathName61,rchInputPathName62,rchInputPathName63,rchInputPathName64,rchInputPathName65,rchInputPathName66,rchInputPathName67,rchInputPathName68,rchInputPathName69,rchInputPathName70,rchInputPathName71,rchInputPathName72,rchInputPathName73,rchInputPathName74,rchInputPathName75,rchInputPathName76,rchInputPathName77,rchInputPathName78,rchInputPathName79,rchInputPathName80,rchInputPathName81,rchInputPathName82,rchInputPathName83,rchInputPathName84,rchInputPathName85,rchInputPathName86,rchInputPathName87,rchInputPathName88,rchInputPathName89,rchInputPathName90,rchInputPathName91,rchInputPathName92,rchInputPathName93,rchInputPathName94,rchInputPathName95,rchInputPathName96,rchInputPathName97,rchInputPathName98,rchInputPathName99,rchInputPathName100,rchInputPathName101,rchInputPathName102,rchInputPathName103,rchInputPathName104,rchInputPathName105,rchInputPathName106,rchInputPathName107,rchInputPathName108,rchInputPathName109,rchInputPathName110,rchInputPathName111,rchInputPathName112,rchInputPathName113,rchInputPathName114,rchInputPathName115,rchInputPathName116,rchInputPathName117,rchInputPathName118,rchInputPathName119,rchInputPathName120,rchInputPathName121,rchInputPathName122,rchInputPathName123,rchInputPathName124,rchInputPathName125,rchInputPathName126,rchInputPathName127;
  6391. public string rchInputPathName
  6392. {
  6393. get
  6394. {
  6395. return new string(new char[] {
  6396. (char)rchInputPathName0,
  6397. (char)rchInputPathName1,
  6398. (char)rchInputPathName2,
  6399. (char)rchInputPathName3,
  6400. (char)rchInputPathName4,
  6401. (char)rchInputPathName5,
  6402. (char)rchInputPathName6,
  6403. (char)rchInputPathName7,
  6404. (char)rchInputPathName8,
  6405. (char)rchInputPathName9,
  6406. (char)rchInputPathName10,
  6407. (char)rchInputPathName11,
  6408. (char)rchInputPathName12,
  6409. (char)rchInputPathName13,
  6410. (char)rchInputPathName14,
  6411. (char)rchInputPathName15,
  6412. (char)rchInputPathName16,
  6413. (char)rchInputPathName17,
  6414. (char)rchInputPathName18,
  6415. (char)rchInputPathName19,
  6416. (char)rchInputPathName20,
  6417. (char)rchInputPathName21,
  6418. (char)rchInputPathName22,
  6419. (char)rchInputPathName23,
  6420. (char)rchInputPathName24,
  6421. (char)rchInputPathName25,
  6422. (char)rchInputPathName26,
  6423. (char)rchInputPathName27,
  6424. (char)rchInputPathName28,
  6425. (char)rchInputPathName29,
  6426. (char)rchInputPathName30,
  6427. (char)rchInputPathName31,
  6428. (char)rchInputPathName32,
  6429. (char)rchInputPathName33,
  6430. (char)rchInputPathName34,
  6431. (char)rchInputPathName35,
  6432. (char)rchInputPathName36,
  6433. (char)rchInputPathName37,
  6434. (char)rchInputPathName38,
  6435. (char)rchInputPathName39,
  6436. (char)rchInputPathName40,
  6437. (char)rchInputPathName41,
  6438. (char)rchInputPathName42,
  6439. (char)rchInputPathName43,
  6440. (char)rchInputPathName44,
  6441. (char)rchInputPathName45,
  6442. (char)rchInputPathName46,
  6443. (char)rchInputPathName47,
  6444. (char)rchInputPathName48,
  6445. (char)rchInputPathName49,
  6446. (char)rchInputPathName50,
  6447. (char)rchInputPathName51,
  6448. (char)rchInputPathName52,
  6449. (char)rchInputPathName53,
  6450. (char)rchInputPathName54,
  6451. (char)rchInputPathName55,
  6452. (char)rchInputPathName56,
  6453. (char)rchInputPathName57,
  6454. (char)rchInputPathName58,
  6455. (char)rchInputPathName59,
  6456. (char)rchInputPathName60,
  6457. (char)rchInputPathName61,
  6458. (char)rchInputPathName62,
  6459. (char)rchInputPathName63,
  6460. (char)rchInputPathName64,
  6461. (char)rchInputPathName65,
  6462. (char)rchInputPathName66,
  6463. (char)rchInputPathName67,
  6464. (char)rchInputPathName68,
  6465. (char)rchInputPathName69,
  6466. (char)rchInputPathName70,
  6467. (char)rchInputPathName71,
  6468. (char)rchInputPathName72,
  6469. (char)rchInputPathName73,
  6470. (char)rchInputPathName74,
  6471. (char)rchInputPathName75,
  6472. (char)rchInputPathName76,
  6473. (char)rchInputPathName77,
  6474. (char)rchInputPathName78,
  6475. (char)rchInputPathName79,
  6476. (char)rchInputPathName80,
  6477. (char)rchInputPathName81,
  6478. (char)rchInputPathName82,
  6479. (char)rchInputPathName83,
  6480. (char)rchInputPathName84,
  6481. (char)rchInputPathName85,
  6482. (char)rchInputPathName86,
  6483. (char)rchInputPathName87,
  6484. (char)rchInputPathName88,
  6485. (char)rchInputPathName89,
  6486. (char)rchInputPathName90,
  6487. (char)rchInputPathName91,
  6488. (char)rchInputPathName92,
  6489. (char)rchInputPathName93,
  6490. (char)rchInputPathName94,
  6491. (char)rchInputPathName95,
  6492. (char)rchInputPathName96,
  6493. (char)rchInputPathName97,
  6494. (char)rchInputPathName98,
  6495. (char)rchInputPathName99,
  6496. (char)rchInputPathName100,
  6497. (char)rchInputPathName101,
  6498. (char)rchInputPathName102,
  6499. (char)rchInputPathName103,
  6500. (char)rchInputPathName104,
  6501. (char)rchInputPathName105,
  6502. (char)rchInputPathName106,
  6503. (char)rchInputPathName107,
  6504. (char)rchInputPathName108,
  6505. (char)rchInputPathName109,
  6506. (char)rchInputPathName110,
  6507. (char)rchInputPathName111,
  6508. (char)rchInputPathName112,
  6509. (char)rchInputPathName113,
  6510. (char)rchInputPathName114,
  6511. (char)rchInputPathName115,
  6512. (char)rchInputPathName116,
  6513. (char)rchInputPathName117,
  6514. (char)rchInputPathName118,
  6515. (char)rchInputPathName119,
  6516. (char)rchInputPathName120,
  6517. (char)rchInputPathName121,
  6518. (char)rchInputPathName122,
  6519. (char)rchInputPathName123,
  6520. (char)rchInputPathName124,
  6521. (char)rchInputPathName125,
  6522. (char)rchInputPathName126,
  6523. (char)rchInputPathName127
  6524. }).TrimEnd('\0');
  6525. }
  6526. }
  6527. public byte rchModeName0,rchModeName1,rchModeName2,rchModeName3,rchModeName4,rchModeName5,rchModeName6,rchModeName7,rchModeName8,rchModeName9,rchModeName10,rchModeName11,rchModeName12,rchModeName13,rchModeName14,rchModeName15,rchModeName16,rchModeName17,rchModeName18,rchModeName19,rchModeName20,rchModeName21,rchModeName22,rchModeName23,rchModeName24,rchModeName25,rchModeName26,rchModeName27,rchModeName28,rchModeName29,rchModeName30,rchModeName31,rchModeName32,rchModeName33,rchModeName34,rchModeName35,rchModeName36,rchModeName37,rchModeName38,rchModeName39,rchModeName40,rchModeName41,rchModeName42,rchModeName43,rchModeName44,rchModeName45,rchModeName46,rchModeName47,rchModeName48,rchModeName49,rchModeName50,rchModeName51,rchModeName52,rchModeName53,rchModeName54,rchModeName55,rchModeName56,rchModeName57,rchModeName58,rchModeName59,rchModeName60,rchModeName61,rchModeName62,rchModeName63,rchModeName64,rchModeName65,rchModeName66,rchModeName67,rchModeName68,rchModeName69,rchModeName70,rchModeName71,rchModeName72,rchModeName73,rchModeName74,rchModeName75,rchModeName76,rchModeName77,rchModeName78,rchModeName79,rchModeName80,rchModeName81,rchModeName82,rchModeName83,rchModeName84,rchModeName85,rchModeName86,rchModeName87,rchModeName88,rchModeName89,rchModeName90,rchModeName91,rchModeName92,rchModeName93,rchModeName94,rchModeName95,rchModeName96,rchModeName97,rchModeName98,rchModeName99,rchModeName100,rchModeName101,rchModeName102,rchModeName103,rchModeName104,rchModeName105,rchModeName106,rchModeName107,rchModeName108,rchModeName109,rchModeName110,rchModeName111,rchModeName112,rchModeName113,rchModeName114,rchModeName115,rchModeName116,rchModeName117,rchModeName118,rchModeName119,rchModeName120,rchModeName121,rchModeName122,rchModeName123,rchModeName124,rchModeName125,rchModeName126,rchModeName127;
  6528. public string rchModeName
  6529. {
  6530. get
  6531. {
  6532. return new string(new char[] {
  6533. (char)rchModeName0,
  6534. (char)rchModeName1,
  6535. (char)rchModeName2,
  6536. (char)rchModeName3,
  6537. (char)rchModeName4,
  6538. (char)rchModeName5,
  6539. (char)rchModeName6,
  6540. (char)rchModeName7,
  6541. (char)rchModeName8,
  6542. (char)rchModeName9,
  6543. (char)rchModeName10,
  6544. (char)rchModeName11,
  6545. (char)rchModeName12,
  6546. (char)rchModeName13,
  6547. (char)rchModeName14,
  6548. (char)rchModeName15,
  6549. (char)rchModeName16,
  6550. (char)rchModeName17,
  6551. (char)rchModeName18,
  6552. (char)rchModeName19,
  6553. (char)rchModeName20,
  6554. (char)rchModeName21,
  6555. (char)rchModeName22,
  6556. (char)rchModeName23,
  6557. (char)rchModeName24,
  6558. (char)rchModeName25,
  6559. (char)rchModeName26,
  6560. (char)rchModeName27,
  6561. (char)rchModeName28,
  6562. (char)rchModeName29,
  6563. (char)rchModeName30,
  6564. (char)rchModeName31,
  6565. (char)rchModeName32,
  6566. (char)rchModeName33,
  6567. (char)rchModeName34,
  6568. (char)rchModeName35,
  6569. (char)rchModeName36,
  6570. (char)rchModeName37,
  6571. (char)rchModeName38,
  6572. (char)rchModeName39,
  6573. (char)rchModeName40,
  6574. (char)rchModeName41,
  6575. (char)rchModeName42,
  6576. (char)rchModeName43,
  6577. (char)rchModeName44,
  6578. (char)rchModeName45,
  6579. (char)rchModeName46,
  6580. (char)rchModeName47,
  6581. (char)rchModeName48,
  6582. (char)rchModeName49,
  6583. (char)rchModeName50,
  6584. (char)rchModeName51,
  6585. (char)rchModeName52,
  6586. (char)rchModeName53,
  6587. (char)rchModeName54,
  6588. (char)rchModeName55,
  6589. (char)rchModeName56,
  6590. (char)rchModeName57,
  6591. (char)rchModeName58,
  6592. (char)rchModeName59,
  6593. (char)rchModeName60,
  6594. (char)rchModeName61,
  6595. (char)rchModeName62,
  6596. (char)rchModeName63,
  6597. (char)rchModeName64,
  6598. (char)rchModeName65,
  6599. (char)rchModeName66,
  6600. (char)rchModeName67,
  6601. (char)rchModeName68,
  6602. (char)rchModeName69,
  6603. (char)rchModeName70,
  6604. (char)rchModeName71,
  6605. (char)rchModeName72,
  6606. (char)rchModeName73,
  6607. (char)rchModeName74,
  6608. (char)rchModeName75,
  6609. (char)rchModeName76,
  6610. (char)rchModeName77,
  6611. (char)rchModeName78,
  6612. (char)rchModeName79,
  6613. (char)rchModeName80,
  6614. (char)rchModeName81,
  6615. (char)rchModeName82,
  6616. (char)rchModeName83,
  6617. (char)rchModeName84,
  6618. (char)rchModeName85,
  6619. (char)rchModeName86,
  6620. (char)rchModeName87,
  6621. (char)rchModeName88,
  6622. (char)rchModeName89,
  6623. (char)rchModeName90,
  6624. (char)rchModeName91,
  6625. (char)rchModeName92,
  6626. (char)rchModeName93,
  6627. (char)rchModeName94,
  6628. (char)rchModeName95,
  6629. (char)rchModeName96,
  6630. (char)rchModeName97,
  6631. (char)rchModeName98,
  6632. (char)rchModeName99,
  6633. (char)rchModeName100,
  6634. (char)rchModeName101,
  6635. (char)rchModeName102,
  6636. (char)rchModeName103,
  6637. (char)rchModeName104,
  6638. (char)rchModeName105,
  6639. (char)rchModeName106,
  6640. (char)rchModeName107,
  6641. (char)rchModeName108,
  6642. (char)rchModeName109,
  6643. (char)rchModeName110,
  6644. (char)rchModeName111,
  6645. (char)rchModeName112,
  6646. (char)rchModeName113,
  6647. (char)rchModeName114,
  6648. (char)rchModeName115,
  6649. (char)rchModeName116,
  6650. (char)rchModeName117,
  6651. (char)rchModeName118,
  6652. (char)rchModeName119,
  6653. (char)rchModeName120,
  6654. (char)rchModeName121,
  6655. (char)rchModeName122,
  6656. (char)rchModeName123,
  6657. (char)rchModeName124,
  6658. (char)rchModeName125,
  6659. (char)rchModeName126,
  6660. (char)rchModeName127
  6661. }).TrimEnd('\0');
  6662. }
  6663. }
  6664. public byte rchSlotName0,rchSlotName1,rchSlotName2,rchSlotName3,rchSlotName4,rchSlotName5,rchSlotName6,rchSlotName7,rchSlotName8,rchSlotName9,rchSlotName10,rchSlotName11,rchSlotName12,rchSlotName13,rchSlotName14,rchSlotName15,rchSlotName16,rchSlotName17,rchSlotName18,rchSlotName19,rchSlotName20,rchSlotName21,rchSlotName22,rchSlotName23,rchSlotName24,rchSlotName25,rchSlotName26,rchSlotName27,rchSlotName28,rchSlotName29,rchSlotName30,rchSlotName31,rchSlotName32,rchSlotName33,rchSlotName34,rchSlotName35,rchSlotName36,rchSlotName37,rchSlotName38,rchSlotName39,rchSlotName40,rchSlotName41,rchSlotName42,rchSlotName43,rchSlotName44,rchSlotName45,rchSlotName46,rchSlotName47,rchSlotName48,rchSlotName49,rchSlotName50,rchSlotName51,rchSlotName52,rchSlotName53,rchSlotName54,rchSlotName55,rchSlotName56,rchSlotName57,rchSlotName58,rchSlotName59,rchSlotName60,rchSlotName61,rchSlotName62,rchSlotName63,rchSlotName64,rchSlotName65,rchSlotName66,rchSlotName67,rchSlotName68,rchSlotName69,rchSlotName70,rchSlotName71,rchSlotName72,rchSlotName73,rchSlotName74,rchSlotName75,rchSlotName76,rchSlotName77,rchSlotName78,rchSlotName79,rchSlotName80,rchSlotName81,rchSlotName82,rchSlotName83,rchSlotName84,rchSlotName85,rchSlotName86,rchSlotName87,rchSlotName88,rchSlotName89,rchSlotName90,rchSlotName91,rchSlotName92,rchSlotName93,rchSlotName94,rchSlotName95,rchSlotName96,rchSlotName97,rchSlotName98,rchSlotName99,rchSlotName100,rchSlotName101,rchSlotName102,rchSlotName103,rchSlotName104,rchSlotName105,rchSlotName106,rchSlotName107,rchSlotName108,rchSlotName109,rchSlotName110,rchSlotName111,rchSlotName112,rchSlotName113,rchSlotName114,rchSlotName115,rchSlotName116,rchSlotName117,rchSlotName118,rchSlotName119,rchSlotName120,rchSlotName121,rchSlotName122,rchSlotName123,rchSlotName124,rchSlotName125,rchSlotName126,rchSlotName127;
  6665. public string rchSlotName
  6666. {
  6667. get
  6668. {
  6669. return new string(new char[] {
  6670. (char)rchSlotName0,
  6671. (char)rchSlotName1,
  6672. (char)rchSlotName2,
  6673. (char)rchSlotName3,
  6674. (char)rchSlotName4,
  6675. (char)rchSlotName5,
  6676. (char)rchSlotName6,
  6677. (char)rchSlotName7,
  6678. (char)rchSlotName8,
  6679. (char)rchSlotName9,
  6680. (char)rchSlotName10,
  6681. (char)rchSlotName11,
  6682. (char)rchSlotName12,
  6683. (char)rchSlotName13,
  6684. (char)rchSlotName14,
  6685. (char)rchSlotName15,
  6686. (char)rchSlotName16,
  6687. (char)rchSlotName17,
  6688. (char)rchSlotName18,
  6689. (char)rchSlotName19,
  6690. (char)rchSlotName20,
  6691. (char)rchSlotName21,
  6692. (char)rchSlotName22,
  6693. (char)rchSlotName23,
  6694. (char)rchSlotName24,
  6695. (char)rchSlotName25,
  6696. (char)rchSlotName26,
  6697. (char)rchSlotName27,
  6698. (char)rchSlotName28,
  6699. (char)rchSlotName29,
  6700. (char)rchSlotName30,
  6701. (char)rchSlotName31,
  6702. (char)rchSlotName32,
  6703. (char)rchSlotName33,
  6704. (char)rchSlotName34,
  6705. (char)rchSlotName35,
  6706. (char)rchSlotName36,
  6707. (char)rchSlotName37,
  6708. (char)rchSlotName38,
  6709. (char)rchSlotName39,
  6710. (char)rchSlotName40,
  6711. (char)rchSlotName41,
  6712. (char)rchSlotName42,
  6713. (char)rchSlotName43,
  6714. (char)rchSlotName44,
  6715. (char)rchSlotName45,
  6716. (char)rchSlotName46,
  6717. (char)rchSlotName47,
  6718. (char)rchSlotName48,
  6719. (char)rchSlotName49,
  6720. (char)rchSlotName50,
  6721. (char)rchSlotName51,
  6722. (char)rchSlotName52,
  6723. (char)rchSlotName53,
  6724. (char)rchSlotName54,
  6725. (char)rchSlotName55,
  6726. (char)rchSlotName56,
  6727. (char)rchSlotName57,
  6728. (char)rchSlotName58,
  6729. (char)rchSlotName59,
  6730. (char)rchSlotName60,
  6731. (char)rchSlotName61,
  6732. (char)rchSlotName62,
  6733. (char)rchSlotName63,
  6734. (char)rchSlotName64,
  6735. (char)rchSlotName65,
  6736. (char)rchSlotName66,
  6737. (char)rchSlotName67,
  6738. (char)rchSlotName68,
  6739. (char)rchSlotName69,
  6740. (char)rchSlotName70,
  6741. (char)rchSlotName71,
  6742. (char)rchSlotName72,
  6743. (char)rchSlotName73,
  6744. (char)rchSlotName74,
  6745. (char)rchSlotName75,
  6746. (char)rchSlotName76,
  6747. (char)rchSlotName77,
  6748. (char)rchSlotName78,
  6749. (char)rchSlotName79,
  6750. (char)rchSlotName80,
  6751. (char)rchSlotName81,
  6752. (char)rchSlotName82,
  6753. (char)rchSlotName83,
  6754. (char)rchSlotName84,
  6755. (char)rchSlotName85,
  6756. (char)rchSlotName86,
  6757. (char)rchSlotName87,
  6758. (char)rchSlotName88,
  6759. (char)rchSlotName89,
  6760. (char)rchSlotName90,
  6761. (char)rchSlotName91,
  6762. (char)rchSlotName92,
  6763. (char)rchSlotName93,
  6764. (char)rchSlotName94,
  6765. (char)rchSlotName95,
  6766. (char)rchSlotName96,
  6767. (char)rchSlotName97,
  6768. (char)rchSlotName98,
  6769. (char)rchSlotName99,
  6770. (char)rchSlotName100,
  6771. (char)rchSlotName101,
  6772. (char)rchSlotName102,
  6773. (char)rchSlotName103,
  6774. (char)rchSlotName104,
  6775. (char)rchSlotName105,
  6776. (char)rchSlotName106,
  6777. (char)rchSlotName107,
  6778. (char)rchSlotName108,
  6779. (char)rchSlotName109,
  6780. (char)rchSlotName110,
  6781. (char)rchSlotName111,
  6782. (char)rchSlotName112,
  6783. (char)rchSlotName113,
  6784. (char)rchSlotName114,
  6785. (char)rchSlotName115,
  6786. (char)rchSlotName116,
  6787. (char)rchSlotName117,
  6788. (char)rchSlotName118,
  6789. (char)rchSlotName119,
  6790. (char)rchSlotName120,
  6791. (char)rchSlotName121,
  6792. (char)rchSlotName122,
  6793. (char)rchSlotName123,
  6794. (char)rchSlotName124,
  6795. (char)rchSlotName125,
  6796. (char)rchSlotName126,
  6797. (char)rchSlotName127
  6798. }).TrimEnd('\0');
  6799. }
  6800. }
  6801. public byte rchInputSourceType0,rchInputSourceType1,rchInputSourceType2,rchInputSourceType3,rchInputSourceType4,rchInputSourceType5,rchInputSourceType6,rchInputSourceType7,rchInputSourceType8,rchInputSourceType9,rchInputSourceType10,rchInputSourceType11,rchInputSourceType12,rchInputSourceType13,rchInputSourceType14,rchInputSourceType15,rchInputSourceType16,rchInputSourceType17,rchInputSourceType18,rchInputSourceType19,rchInputSourceType20,rchInputSourceType21,rchInputSourceType22,rchInputSourceType23,rchInputSourceType24,rchInputSourceType25,rchInputSourceType26,rchInputSourceType27,rchInputSourceType28,rchInputSourceType29,rchInputSourceType30,rchInputSourceType31;
  6802. public string rchInputSourceType
  6803. {
  6804. get
  6805. {
  6806. return new string(new char[] {
  6807. (char)rchInputSourceType0,
  6808. (char)rchInputSourceType1,
  6809. (char)rchInputSourceType2,
  6810. (char)rchInputSourceType3,
  6811. (char)rchInputSourceType4,
  6812. (char)rchInputSourceType5,
  6813. (char)rchInputSourceType6,
  6814. (char)rchInputSourceType7,
  6815. (char)rchInputSourceType8,
  6816. (char)rchInputSourceType9,
  6817. (char)rchInputSourceType10,
  6818. (char)rchInputSourceType11,
  6819. (char)rchInputSourceType12,
  6820. (char)rchInputSourceType13,
  6821. (char)rchInputSourceType14,
  6822. (char)rchInputSourceType15,
  6823. (char)rchInputSourceType16,
  6824. (char)rchInputSourceType17,
  6825. (char)rchInputSourceType18,
  6826. (char)rchInputSourceType19,
  6827. (char)rchInputSourceType20,
  6828. (char)rchInputSourceType21,
  6829. (char)rchInputSourceType22,
  6830. (char)rchInputSourceType23,
  6831. (char)rchInputSourceType24,
  6832. (char)rchInputSourceType25,
  6833. (char)rchInputSourceType26,
  6834. (char)rchInputSourceType27,
  6835. (char)rchInputSourceType28,
  6836. (char)rchInputSourceType29,
  6837. (char)rchInputSourceType30,
  6838. (char)rchInputSourceType31
  6839. }).TrimEnd('\0');
  6840. }
  6841. }
  6842. }
  6843. [StructLayout(LayoutKind.Sequential)] public struct VRActiveActionSet_t
  6844. {
  6845. public ulong ulActionSet;
  6846. public ulong ulRestrictedToDevice;
  6847. public ulong ulSecondaryActionSet;
  6848. public uint unPadding;
  6849. public int nPriority;
  6850. }
  6851. [StructLayout(LayoutKind.Sequential)] public struct VRSkeletalSummaryData_t
  6852. {
  6853. public float flFingerCurl0; //float[5]
  6854. public float flFingerCurl1;
  6855. public float flFingerCurl2;
  6856. public float flFingerCurl3;
  6857. public float flFingerCurl4;
  6858. public float flFingerSplay0; //float[4]
  6859. public float flFingerSplay1;
  6860. public float flFingerSplay2;
  6861. public float flFingerSplay3;
  6862. }
  6863. [StructLayout(LayoutKind.Sequential)] public struct SpatialAnchorPose_t
  6864. {
  6865. public HmdMatrix34_t mAnchorToAbsoluteTracking;
  6866. }
  6867. [StructLayout(LayoutKind.Sequential)] public struct COpenVRContext
  6868. {
  6869. public IntPtr m_pVRSystem; // class vr::IVRSystem *
  6870. public IntPtr m_pVRChaperone; // class vr::IVRChaperone *
  6871. public IntPtr m_pVRChaperoneSetup; // class vr::IVRChaperoneSetup *
  6872. public IntPtr m_pVRCompositor; // class vr::IVRCompositor *
  6873. public IntPtr m_pVRHeadsetView; // class vr::IVRHeadsetView *
  6874. public IntPtr m_pVROverlay; // class vr::IVROverlay *
  6875. public IntPtr m_pVROverlayView; // class vr::IVROverlayView *
  6876. public IntPtr m_pVRResources; // class vr::IVRResources *
  6877. public IntPtr m_pVRRenderModels; // class vr::IVRRenderModels *
  6878. public IntPtr m_pVRExtendedDisplay; // class vr::IVRExtendedDisplay *
  6879. public IntPtr m_pVRSettings; // class vr::IVRSettings *
  6880. public IntPtr m_pVRApplications; // class vr::IVRApplications *
  6881. public IntPtr m_pVRTrackedCamera; // class vr::IVRTrackedCamera *
  6882. public IntPtr m_pVRScreenshots; // class vr::IVRScreenshots *
  6883. public IntPtr m_pVRDriverManager; // class vr::IVRDriverManager *
  6884. public IntPtr m_pVRInput; // class vr::IVRInput *
  6885. public IntPtr m_pVRIOBuffer; // class vr::IVRIOBuffer *
  6886. public IntPtr m_pVRSpatialAnchors; // class vr::IVRSpatialAnchors *
  6887. public IntPtr m_pVRDebug; // class vr::IVRDebug *
  6888. public IntPtr m_pVRNotifications; // class vr::IVRNotifications *
  6889. }
  6890. [StructLayout(LayoutKind.Sequential)] public struct PropertyWrite_t
  6891. {
  6892. public ETrackedDeviceProperty prop;
  6893. public EPropertyWriteType writeType;
  6894. public ETrackedPropertyError eSetError;
  6895. public IntPtr pvBuffer; // void *
  6896. public uint unBufferSize;
  6897. public uint unTag;
  6898. public ETrackedPropertyError eError;
  6899. }
  6900. [StructLayout(LayoutKind.Sequential)] public struct PropertyRead_t
  6901. {
  6902. public ETrackedDeviceProperty prop;
  6903. public IntPtr pvBuffer; // void *
  6904. public uint unBufferSize;
  6905. public uint unTag;
  6906. public uint unRequiredBufferSize;
  6907. public ETrackedPropertyError eError;
  6908. }
  6909. [StructLayout(LayoutKind.Sequential)] public struct CVRPropertyHelpers
  6910. {
  6911. public IntPtr m_pProperties; // class vr::IVRProperties *
  6912. }
  6913. [StructLayout(LayoutKind.Sequential)] public struct PathWrite_t
  6914. {
  6915. public ulong ulPath;
  6916. public EPropertyWriteType writeType;
  6917. public ETrackedPropertyError eSetError;
  6918. public IntPtr pvBuffer; // void *
  6919. public uint unBufferSize;
  6920. public uint unTag;
  6921. public ETrackedPropertyError eError;
  6922. public IntPtr pszPath; // const char *
  6923. }
  6924. [StructLayout(LayoutKind.Sequential)] public struct PathRead_t
  6925. {
  6926. public ulong ulPath;
  6927. public IntPtr pvBuffer; // void *
  6928. public uint unBufferSize;
  6929. public uint unTag;
  6930. public uint unRequiredBufferSize;
  6931. public ETrackedPropertyError eError;
  6932. public IntPtr pszPath; // const char *
  6933. }
  6934. public class OpenVR
  6935. {
  6936. public static uint InitInternal(ref EVRInitError peError, EVRApplicationType eApplicationType)
  6937. {
  6938. return OpenVRInterop.InitInternal(ref peError, eApplicationType);
  6939. }
  6940. public static uint InitInternal2(ref EVRInitError peError, EVRApplicationType eApplicationType, string pchStartupInfo)
  6941. {
  6942. return OpenVRInterop.InitInternal2(ref peError, eApplicationType, pchStartupInfo);
  6943. }
  6944. public static void ShutdownInternal()
  6945. {
  6946. OpenVRInterop.ShutdownInternal();
  6947. }
  6948. public static bool IsHmdPresent()
  6949. {
  6950. return OpenVRInterop.IsHmdPresent();
  6951. }
  6952. public static bool IsRuntimeInstalled()
  6953. {
  6954. return OpenVRInterop.IsRuntimeInstalled();
  6955. }
  6956. public static string RuntimePath()
  6957. {
  6958. try
  6959. {
  6960. uint pathSize = 512;
  6961. uint requiredPathSize = 512;
  6962. System.Text.StringBuilder path = new System.Text.StringBuilder((int)pathSize);
  6963. bool success = OpenVRInterop.GetRuntimePath(path, pathSize, ref requiredPathSize);
  6964. if (success == false)
  6965. {
  6966. return null;
  6967. }
  6968. return path.ToString();
  6969. } catch
  6970. {
  6971. return OpenVRInterop.RuntimePath(); //this api is deprecated but here to support older unity versions
  6972. }
  6973. }
  6974. public static string GetStringForHmdError(EVRInitError error)
  6975. {
  6976. return Marshal.PtrToStringAnsi(OpenVRInterop.GetStringForHmdError(error));
  6977. }
  6978. public static IntPtr GetGenericInterface(string pchInterfaceVersion, ref EVRInitError peError)
  6979. {
  6980. return OpenVRInterop.GetGenericInterface(pchInterfaceVersion, ref peError);
  6981. }
  6982. public static bool IsInterfaceVersionValid(string pchInterfaceVersion)
  6983. {
  6984. return OpenVRInterop.IsInterfaceVersionValid(pchInterfaceVersion);
  6985. }
  6986. public static uint GetInitToken()
  6987. {
  6988. return OpenVRInterop.GetInitToken();
  6989. }
  6990. public const ulong k_ulSharedTextureIsNTHandle = 4294967296;
  6991. public const uint k_nDriverNone = 4294967295;
  6992. public const uint k_unMaxDriverDebugResponseSize = 32768;
  6993. public const uint k_unTrackedDeviceIndex_Hmd = 0;
  6994. public const uint k_unMaxTrackedDeviceCount = 64;
  6995. public const uint k_unTrackedDeviceIndexOther = 4294967294;
  6996. public const uint k_unTrackedDeviceIndexInvalid = 4294967295;
  6997. public const ulong k_ulInvalidPropertyContainer = 0;
  6998. public const uint k_unInvalidPropertyTag = 0;
  6999. public const ulong k_ulInvalidDriverHandle = 0;
  7000. public const uint k_unFloatPropertyTag = 1;
  7001. public const uint k_unInt32PropertyTag = 2;
  7002. public const uint k_unUint64PropertyTag = 3;
  7003. public const uint k_unBoolPropertyTag = 4;
  7004. public const uint k_unStringPropertyTag = 5;
  7005. public const uint k_unErrorPropertyTag = 6;
  7006. public const uint k_unDoublePropertyTag = 7;
  7007. public const uint k_unHmdMatrix34PropertyTag = 20;
  7008. public const uint k_unHmdMatrix44PropertyTag = 21;
  7009. public const uint k_unHmdVector3PropertyTag = 22;
  7010. public const uint k_unHmdVector4PropertyTag = 23;
  7011. public const uint k_unHmdVector2PropertyTag = 24;
  7012. public const uint k_unHmdQuadPropertyTag = 25;
  7013. public const uint k_unHiddenAreaPropertyTag = 30;
  7014. public const uint k_unPathHandleInfoTag = 31;
  7015. public const uint k_unActionPropertyTag = 32;
  7016. public const uint k_unInputValuePropertyTag = 33;
  7017. public const uint k_unWildcardPropertyTag = 34;
  7018. public const uint k_unHapticVibrationPropertyTag = 35;
  7019. public const uint k_unSkeletonPropertyTag = 36;
  7020. public const uint k_unSpatialAnchorPosePropertyTag = 40;
  7021. public const uint k_unJsonPropertyTag = 41;
  7022. public const uint k_unActiveActionSetPropertyTag = 42;
  7023. public const uint k_unOpenVRInternalReserved_Start = 1000;
  7024. public const uint k_unOpenVRInternalReserved_End = 10000;
  7025. public const uint k_unMaxPropertyStringSize = 32768;
  7026. public const ulong k_ulInvalidActionHandle = 0;
  7027. public const ulong k_ulInvalidActionSetHandle = 0;
  7028. public const ulong k_ulInvalidInputValueHandle = 0;
  7029. public const uint k_unControllerStateAxisCount = 5;
  7030. public const ulong k_ulOverlayHandleInvalid = 0;
  7031. public const uint k_unMaxDistortionFunctionParameters = 8;
  7032. public const uint k_unScreenshotHandleInvalid = 0;
  7033. public const string IVRSystem_Version = "IVRSystem_022";
  7034. public const string IVRExtendedDisplay_Version = "IVRExtendedDisplay_001";
  7035. public const string IVRTrackedCamera_Version = "IVRTrackedCamera_006";
  7036. public const uint k_unMaxApplicationKeyLength = 128;
  7037. public const string k_pch_MimeType_HomeApp = "vr/home";
  7038. public const string k_pch_MimeType_GameTheater = "vr/game_theater";
  7039. public const string IVRApplications_Version = "IVRApplications_007";
  7040. public const string IVRChaperone_Version = "IVRChaperone_004";
  7041. public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_006";
  7042. public const string IVRCompositor_Version = "IVRCompositor_026";
  7043. public const uint k_unVROverlayMaxKeyLength = 128;
  7044. public const uint k_unVROverlayMaxNameLength = 128;
  7045. public const uint k_unMaxOverlayCount = 128;
  7046. public const uint k_unMaxOverlayIntersectionMaskPrimitivesCount = 32;
  7047. public const string IVROverlay_Version = "IVROverlay_024";
  7048. public const string IVROverlayView_Version = "IVROverlayView_003";
  7049. public const uint k_unHeadsetViewMaxWidth = 3840;
  7050. public const uint k_unHeadsetViewMaxHeight = 2160;
  7051. public const string k_pchHeadsetViewOverlayKey = "system.HeadsetView";
  7052. public const string IVRHeadsetView_Version = "IVRHeadsetView_001";
  7053. public const string k_pch_Controller_Component_GDC2015 = "gdc2015";
  7054. public const string k_pch_Controller_Component_Base = "base";
  7055. public const string k_pch_Controller_Component_Tip = "tip";
  7056. public const string k_pch_Controller_Component_HandGrip = "handgrip";
  7057. public const string k_pch_Controller_Component_Status = "status";
  7058. public const string IVRRenderModels_Version = "IVRRenderModels_006";
  7059. public const uint k_unNotificationTextMaxSize = 256;
  7060. public const string IVRNotifications_Version = "IVRNotifications_002";
  7061. public const uint k_unMaxSettingsKeyLength = 128;
  7062. public const string IVRSettings_Version = "IVRSettings_003";
  7063. public const string k_pch_SteamVR_Section = "steamvr";
  7064. public const string k_pch_SteamVR_RequireHmd_String = "requireHmd";
  7065. public const string k_pch_SteamVR_ForcedDriverKey_String = "forcedDriver";
  7066. public const string k_pch_SteamVR_ForcedHmdKey_String = "forcedHmd";
  7067. public const string k_pch_SteamVR_DisplayDebug_Bool = "displayDebug";
  7068. public const string k_pch_SteamVR_DebugProcessPipe_String = "debugProcessPipe";
  7069. public const string k_pch_SteamVR_DisplayDebugX_Int32 = "displayDebugX";
  7070. public const string k_pch_SteamVR_DisplayDebugY_Int32 = "displayDebugY";
  7071. public const string k_pch_SteamVR_SendSystemButtonToAllApps_Bool = "sendSystemButtonToAllApps";
  7072. public const string k_pch_SteamVR_LogLevel_Int32 = "loglevel";
  7073. public const string k_pch_SteamVR_IPD_Float = "ipd";
  7074. public const string k_pch_SteamVR_Background_String = "background";
  7075. public const string k_pch_SteamVR_BackgroundUseDomeProjection_Bool = "backgroundUseDomeProjection";
  7076. public const string k_pch_SteamVR_BackgroundCameraHeight_Float = "backgroundCameraHeight";
  7077. public const string k_pch_SteamVR_BackgroundDomeRadius_Float = "backgroundDomeRadius";
  7078. public const string k_pch_SteamVR_GridColor_String = "gridColor";
  7079. public const string k_pch_SteamVR_PlayAreaColor_String = "playAreaColor";
  7080. public const string k_pch_SteamVR_TrackingLossColor_String = "trackingLossColor";
  7081. public const string k_pch_SteamVR_ShowStage_Bool = "showStage";
  7082. public const string k_pch_SteamVR_ActivateMultipleDrivers_Bool = "activateMultipleDrivers";
  7083. public const string k_pch_SteamVR_UsingSpeakers_Bool = "usingSpeakers";
  7084. public const string k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = "speakersForwardYawOffsetDegrees";
  7085. public const string k_pch_SteamVR_BaseStationPowerManagement_Int32 = "basestationPowerManagement";
  7086. public const string k_pch_SteamVR_ShowBaseStationPowerManagementTip_Int32 = "ShowBaseStationPowerManagementTip";
  7087. public const string k_pch_SteamVR_NeverKillProcesses_Bool = "neverKillProcesses";
  7088. public const string k_pch_SteamVR_SupersampleScale_Float = "supersampleScale";
  7089. public const string k_pch_SteamVR_MaxRecommendedResolution_Int32 = "maxRecommendedResolution";
  7090. public const string k_pch_SteamVR_MotionSmoothing_Bool = "motionSmoothing";
  7091. public const string k_pch_SteamVR_MotionSmoothingOverride_Int32 = "motionSmoothingOverride";
  7092. public const string k_pch_SteamVR_DisableAsyncReprojection_Bool = "disableAsync";
  7093. public const string k_pch_SteamVR_ForceFadeOnBadTracking_Bool = "forceFadeOnBadTracking";
  7094. public const string k_pch_SteamVR_DefaultMirrorView_Int32 = "mirrorView";
  7095. public const string k_pch_SteamVR_ShowLegacyMirrorView_Bool = "showLegacyMirrorView";
  7096. public const string k_pch_SteamVR_MirrorViewVisibility_Bool = "showMirrorView";
  7097. public const string k_pch_SteamVR_MirrorViewDisplayMode_Int32 = "mirrorViewDisplayMode";
  7098. public const string k_pch_SteamVR_MirrorViewEye_Int32 = "mirrorViewEye";
  7099. public const string k_pch_SteamVR_MirrorViewGeometry_String = "mirrorViewGeometry";
  7100. public const string k_pch_SteamVR_MirrorViewGeometryMaximized_String = "mirrorViewGeometryMaximized";
  7101. public const string k_pch_SteamVR_PerfGraphVisibility_Bool = "showPerfGraph";
  7102. public const string k_pch_SteamVR_StartMonitorFromAppLaunch = "startMonitorFromAppLaunch";
  7103. public const string k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = "startCompositorFromAppLaunch";
  7104. public const string k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = "startDashboardFromAppLaunch";
  7105. public const string k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = "startOverlayAppsFromDashboard";
  7106. public const string k_pch_SteamVR_EnableHomeApp = "enableHomeApp";
  7107. public const string k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBackgroundImageTimeSec";
  7108. public const string k_pch_SteamVR_RetailDemo_Bool = "retailDemo";
  7109. public const string k_pch_SteamVR_IpdOffset_Float = "ipdOffset";
  7110. public const string k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering";
  7111. public const string k_pch_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride";
  7112. public const string k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync";
  7113. public const string k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode";
  7114. public const string k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver";
  7115. public const string k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor";
  7116. public const string k_pch_SteamVR_DebugInputBinding = "debugInputBinding";
  7117. public const string k_pch_SteamVR_DoNotFadeToGrid = "doNotFadeToGrid";
  7118. public const string k_pch_SteamVR_RenderCameraMode = "renderCameraMode";
  7119. public const string k_pch_SteamVR_EnableSharedResourceJournaling = "enableSharedResourceJournaling";
  7120. public const string k_pch_SteamVR_EnableSafeMode = "enableSafeMode";
  7121. public const string k_pch_SteamVR_PreferredRefreshRate = "preferredRefreshRate";
  7122. public const string k_pch_SteamVR_LastVersionNotice = "lastVersionNotice";
  7123. public const string k_pch_SteamVR_LastVersionNoticeDate = "lastVersionNoticeDate";
  7124. public const string k_pch_SteamVR_HmdDisplayColorGainR_Float = "hmdDisplayColorGainR";
  7125. public const string k_pch_SteamVR_HmdDisplayColorGainG_Float = "hmdDisplayColorGainG";
  7126. public const string k_pch_SteamVR_HmdDisplayColorGainB_Float = "hmdDisplayColorGainB";
  7127. public const string k_pch_SteamVR_CustomIconStyle_String = "customIconStyle";
  7128. public const string k_pch_SteamVR_CustomOffIconStyle_String = "customOffIconStyle";
  7129. public const string k_pch_SteamVR_CustomIconForceUpdate_String = "customIconForceUpdate";
  7130. public const string k_pch_SteamVR_AllowGlobalActionSetPriority = "globalActionSetPriority";
  7131. public const string k_pch_SteamVR_OverlayRenderQuality = "overlayRenderQuality_2";
  7132. public const string k_pch_SteamVR_BlockOculusSDKOnOpenVRLaunchOption_Bool = "blockOculusSDKOnOpenVRLaunchOption";
  7133. public const string k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool = "blockOculusSDKOnAllLaunches";
  7134. public const string k_pch_DirectMode_Section = "direct_mode";
  7135. public const string k_pch_DirectMode_Enable_Bool = "enable";
  7136. public const string k_pch_DirectMode_Count_Int32 = "count";
  7137. public const string k_pch_DirectMode_EdidVid_Int32 = "edidVid";
  7138. public const string k_pch_DirectMode_EdidPid_Int32 = "edidPid";
  7139. public const string k_pch_Lighthouse_Section = "driver_lighthouse";
  7140. public const string k_pch_Lighthouse_DisableIMU_Bool = "disableimu";
  7141. public const string k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd";
  7142. public const string k_pch_Lighthouse_UseDisambiguation_String = "usedisambiguation";
  7143. public const string k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug";
  7144. public const string k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation";
  7145. public const string k_pch_Lighthouse_DBHistory_Bool = "dbhistory";
  7146. public const string k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth";
  7147. public const string k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations";
  7148. public const string k_pch_Lighthouse_PowerManagedBaseStations2_String = "PowerManagedBaseStations2";
  7149. public const string k_pch_Lighthouse_InactivityTimeoutForBaseStations_Int32 = "InactivityTimeoutForBaseStations";
  7150. public const string k_pch_Lighthouse_EnableImuFallback_Bool = "enableImuFallback";
  7151. public const string k_pch_Null_Section = "driver_null";
  7152. public const string k_pch_Null_SerialNumber_String = "serialNumber";
  7153. public const string k_pch_Null_ModelNumber_String = "modelNumber";
  7154. public const string k_pch_Null_WindowX_Int32 = "windowX";
  7155. public const string k_pch_Null_WindowY_Int32 = "windowY";
  7156. public const string k_pch_Null_WindowWidth_Int32 = "windowWidth";
  7157. public const string k_pch_Null_WindowHeight_Int32 = "windowHeight";
  7158. public const string k_pch_Null_RenderWidth_Int32 = "renderWidth";
  7159. public const string k_pch_Null_RenderHeight_Int32 = "renderHeight";
  7160. public const string k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons";
  7161. public const string k_pch_Null_DisplayFrequency_Float = "displayFrequency";
  7162. public const string k_pch_WindowsMR_Section = "driver_holographic";
  7163. public const string k_pch_UserInterface_Section = "userinterface";
  7164. public const string k_pch_UserInterface_StatusAlwaysOnTop_Bool = "StatusAlwaysOnTop";
  7165. public const string k_pch_UserInterface_MinimizeToTray_Bool = "MinimizeToTray";
  7166. public const string k_pch_UserInterface_HidePopupsWhenStatusMinimized_Bool = "HidePopupsWhenStatusMinimized";
  7167. public const string k_pch_UserInterface_Screenshots_Bool = "screenshots";
  7168. public const string k_pch_UserInterface_ScreenshotType_Int = "screenshotType";
  7169. public const string k_pch_Notifications_Section = "notifications";
  7170. public const string k_pch_Notifications_DoNotDisturb_Bool = "DoNotDisturb";
  7171. public const string k_pch_Keyboard_Section = "keyboard";
  7172. public const string k_pch_Keyboard_TutorialCompletions = "TutorialCompletions";
  7173. public const string k_pch_Keyboard_ScaleX = "ScaleX";
  7174. public const string k_pch_Keyboard_ScaleY = "ScaleY";
  7175. public const string k_pch_Keyboard_OffsetLeftX = "OffsetLeftX";
  7176. public const string k_pch_Keyboard_OffsetRightX = "OffsetRightX";
  7177. public const string k_pch_Keyboard_OffsetY = "OffsetY";
  7178. public const string k_pch_Keyboard_Smoothing = "Smoothing";
  7179. public const string k_pch_Perf_Section = "perfcheck";
  7180. public const string k_pch_Perf_PerfGraphInHMD_Bool = "perfGraphInHMD";
  7181. public const string k_pch_Perf_AllowTimingStore_Bool = "allowTimingStore";
  7182. public const string k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit";
  7183. public const string k_pch_Perf_TestData_Float = "perfTestData";
  7184. public const string k_pch_Perf_GPUProfiling_Bool = "GPUProfiling";
  7185. public const string k_pch_CollisionBounds_Section = "collisionBounds";
  7186. public const string k_pch_CollisionBounds_Style_Int32 = "CollisionBoundsStyle";
  7187. public const string k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBoundsGroundPerimeterOn";
  7188. public const string k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn";
  7189. public const string k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn";
  7190. public const string k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance";
  7191. public const string k_pch_CollisionBounds_WallHeight_Float = "CollisionBoundsWallHeight";
  7192. public const string k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR";
  7193. public const string k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG";
  7194. public const string k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB";
  7195. public const string k_pch_CollisionBounds_ColorGammaA_Int32 = "CollisionBoundsColorGammaA";
  7196. public const string k_pch_CollisionBounds_EnableDriverImport = "enableDriverBoundsImport";
  7197. public const string k_pch_Camera_Section = "camera";
  7198. public const string k_pch_Camera_EnableCamera_Bool = "enableCamera";
  7199. public const string k_pch_Camera_ShowOnController_Bool = "showOnController";
  7200. public const string k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds";
  7201. public const string k_pch_Camera_RoomView_Int32 = "roomView";
  7202. public const string k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR";
  7203. public const string k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG";
  7204. public const string k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB";
  7205. public const string k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA";
  7206. public const string k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength";
  7207. public const string k_pch_Camera_RoomViewStyle_Int32 = "roomViewStyle";
  7208. public const string k_pch_audio_Section = "audio";
  7209. public const string k_pch_audio_SetOsDefaultPlaybackDevice_Bool = "setOsDefaultPlaybackDevice";
  7210. public const string k_pch_audio_EnablePlaybackDeviceOverride_Bool = "enablePlaybackDeviceOverride";
  7211. public const string k_pch_audio_PlaybackDeviceOverride_String = "playbackDeviceOverride";
  7212. public const string k_pch_audio_PlaybackDeviceOverrideName_String = "playbackDeviceOverrideName";
  7213. public const string k_pch_audio_SetOsDefaultRecordingDevice_Bool = "setOsDefaultRecordingDevice";
  7214. public const string k_pch_audio_EnableRecordingDeviceOverride_Bool = "enableRecordingDeviceOverride";
  7215. public const string k_pch_audio_RecordingDeviceOverride_String = "recordingDeviceOverride";
  7216. public const string k_pch_audio_RecordingDeviceOverrideName_String = "recordingDeviceOverrideName";
  7217. public const string k_pch_audio_EnablePlaybackMirror_Bool = "enablePlaybackMirror";
  7218. public const string k_pch_audio_PlaybackMirrorDevice_String = "playbackMirrorDevice";
  7219. public const string k_pch_audio_PlaybackMirrorDeviceName_String = "playbackMirrorDeviceName";
  7220. public const string k_pch_audio_OldPlaybackMirrorDevice_String = "onPlaybackMirrorDevice";
  7221. public const string k_pch_audio_ActiveMirrorDevice_String = "activePlaybackMirrorDevice";
  7222. public const string k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume";
  7223. public const string k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId";
  7224. public const string k_pch_audio_VIVEHDMIGain = "viveHDMIGain";
  7225. public const string k_pch_Power_Section = "power";
  7226. public const string k_pch_Power_PowerOffOnExit_Bool = "powerOffOnExit";
  7227. public const string k_pch_Power_TurnOffScreensTimeout_Float = "turnOffScreensTimeout";
  7228. public const string k_pch_Power_TurnOffControllersTimeout_Float = "turnOffControllersTimeout";
  7229. public const string k_pch_Power_ReturnToWatchdogTimeout_Float = "returnToWatchdogTimeout";
  7230. public const string k_pch_Power_AutoLaunchSteamVROnButtonPress = "autoLaunchSteamVROnButtonPress";
  7231. public const string k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositorOnStandby";
  7232. public const string k_pch_Dashboard_Section = "dashboard";
  7233. public const string k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard";
  7234. public const string k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode";
  7235. public const string k_pch_Dashboard_Position = "position";
  7236. public const string k_pch_Dashboard_DesktopScale = "desktopScale";
  7237. public const string k_pch_Dashboard_DashboardScale = "dashboardScale";
  7238. public const string k_pch_modelskin_Section = "modelskins";
  7239. public const string k_pch_Driver_Enable_Bool = "enable";
  7240. public const string k_pch_Driver_BlockedBySafemode_Bool = "blocked_by_safe_mode";
  7241. public const string k_pch_Driver_LoadPriority_Int32 = "loadPriority";
  7242. public const string k_pch_WebInterface_Section = "WebInterface";
  7243. public const string k_pch_VRWebHelper_Section = "VRWebHelper";
  7244. public const string k_pch_VRWebHelper_DebuggerEnabled_Bool = "DebuggerEnabled";
  7245. public const string k_pch_VRWebHelper_DebuggerPort_Int32 = "DebuggerPort";
  7246. public const string k_pch_TrackingOverride_Section = "TrackingOverrides";
  7247. public const string k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL";
  7248. public const string k_pch_App_BindingLegacyAPISuffix_String = "_legacy";
  7249. public const string k_pch_App_BindingSteamVRInputAPISuffix_String = "_steamvrinput";
  7250. public const string k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL";
  7251. public const string k_pch_App_BindingPreviousURLSuffix_String = "PreviousURL";
  7252. public const string k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave";
  7253. public const string k_pch_App_DominantHand_Int32 = "DominantHand";
  7254. public const string k_pch_App_BlockOculusSDK_Bool = "blockOculusSDK";
  7255. public const string k_pch_Trackers_Section = "trackers";
  7256. public const string k_pch_DesktopUI_Section = "DesktopUI";
  7257. public const string k_pch_LastKnown_Section = "LastKnown";
  7258. public const string k_pch_LastKnown_HMDManufacturer_String = "HMDManufacturer";
  7259. public const string k_pch_LastKnown_HMDModel_String = "HMDModel";
  7260. public const string k_pch_DismissedWarnings_Section = "DismissedWarnings";
  7261. public const string k_pch_Input_Section = "input";
  7262. public const string k_pch_Input_LeftThumbstickRotation_Float = "leftThumbstickRotation";
  7263. public const string k_pch_Input_RightThumbstickRotation_Float = "rightThumbstickRotation";
  7264. public const string k_pch_Input_ThumbstickDeadzone_Float = "thumbstickDeadzone";
  7265. public const string k_pch_GpuSpeed_Section = "GpuSpeed";
  7266. public const string IVRScreenshots_Version = "IVRScreenshots_001";
  7267. public const string IVRResources_Version = "IVRResources_001";
  7268. public const string IVRDriverManager_Version = "IVRDriverManager_001";
  7269. public const uint k_unMaxActionNameLength = 64;
  7270. public const uint k_unMaxActionSetNameLength = 64;
  7271. public const uint k_unMaxActionOriginCount = 16;
  7272. public const uint k_unMaxBoneNameLength = 32;
  7273. public const int k_nActionSetOverlayGlobalPriorityMin = 16777216;
  7274. public const int k_nActionSetOverlayGlobalPriorityMax = 33554431;
  7275. public const int k_nActionSetPriorityReservedMin = 33554432;
  7276. public const string IVRInput_Version = "IVRInput_010";
  7277. public const ulong k_ulInvalidIOBufferHandle = 0;
  7278. public const string IVRIOBuffer_Version = "IVRIOBuffer_002";
  7279. public const uint k_ulInvalidSpatialAnchorHandle = 0;
  7280. public const string IVRSpatialAnchors_Version = "IVRSpatialAnchors_001";
  7281. public const string IVRDebug_Version = "IVRDebug_001";
  7282. public const ulong k_ulDisplayRedirectContainer = 25769803779;
  7283. public const string IVRProperties_Version = "IVRProperties_001";
  7284. public const string k_pchPathUserHandRight = "/user/hand/right";
  7285. public const string k_pchPathUserHandLeft = "/user/hand/left";
  7286. public const string k_pchPathUserHandPrimary = "/user/hand/primary";
  7287. public const string k_pchPathUserHandSecondary = "/user/hand/secondary";
  7288. public const string k_pchPathUserHead = "/user/head";
  7289. public const string k_pchPathUserGamepad = "/user/gamepad";
  7290. public const string k_pchPathUserTreadmill = "/user/treadmill";
  7291. public const string k_pchPathUserStylus = "/user/stylus";
  7292. public const string k_pchPathDevices = "/devices";
  7293. public const string k_pchPathDevicePath = "/device_path";
  7294. public const string k_pchPathBestAliasPath = "/best_alias_path";
  7295. public const string k_pchPathBoundTrackerAliasPath = "/bound_tracker_path";
  7296. public const string k_pchPathBoundTrackerRole = "/bound_tracker_role";
  7297. public const string k_pchPathPoseRaw = "/pose/raw";
  7298. public const string k_pchPathPoseTip = "/pose/tip";
  7299. public const string k_pchPathPoseGrip = "/pose/grip";
  7300. public const string k_pchPathSystemButtonClick = "/input/system/click";
  7301. public const string k_pchPathProximity = "/proximity";
  7302. public const string k_pchPathControllerTypePrefix = "/controller_type/";
  7303. public const string k_pchPathInputProfileSuffix = "/input_profile";
  7304. public const string k_pchPathBindingNameSuffix = "/binding_name";
  7305. public const string k_pchPathBindingUrlSuffix = "/binding_url";
  7306. public const string k_pchPathBindingErrorSuffix = "/binding_error";
  7307. public const string k_pchPathActiveActionSets = "/active_action_sets";
  7308. public const string k_pchPathComponentUpdates = "/total_component_updates";
  7309. public const string k_pchPathUserFootLeft = "/user/foot/left";
  7310. public const string k_pchPathUserFootRight = "/user/foot/right";
  7311. public const string k_pchPathUserShoulderLeft = "/user/shoulder/left";
  7312. public const string k_pchPathUserShoulderRight = "/user/shoulder/right";
  7313. public const string k_pchPathUserElbowLeft = "/user/elbow/left";
  7314. public const string k_pchPathUserElbowRight = "/user/elbow/right";
  7315. public const string k_pchPathUserKneeLeft = "/user/knee/left";
  7316. public const string k_pchPathUserKneeRight = "/user/knee/right";
  7317. public const string k_pchPathUserWaist = "/user/waist";
  7318. public const string k_pchPathUserChest = "/user/chest";
  7319. public const string k_pchPathUserCamera = "/user/camera";
  7320. public const string k_pchPathUserKeyboard = "/user/keyboard";
  7321. public const string k_pchPathClientAppKey = "/client_info/app_key";
  7322. public const ulong k_ulInvalidPathHandle = 0;
  7323. public const string IVRPaths_Version = "IVRPaths_001";
  7324. public const string IVRBlockQueue_Version = "IVRBlockQueue_004";
  7325. static uint VRToken { get; set; }
  7326. const string FnTable_Prefix = "FnTable:";
  7327. class COpenVRContext
  7328. {
  7329. public COpenVRContext() { Clear(); }
  7330. public void Clear()
  7331. {
  7332. m_pVRSystem = null;
  7333. m_pVRChaperone = null;
  7334. m_pVRChaperoneSetup = null;
  7335. m_pVRCompositor = null;
  7336. m_pVRHeadsetView = null;
  7337. m_pVROverlay = null;
  7338. m_pVROverlayView = null;
  7339. m_pVRRenderModels = null;
  7340. m_pVRExtendedDisplay = null;
  7341. m_pVRSettings = null;
  7342. m_pVRApplications = null;
  7343. m_pVRScreenshots = null;
  7344. m_pVRTrackedCamera = null;
  7345. m_pVRInput = null;
  7346. m_pVRIOBuffer = null;
  7347. m_pVRSpatialAnchors = null;
  7348. m_pVRNotifications = null;
  7349. m_pVRDebug = null;
  7350. }
  7351. void CheckClear()
  7352. {
  7353. if (VRToken != GetInitToken())
  7354. {
  7355. Clear();
  7356. VRToken = GetInitToken();
  7357. }
  7358. }
  7359. public CVRSystem VRSystem()
  7360. {
  7361. CheckClear();
  7362. if (m_pVRSystem == null)
  7363. {
  7364. var eError = EVRInitError.None;
  7365. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSystem_Version, ref eError);
  7366. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7367. m_pVRSystem = new CVRSystem(pInterface);
  7368. }
  7369. return m_pVRSystem;
  7370. }
  7371. public CVRChaperone VRChaperone()
  7372. {
  7373. CheckClear();
  7374. if (m_pVRChaperone == null)
  7375. {
  7376. var eError = EVRInitError.None;
  7377. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperone_Version, ref eError);
  7378. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7379. m_pVRChaperone = new CVRChaperone(pInterface);
  7380. }
  7381. return m_pVRChaperone;
  7382. }
  7383. public CVRChaperoneSetup VRChaperoneSetup()
  7384. {
  7385. CheckClear();
  7386. if (m_pVRChaperoneSetup == null)
  7387. {
  7388. var eError = EVRInitError.None;
  7389. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperoneSetup_Version, ref eError);
  7390. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7391. m_pVRChaperoneSetup = new CVRChaperoneSetup(pInterface);
  7392. }
  7393. return m_pVRChaperoneSetup;
  7394. }
  7395. public CVRCompositor VRCompositor()
  7396. {
  7397. CheckClear();
  7398. if (m_pVRCompositor == null)
  7399. {
  7400. var eError = EVRInitError.None;
  7401. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRCompositor_Version, ref eError);
  7402. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7403. m_pVRCompositor = new CVRCompositor(pInterface);
  7404. }
  7405. return m_pVRCompositor;
  7406. }
  7407. public CVRHeadsetView VRHeadsetView()
  7408. {
  7409. CheckClear();
  7410. if (m_pVRHeadsetView == null)
  7411. {
  7412. var eError = EVRInitError.None;
  7413. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRHeadsetView_Version, ref eError);
  7414. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7415. m_pVRHeadsetView = new CVRHeadsetView(pInterface);
  7416. }
  7417. return m_pVRHeadsetView;
  7418. }
  7419. public CVROverlay VROverlay()
  7420. {
  7421. CheckClear();
  7422. if (m_pVROverlay == null)
  7423. {
  7424. var eError = EVRInitError.None;
  7425. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVROverlay_Version, ref eError);
  7426. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7427. m_pVROverlay = new CVROverlay(pInterface);
  7428. }
  7429. return m_pVROverlay;
  7430. }
  7431. public CVROverlayView VROverlayView()
  7432. {
  7433. CheckClear();
  7434. if (m_pVROverlayView == null)
  7435. {
  7436. var eError = EVRInitError.None;
  7437. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVROverlayView_Version, ref eError);
  7438. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7439. m_pVROverlayView = new CVROverlayView(pInterface);
  7440. }
  7441. return m_pVROverlayView;
  7442. }
  7443. public CVRRenderModels VRRenderModels()
  7444. {
  7445. CheckClear();
  7446. if (m_pVRRenderModels == null)
  7447. {
  7448. var eError = EVRInitError.None;
  7449. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRRenderModels_Version, ref eError);
  7450. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7451. m_pVRRenderModels = new CVRRenderModels(pInterface);
  7452. }
  7453. return m_pVRRenderModels;
  7454. }
  7455. public CVRExtendedDisplay VRExtendedDisplay()
  7456. {
  7457. CheckClear();
  7458. if (m_pVRExtendedDisplay == null)
  7459. {
  7460. var eError = EVRInitError.None;
  7461. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRExtendedDisplay_Version, ref eError);
  7462. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7463. m_pVRExtendedDisplay = new CVRExtendedDisplay(pInterface);
  7464. }
  7465. return m_pVRExtendedDisplay;
  7466. }
  7467. public CVRSettings VRSettings()
  7468. {
  7469. CheckClear();
  7470. if (m_pVRSettings == null)
  7471. {
  7472. var eError = EVRInitError.None;
  7473. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSettings_Version, ref eError);
  7474. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7475. m_pVRSettings = new CVRSettings(pInterface);
  7476. }
  7477. return m_pVRSettings;
  7478. }
  7479. public CVRApplications VRApplications()
  7480. {
  7481. CheckClear();
  7482. if (m_pVRApplications == null)
  7483. {
  7484. var eError = EVRInitError.None;
  7485. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRApplications_Version, ref eError);
  7486. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7487. m_pVRApplications = new CVRApplications(pInterface);
  7488. }
  7489. return m_pVRApplications;
  7490. }
  7491. public CVRScreenshots VRScreenshots()
  7492. {
  7493. CheckClear();
  7494. if (m_pVRScreenshots == null)
  7495. {
  7496. var eError = EVRInitError.None;
  7497. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRScreenshots_Version, ref eError);
  7498. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7499. m_pVRScreenshots = new CVRScreenshots(pInterface);
  7500. }
  7501. return m_pVRScreenshots;
  7502. }
  7503. public CVRTrackedCamera VRTrackedCamera()
  7504. {
  7505. CheckClear();
  7506. if (m_pVRTrackedCamera == null)
  7507. {
  7508. var eError = EVRInitError.None;
  7509. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRTrackedCamera_Version, ref eError);
  7510. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7511. m_pVRTrackedCamera = new CVRTrackedCamera(pInterface);
  7512. }
  7513. return m_pVRTrackedCamera;
  7514. }
  7515. public CVRInput VRInput()
  7516. {
  7517. CheckClear();
  7518. if (m_pVRInput == null)
  7519. {
  7520. var eError = EVRInitError.None;
  7521. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRInput_Version, ref eError);
  7522. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7523. m_pVRInput = new CVRInput(pInterface);
  7524. }
  7525. return m_pVRInput;
  7526. }
  7527. public CVRIOBuffer VRIOBuffer()
  7528. {
  7529. CheckClear();
  7530. if (m_pVRIOBuffer == null)
  7531. {
  7532. var eError = EVRInitError.None;
  7533. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRIOBuffer_Version, ref eError);
  7534. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7535. m_pVRIOBuffer = new CVRIOBuffer(pInterface);
  7536. }
  7537. return m_pVRIOBuffer;
  7538. }
  7539. public CVRSpatialAnchors VRSpatialAnchors()
  7540. {
  7541. CheckClear();
  7542. if (m_pVRSpatialAnchors == null)
  7543. {
  7544. var eError = EVRInitError.None;
  7545. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRSpatialAnchors_Version, ref eError);
  7546. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7547. m_pVRSpatialAnchors = new CVRSpatialAnchors(pInterface);
  7548. }
  7549. return m_pVRSpatialAnchors;
  7550. }
  7551. public CVRDebug VRDebug()
  7552. {
  7553. CheckClear();
  7554. if (m_pVRDebug == null)
  7555. {
  7556. var eError = EVRInitError.None;
  7557. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRDebug_Version, ref eError);
  7558. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7559. m_pVRDebug = new CVRDebug(pInterface);
  7560. }
  7561. return m_pVRDebug;
  7562. }
  7563. public CVRNotifications VRNotifications()
  7564. {
  7565. CheckClear();
  7566. if (m_pVRNotifications == null)
  7567. {
  7568. var eError = EVRInitError.None;
  7569. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRNotifications_Version, ref eError);
  7570. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7571. m_pVRNotifications = new CVRNotifications(pInterface);
  7572. }
  7573. return m_pVRNotifications;
  7574. }
  7575. private CVRSystem m_pVRSystem;
  7576. private CVRChaperone m_pVRChaperone;
  7577. private CVRChaperoneSetup m_pVRChaperoneSetup;
  7578. private CVRCompositor m_pVRCompositor;
  7579. private CVRHeadsetView m_pVRHeadsetView;
  7580. private CVROverlay m_pVROverlay;
  7581. private CVROverlayView m_pVROverlayView;
  7582. private CVRRenderModels m_pVRRenderModels;
  7583. private CVRExtendedDisplay m_pVRExtendedDisplay;
  7584. private CVRSettings m_pVRSettings;
  7585. private CVRApplications m_pVRApplications;
  7586. private CVRScreenshots m_pVRScreenshots;
  7587. private CVRTrackedCamera m_pVRTrackedCamera;
  7588. private CVRInput m_pVRInput;
  7589. private CVRIOBuffer m_pVRIOBuffer;
  7590. private CVRSpatialAnchors m_pVRSpatialAnchors;
  7591. private CVRNotifications m_pVRNotifications;
  7592. private CVRDebug m_pVRDebug;
  7593. };
  7594. private static COpenVRContext _OpenVRInternal_ModuleContext = null;
  7595. static COpenVRContext OpenVRInternal_ModuleContext
  7596. {
  7597. get
  7598. {
  7599. if (_OpenVRInternal_ModuleContext == null)
  7600. _OpenVRInternal_ModuleContext = new COpenVRContext();
  7601. return _OpenVRInternal_ModuleContext;
  7602. }
  7603. }
  7604. public static CVRSystem System { get { return OpenVRInternal_ModuleContext.VRSystem(); } }
  7605. public static CVRChaperone Chaperone { get { return OpenVRInternal_ModuleContext.VRChaperone(); } }
  7606. public static CVRChaperoneSetup ChaperoneSetup { get { return OpenVRInternal_ModuleContext.VRChaperoneSetup(); } }
  7607. public static CVRCompositor Compositor { get { return OpenVRInternal_ModuleContext.VRCompositor(); } }
  7608. public static CVRHeadsetView HeadsetView { get { return OpenVRInternal_ModuleContext.VRHeadsetView(); } }
  7609. public static CVROverlay Overlay { get { return OpenVRInternal_ModuleContext.VROverlay(); } }
  7610. public static CVROverlayView OverlayView { get { return OpenVRInternal_ModuleContext.VROverlayView(); } }
  7611. public static CVRRenderModels RenderModels { get { return OpenVRInternal_ModuleContext.VRRenderModels(); } }
  7612. public static CVRExtendedDisplay ExtendedDisplay { get { return OpenVRInternal_ModuleContext.VRExtendedDisplay(); } }
  7613. public static CVRSettings Settings { get { return OpenVRInternal_ModuleContext.VRSettings(); } }
  7614. public static CVRApplications Applications { get { return OpenVRInternal_ModuleContext.VRApplications(); } }
  7615. public static CVRScreenshots Screenshots { get { return OpenVRInternal_ModuleContext.VRScreenshots(); } }
  7616. public static CVRTrackedCamera TrackedCamera { get { return OpenVRInternal_ModuleContext.VRTrackedCamera(); } }
  7617. public static CVRInput Input { get { return OpenVRInternal_ModuleContext.VRInput(); } }
  7618. public static CVRIOBuffer IOBuffer { get { return OpenVRInternal_ModuleContext.VRIOBuffer(); } }
  7619. public static CVRSpatialAnchors SpatialAnchors { get { return OpenVRInternal_ModuleContext.VRSpatialAnchors(); } }
  7620. public static CVRNotifications Notifications { get { return OpenVRInternal_ModuleContext.VRNotifications(); } }
  7621. public static CVRDebug Debug { get { return OpenVRInternal_ModuleContext.VRDebug(); } }
  7622. /** Finds the active installation of vrclient.dll and initializes it */
  7623. public static CVRSystem Init(ref EVRInitError peError, EVRApplicationType eApplicationType = EVRApplicationType.VRApplication_Scene, string pchStartupInfo= "")
  7624. {
  7625. try
  7626. {
  7627. VRToken = InitInternal2(ref peError, eApplicationType, pchStartupInfo);
  7628. }
  7629. catch (EntryPointNotFoundException)
  7630. {
  7631. VRToken = InitInternal(ref peError, eApplicationType);
  7632. }
  7633. OpenVRInternal_ModuleContext.Clear();
  7634. if (peError != EVRInitError.None)
  7635. return null;
  7636. bool bInterfaceValid = IsInterfaceVersionValid(IVRSystem_Version);
  7637. if (!bInterfaceValid)
  7638. {
  7639. ShutdownInternal();
  7640. peError = EVRInitError.Init_InterfaceNotFound;
  7641. return null;
  7642. }
  7643. return OpenVR.System;
  7644. }
  7645. /** unloads vrclient.dll. Any interface pointers from the interface are
  7646. * invalid after this point */
  7647. public static void Shutdown()
  7648. {
  7649. ShutdownInternal();
  7650. }
  7651. }
  7652. }
  7653. #endif