openvr_api.cs 247 KB

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