openvr_api.cs 255 KB

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