openvr_api.cs 332 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168
  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_pchPathSystemButtonClick = "/input/system/click";
  7300. public const string k_pchPathProximity = "/proximity";
  7301. public const string k_pchPathControllerTypePrefix = "/controller_type/";
  7302. public const string k_pchPathInputProfileSuffix = "/input_profile";
  7303. public const string k_pchPathBindingNameSuffix = "/binding_name";
  7304. public const string k_pchPathBindingUrlSuffix = "/binding_url";
  7305. public const string k_pchPathBindingErrorSuffix = "/binding_error";
  7306. public const string k_pchPathActiveActionSets = "/active_action_sets";
  7307. public const string k_pchPathComponentUpdates = "/total_component_updates";
  7308. public const string k_pchPathUserFootLeft = "/user/foot/left";
  7309. public const string k_pchPathUserFootRight = "/user/foot/right";
  7310. public const string k_pchPathUserShoulderLeft = "/user/shoulder/left";
  7311. public const string k_pchPathUserShoulderRight = "/user/shoulder/right";
  7312. public const string k_pchPathUserElbowLeft = "/user/elbow/left";
  7313. public const string k_pchPathUserElbowRight = "/user/elbow/right";
  7314. public const string k_pchPathUserKneeLeft = "/user/knee/left";
  7315. public const string k_pchPathUserKneeRight = "/user/knee/right";
  7316. public const string k_pchPathUserWaist = "/user/waist";
  7317. public const string k_pchPathUserChest = "/user/chest";
  7318. public const string k_pchPathUserCamera = "/user/camera";
  7319. public const string k_pchPathUserKeyboard = "/user/keyboard";
  7320. public const string k_pchPathClientAppKey = "/client_info/app_key";
  7321. public const ulong k_ulInvalidPathHandle = 0;
  7322. public const string IVRPaths_Version = "IVRPaths_001";
  7323. public const string IVRBlockQueue_Version = "IVRBlockQueue_004";
  7324. static uint VRToken { get; set; }
  7325. const string FnTable_Prefix = "FnTable:";
  7326. class COpenVRContext
  7327. {
  7328. public COpenVRContext() { Clear(); }
  7329. public void Clear()
  7330. {
  7331. m_pVRSystem = null;
  7332. m_pVRChaperone = null;
  7333. m_pVRChaperoneSetup = null;
  7334. m_pVRCompositor = null;
  7335. m_pVRHeadsetView = null;
  7336. m_pVROverlay = null;
  7337. m_pVROverlayView = null;
  7338. m_pVRRenderModels = null;
  7339. m_pVRExtendedDisplay = null;
  7340. m_pVRSettings = null;
  7341. m_pVRApplications = null;
  7342. m_pVRScreenshots = null;
  7343. m_pVRTrackedCamera = null;
  7344. m_pVRInput = null;
  7345. m_pVRIOBuffer = null;
  7346. m_pVRSpatialAnchors = null;
  7347. m_pVRNotifications = null;
  7348. m_pVRDebug = null;
  7349. }
  7350. void CheckClear()
  7351. {
  7352. if (VRToken != GetInitToken())
  7353. {
  7354. Clear();
  7355. VRToken = GetInitToken();
  7356. }
  7357. }
  7358. public CVRSystem VRSystem()
  7359. {
  7360. CheckClear();
  7361. if (m_pVRSystem == null)
  7362. {
  7363. var eError = EVRInitError.None;
  7364. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSystem_Version, ref eError);
  7365. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7366. m_pVRSystem = new CVRSystem(pInterface);
  7367. }
  7368. return m_pVRSystem;
  7369. }
  7370. public CVRChaperone VRChaperone()
  7371. {
  7372. CheckClear();
  7373. if (m_pVRChaperone == null)
  7374. {
  7375. var eError = EVRInitError.None;
  7376. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperone_Version, ref eError);
  7377. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7378. m_pVRChaperone = new CVRChaperone(pInterface);
  7379. }
  7380. return m_pVRChaperone;
  7381. }
  7382. public CVRChaperoneSetup VRChaperoneSetup()
  7383. {
  7384. CheckClear();
  7385. if (m_pVRChaperoneSetup == null)
  7386. {
  7387. var eError = EVRInitError.None;
  7388. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRChaperoneSetup_Version, ref eError);
  7389. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7390. m_pVRChaperoneSetup = new CVRChaperoneSetup(pInterface);
  7391. }
  7392. return m_pVRChaperoneSetup;
  7393. }
  7394. public CVRCompositor VRCompositor()
  7395. {
  7396. CheckClear();
  7397. if (m_pVRCompositor == null)
  7398. {
  7399. var eError = EVRInitError.None;
  7400. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRCompositor_Version, ref eError);
  7401. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7402. m_pVRCompositor = new CVRCompositor(pInterface);
  7403. }
  7404. return m_pVRCompositor;
  7405. }
  7406. public CVRHeadsetView VRHeadsetView()
  7407. {
  7408. CheckClear();
  7409. if (m_pVRHeadsetView == null)
  7410. {
  7411. var eError = EVRInitError.None;
  7412. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRHeadsetView_Version, ref eError);
  7413. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7414. m_pVRHeadsetView = new CVRHeadsetView(pInterface);
  7415. }
  7416. return m_pVRHeadsetView;
  7417. }
  7418. public CVROverlay VROverlay()
  7419. {
  7420. CheckClear();
  7421. if (m_pVROverlay == null)
  7422. {
  7423. var eError = EVRInitError.None;
  7424. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVROverlay_Version, ref eError);
  7425. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7426. m_pVROverlay = new CVROverlay(pInterface);
  7427. }
  7428. return m_pVROverlay;
  7429. }
  7430. public CVROverlayView VROverlayView()
  7431. {
  7432. CheckClear();
  7433. if (m_pVROverlayView == null)
  7434. {
  7435. var eError = EVRInitError.None;
  7436. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVROverlayView_Version, ref eError);
  7437. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7438. m_pVROverlayView = new CVROverlayView(pInterface);
  7439. }
  7440. return m_pVROverlayView;
  7441. }
  7442. public CVRRenderModels VRRenderModels()
  7443. {
  7444. CheckClear();
  7445. if (m_pVRRenderModels == null)
  7446. {
  7447. var eError = EVRInitError.None;
  7448. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRRenderModels_Version, ref eError);
  7449. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7450. m_pVRRenderModels = new CVRRenderModels(pInterface);
  7451. }
  7452. return m_pVRRenderModels;
  7453. }
  7454. public CVRExtendedDisplay VRExtendedDisplay()
  7455. {
  7456. CheckClear();
  7457. if (m_pVRExtendedDisplay == null)
  7458. {
  7459. var eError = EVRInitError.None;
  7460. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRExtendedDisplay_Version, ref eError);
  7461. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7462. m_pVRExtendedDisplay = new CVRExtendedDisplay(pInterface);
  7463. }
  7464. return m_pVRExtendedDisplay;
  7465. }
  7466. public CVRSettings VRSettings()
  7467. {
  7468. CheckClear();
  7469. if (m_pVRSettings == null)
  7470. {
  7471. var eError = EVRInitError.None;
  7472. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRSettings_Version, ref eError);
  7473. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7474. m_pVRSettings = new CVRSettings(pInterface);
  7475. }
  7476. return m_pVRSettings;
  7477. }
  7478. public CVRApplications VRApplications()
  7479. {
  7480. CheckClear();
  7481. if (m_pVRApplications == null)
  7482. {
  7483. var eError = EVRInitError.None;
  7484. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRApplications_Version, ref eError);
  7485. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7486. m_pVRApplications = new CVRApplications(pInterface);
  7487. }
  7488. return m_pVRApplications;
  7489. }
  7490. public CVRScreenshots VRScreenshots()
  7491. {
  7492. CheckClear();
  7493. if (m_pVRScreenshots == null)
  7494. {
  7495. var eError = EVRInitError.None;
  7496. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRScreenshots_Version, ref eError);
  7497. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7498. m_pVRScreenshots = new CVRScreenshots(pInterface);
  7499. }
  7500. return m_pVRScreenshots;
  7501. }
  7502. public CVRTrackedCamera VRTrackedCamera()
  7503. {
  7504. CheckClear();
  7505. if (m_pVRTrackedCamera == null)
  7506. {
  7507. var eError = EVRInitError.None;
  7508. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRTrackedCamera_Version, ref eError);
  7509. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7510. m_pVRTrackedCamera = new CVRTrackedCamera(pInterface);
  7511. }
  7512. return m_pVRTrackedCamera;
  7513. }
  7514. public CVRInput VRInput()
  7515. {
  7516. CheckClear();
  7517. if (m_pVRInput == null)
  7518. {
  7519. var eError = EVRInitError.None;
  7520. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRInput_Version, ref eError);
  7521. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7522. m_pVRInput = new CVRInput(pInterface);
  7523. }
  7524. return m_pVRInput;
  7525. }
  7526. public CVRIOBuffer VRIOBuffer()
  7527. {
  7528. CheckClear();
  7529. if (m_pVRIOBuffer == null)
  7530. {
  7531. var eError = EVRInitError.None;
  7532. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRIOBuffer_Version, ref eError);
  7533. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7534. m_pVRIOBuffer = new CVRIOBuffer(pInterface);
  7535. }
  7536. return m_pVRIOBuffer;
  7537. }
  7538. public CVRSpatialAnchors VRSpatialAnchors()
  7539. {
  7540. CheckClear();
  7541. if (m_pVRSpatialAnchors == null)
  7542. {
  7543. var eError = EVRInitError.None;
  7544. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRSpatialAnchors_Version, ref eError);
  7545. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7546. m_pVRSpatialAnchors = new CVRSpatialAnchors(pInterface);
  7547. }
  7548. return m_pVRSpatialAnchors;
  7549. }
  7550. public CVRDebug VRDebug()
  7551. {
  7552. CheckClear();
  7553. if (m_pVRDebug == null)
  7554. {
  7555. var eError = EVRInitError.None;
  7556. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRDebug_Version, ref eError);
  7557. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7558. m_pVRDebug = new CVRDebug(pInterface);
  7559. }
  7560. return m_pVRDebug;
  7561. }
  7562. public CVRNotifications VRNotifications()
  7563. {
  7564. CheckClear();
  7565. if (m_pVRNotifications == null)
  7566. {
  7567. var eError = EVRInitError.None;
  7568. var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix + IVRNotifications_Version, ref eError);
  7569. if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
  7570. m_pVRNotifications = new CVRNotifications(pInterface);
  7571. }
  7572. return m_pVRNotifications;
  7573. }
  7574. private CVRSystem m_pVRSystem;
  7575. private CVRChaperone m_pVRChaperone;
  7576. private CVRChaperoneSetup m_pVRChaperoneSetup;
  7577. private CVRCompositor m_pVRCompositor;
  7578. private CVRHeadsetView m_pVRHeadsetView;
  7579. private CVROverlay m_pVROverlay;
  7580. private CVROverlayView m_pVROverlayView;
  7581. private CVRRenderModels m_pVRRenderModels;
  7582. private CVRExtendedDisplay m_pVRExtendedDisplay;
  7583. private CVRSettings m_pVRSettings;
  7584. private CVRApplications m_pVRApplications;
  7585. private CVRScreenshots m_pVRScreenshots;
  7586. private CVRTrackedCamera m_pVRTrackedCamera;
  7587. private CVRInput m_pVRInput;
  7588. private CVRIOBuffer m_pVRIOBuffer;
  7589. private CVRSpatialAnchors m_pVRSpatialAnchors;
  7590. private CVRNotifications m_pVRNotifications;
  7591. private CVRDebug m_pVRDebug;
  7592. };
  7593. private static COpenVRContext _OpenVRInternal_ModuleContext = null;
  7594. static COpenVRContext OpenVRInternal_ModuleContext
  7595. {
  7596. get
  7597. {
  7598. if (_OpenVRInternal_ModuleContext == null)
  7599. _OpenVRInternal_ModuleContext = new COpenVRContext();
  7600. return _OpenVRInternal_ModuleContext;
  7601. }
  7602. }
  7603. public static CVRSystem System { get { return OpenVRInternal_ModuleContext.VRSystem(); } }
  7604. public static CVRChaperone Chaperone { get { return OpenVRInternal_ModuleContext.VRChaperone(); } }
  7605. public static CVRChaperoneSetup ChaperoneSetup { get { return OpenVRInternal_ModuleContext.VRChaperoneSetup(); } }
  7606. public static CVRCompositor Compositor { get { return OpenVRInternal_ModuleContext.VRCompositor(); } }
  7607. public static CVRHeadsetView HeadsetView { get { return OpenVRInternal_ModuleContext.VRHeadsetView(); } }
  7608. public static CVROverlay Overlay { get { return OpenVRInternal_ModuleContext.VROverlay(); } }
  7609. public static CVROverlayView OverlayView { get { return OpenVRInternal_ModuleContext.VROverlayView(); } }
  7610. public static CVRRenderModels RenderModels { get { return OpenVRInternal_ModuleContext.VRRenderModels(); } }
  7611. public static CVRExtendedDisplay ExtendedDisplay { get { return OpenVRInternal_ModuleContext.VRExtendedDisplay(); } }
  7612. public static CVRSettings Settings { get { return OpenVRInternal_ModuleContext.VRSettings(); } }
  7613. public static CVRApplications Applications { get { return OpenVRInternal_ModuleContext.VRApplications(); } }
  7614. public static CVRScreenshots Screenshots { get { return OpenVRInternal_ModuleContext.VRScreenshots(); } }
  7615. public static CVRTrackedCamera TrackedCamera { get { return OpenVRInternal_ModuleContext.VRTrackedCamera(); } }
  7616. public static CVRInput Input { get { return OpenVRInternal_ModuleContext.VRInput(); } }
  7617. public static CVRIOBuffer IOBuffer { get { return OpenVRInternal_ModuleContext.VRIOBuffer(); } }
  7618. public static CVRSpatialAnchors SpatialAnchors { get { return OpenVRInternal_ModuleContext.VRSpatialAnchors(); } }
  7619. public static CVRNotifications Notifications { get { return OpenVRInternal_ModuleContext.VRNotifications(); } }
  7620. public static CVRDebug Debug { get { return OpenVRInternal_ModuleContext.VRDebug(); } }
  7621. /** Finds the active installation of vrclient.dll and initializes it */
  7622. public static CVRSystem Init(ref EVRInitError peError, EVRApplicationType eApplicationType = EVRApplicationType.VRApplication_Scene, string pchStartupInfo= "")
  7623. {
  7624. try
  7625. {
  7626. VRToken = InitInternal2(ref peError, eApplicationType, pchStartupInfo);
  7627. }
  7628. catch (EntryPointNotFoundException)
  7629. {
  7630. VRToken = InitInternal(ref peError, eApplicationType);
  7631. }
  7632. OpenVRInternal_ModuleContext.Clear();
  7633. if (peError != EVRInitError.None)
  7634. return null;
  7635. bool bInterfaceValid = IsInterfaceVersionValid(IVRSystem_Version);
  7636. if (!bInterfaceValid)
  7637. {
  7638. ShutdownInternal();
  7639. peError = EVRInitError.Init_InterfaceNotFound;
  7640. return null;
  7641. }
  7642. return OpenVR.System;
  7643. }
  7644. /** unloads vrclient.dll. Any interface pointers from the interface are
  7645. * invalid after this point */
  7646. public static void Shutdown()
  7647. {
  7648. ShutdownInternal();
  7649. }
  7650. }
  7651. }
  7652. #endif