[
  {
    "path": ".github/workflows/msbuild.yml",
    "content": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n# separate terms of service, privacy policy, and support\n# documentation.\n\nname: MSBuild\n\non:\n  push:\n    branches: [ \"main\" ]\n  pull_request:\n    branches: [ \"main\" ]\n  workflow_dispatch:\n\nenv:\n  # Path to the solution file relative to the root of the project.\n  SOLUTION_FILE_PATH: .\n\n  # Configuration type to build.\n  # You can convert this to a build matrix if you need coverage of multiple configuration types.\n  # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix\n  BUILD_CONFIGURATION: ReleaseCI\n\n  # Directory for build artifacts\n  ARTIFACTS_DIR: ${{github.workspace}}/artifacts\n\npermissions:\n  contents: read\n\njobs:\n  build:\n    runs-on: windows-2025-vs2026\n\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Add MSBuild to PATH\n      uses: microsoft/setup-msbuild@v1.0.2\n\n    - name: Restore NuGet packages\n      working-directory: ${{env.GITHUB_WORKSPACE}}\n      run: nuget restore ${{env.SOLUTION_FILE_PATH}}\n\n    - name: Build\n      working-directory: ${{env.GITHUB_WORKSPACE}}\n      # Add additional options to the MSBuild command line here (like platform or verbosity level).\n      # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference\n      run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:OutDir=${{env.ARTIFACTS_DIR}} ${{env.SOLUTION_FILE_PATH}}\n\n    - name: Upload artifacts\n      id: upload-artifacts\n      uses: actions/upload-artifact@v4\n      with:\n        name: psvr2-toolkit-build\n        path: ${{env.ARTIFACTS_DIR}}\n\n    - id: optional_step_id\n      uses: signpath/github-action-submit-signing-request@v2\n      with:\n        api-token: ${{ secrets.SIGNPATH_API_TOKEN }}\n        organization-id: e5b00777-6877-43dd-8f53-89ac106cb9be\n        project-slug: PSVR2Toolkit\n        signing-policy-slug: test-signing\n        github-artifact-id: ${{ steps.upload-artifacts.outputs.artifact-id }}\n        wait-for-completion: true\n        output-artifact-directory: ${{env.ARTIFACTS_DIR}}\n"
  },
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore\n\n# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Mono auto generated files\nmono_crash.*\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n[Ww][Ii][Nn]32/\n[Aa][Rr][Mm]/\n[Aa][Rr][Mm]64/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n[Ll]ogs/\n\n# Visual Studio 2015/2017 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# Visual Studio 2017 auto generated files\nGenerated\\ Files/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# Benchmark Results\nBenchmarkDotNet.Artifacts/\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\n\n# ASP.NET Scaffolding\nScaffoldingReadMe.txt\n\n# StyleCop\nStyleCopReport.xml\n\n# Files built by Visual Studio\n*_i.c\n*_p.c\n*_h.h\n*.ilk\n*.meta\n*.obj\n*.iobj\n*.pch\n*.pdb\n*.ipdb\n*.pgc\n*.pgd\n*.rsp\n# but not Directory.Build.rsp, as it configures directory-level build defaults\n!Directory.Build.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*_wpftmp.csproj\n*.log\n*.tlog\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# Visual Studio Trace Files\n*.e2e\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# AxoCover is a Code Coverage Tool\n.axoCover/*\n!.axoCover/settings.json\n\n# Coverlet is a free, cross platform Code Coverage Tool\ncoverage*.json\ncoverage*.xml\ncoverage*.info\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# Note: Comment the next line if you want to checkin your web deploy settings,\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# NuGet Symbol Packages\n*.snupkg\n# The packages folder can be ignored because of Package Restore\n**/[Pp]ackages/*\n# except build/, which is used as an MSBuild target.\n!**/[Pp]ackages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/[Pp]ackages/repositories.config\n# NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!?*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Including strong name files can present a security risk\n# (https://github.com/github/gitignore/pull/2483#issue-259490424)\n#*.snk\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\nServiceFabricBackup/\n*.rptproj.bak\n\n# SQL Server files\n*.mdf\n*.ldf\n*.ndf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n*.rptproj.rsuser\n*- [Bb]ackup.rdl\n*- [Bb]ackup ([0-9]).rdl\n*- [Bb]ackup ([0-9][0-9]).rdl\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio 6 auto-generated project file (contains which files were open etc.)\n*.vbp\n\n# Visual Studio 6 workspace and project file (working project files containing files to include in project)\n*.dsw\n*.dsp\n\n# Visual Studio 6 technical files\n*.ncb\n*.aps\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# CodeRush personal settings\n.cr/personal\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools/**\n# !tools/packages.config\n\n# Tabs Studio\n*.tss\n\n# Telerik's JustMock configuration file\n*.jmconfig\n\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n\n# OpenCover UI analysis results\nOpenCover/\n\n# Azure Stream Analytics local run output\nASALocalRun/\n\n# MSBuild Binary and Structured Log\n*.binlog\n\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n\n# MFractors (Xamarin productivity tool) working folder\n.mfractor/\n\n# Local History for Visual Studio\n.localhistory/\n\n# Visual Studio History (VSHistory) files\n.vshistory/\n\n# BeatPulse healthcheck temp database\nhealthchecksdb\n\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup/\n\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide/\n\n# Fody - auto-generated XML schema\nFodyWeavers.xsd\n\n# VS Code files for those working on multiple tools\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n*.code-workspace\n\n# Local History for Visual Studio Code\n.history/\n\n# Windows Installer files from build outputs\n*.cab\n*.msi\n*.msix\n*.msm\n*.msp\n\n# JetBrains Rider\n*.sln.iml\n\n# MinHook\n!projects/psvr2_openvr_driver_ex/minhook/lib/*\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2026 Bnuuy Solutions\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "PSVR2Toolkit.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.12.35506.116\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"psvr2_openvr_driver_ex\", \"projects\\psvr2_openvr_driver_ex\\psvr2_openvr_driver_ex.vcxproj\", \"{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"UnifiedTelemetry.Client_stub\", \"projects\\UnifiedTelemetry.Client_stub\\UnifiedTelemetry.Client_stub.vcxproj\", \"{A17F69A1-4CBD-4B92-BEAD-D331A378533A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"UnifiedTelemetry.Model_stub\", \"projects\\UnifiedTelemetry.Model_stub\\UnifiedTelemetry.Model_stub.vcxproj\", \"{479C51AE-D86B-433F-ADAA-DCDD1646300A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"UnifiedTelemetry.Service_stub\", \"projects\\UnifiedTelemetry.Service_stub\\UnifiedTelemetry.Service_stub.vcxproj\", \"{40ADD18D-A928-4ABF-BE63-4591F53A4801}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"PSVR2Toolkit.IPC\", \"projects\\PSVR2Toolkit.IPC\\PSVR2Toolkit.IPC.csproj\", \"{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"PSVR2Toolkit.App\", \"projects\\PSVR2Toolkit.App\\PSVR2Toolkit.App.csproj\", \"{8E6661D1-6A40-4949-93CC-2280909E2DB3}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcustomshare\", \"projects\\libcustomshare\\libcustomshare.vcxproj\", \"{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x64 = Debug|x64\n\t\tDebugCI|x64 = DebugCI|x64\n\t\tRelease|x64 = Release|x64\n\t\tReleaseCI|x64 = ReleaseCI|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Debug|x64.Build.0 = Debug|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.DebugCI|x64.ActiveCfg = DebugCI|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.DebugCI|x64.Build.0 = DebugCI|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Release|x64.ActiveCfg = Release|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Release|x64.Build.0 = Release|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64\n\t\t{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.ReleaseCI|x64.Build.0 = ReleaseCI|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Debug|x64.Build.0 = Debug|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.DebugCI|x64.ActiveCfg = DebugCI|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.DebugCI|x64.Build.0 = DebugCI|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Release|x64.ActiveCfg = Release|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Release|x64.Build.0 = Release|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64\n\t\t{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.ReleaseCI|x64.Build.0 = ReleaseCI|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Debug|x64.Build.0 = Debug|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.DebugCI|x64.ActiveCfg = DebugCI|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.DebugCI|x64.Build.0 = DebugCI|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Release|x64.ActiveCfg = Release|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Release|x64.Build.0 = Release|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64\n\t\t{479C51AE-D86B-433F-ADAA-DCDD1646300A}.ReleaseCI|x64.Build.0 = ReleaseCI|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Debug|x64.Build.0 = Debug|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.DebugCI|x64.ActiveCfg = DebugCI|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.DebugCI|x64.Build.0 = DebugCI|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Release|x64.ActiveCfg = Release|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Release|x64.Build.0 = Release|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64\n\t\t{40ADD18D-A928-4ABF-BE63-4591F53A4801}.ReleaseCI|x64.Build.0 = ReleaseCI|x64\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.DebugCI|x64.ActiveCfg = DebugCI|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.DebugCI|x64.Build.0 = DebugCI|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Release|x64.Build.0 = Release|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.ReleaseCI|x64.ActiveCfg = ReleaseCI|Any CPU\n\t\t{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.ReleaseCI|x64.Build.0 = ReleaseCI|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.DebugCI|x64.ActiveCfg = DebugCI|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.DebugCI|x64.Build.0 = DebugCI|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.ReleaseCI|x64.ActiveCfg = ReleaseCI|Any CPU\n\t\t{8E6661D1-6A40-4949-93CC-2280909E2DB3}.ReleaseCI|x64.Build.0 = ReleaseCI|Any CPU\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Debug|x64.Build.0 = Debug|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.DebugCI|x64.ActiveCfg = Debug|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.DebugCI|x64.Build.0 = Debug|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Release|x64.ActiveCfg = Release|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Release|x64.Build.0 = Release|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.ReleaseCI|x64.ActiveCfg = Release|x64\n\t\t{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.ReleaseCI|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {4519F772-725B-47BF-BD00-0EA336012E8C}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "README.md",
    "content": "> [!WARNING]\n> If you have paid for PlayStation VR2 Toolkit, you have been scammed and you should immediately request a refund. PlayStation VR2 Toolkit is entirely free and **is intended for NON-COMMERCIAL use only**, we do not attempt to profit off of it. Additionally, eye tracking data from PlayStation VR2 Toolkit **must not** be used in commercial environments and/or for commercial purposes. \\\n> \\\n> PlayStation VR2 Toolkit is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.\n\n> [!NOTE]\n> Bnuuy Solutions and PlayStation VR2 Toolkit is not affiliated with Sony Interactive Entertainment, our project is not official or endorsed by Sony Interactive Entertainment in any way. \\\n> \\\n> Sony, Sony Interactive Entertainment and PS VR2/PlayStation VR2 are trademarks or registered trademarks of Sony Interactive Entertainment LLC in the United States of America and elsewhere.\n\n<p align=\"center\"><img src=\"https://github.com/BnuuySolutions/PSVR2Toolkit/blob/main/assets/Icon.png?raw=true\" width=\"128\" height=\"128\"></p>\n<h1 align=\"center\">PlayStation VR2 Toolkit</h1>\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Discord](https://img.shields.io/discord/1466476893543862274)](https://discord.gg/jym8CgJPF3)\n\nUnofficial modification for the official PlayStation VR2 driver/app, which aims to improve your PlayStation VR2 experience on PC.\n\n## Features\n- Eye tracking\\*\n- Improved controller prediction\n- Improved controller haptics (w/ PCM haptics) (coming soon, see `custom-controller-sync` branch and [Custom Controller LED Sync and Enhanced Haptics\n#24](https://github.com/BnuuySolutions/PSVR2Toolkit/pull/24))\n- Adaptive triggers\n\nFor developers, we also have our own API library, which allows you to take full advantage of these features.\n\n\\* Eye tracking calibration is currently not available yet, we have a few things to work out before we are ready to ship this feature!\n\n## Installation Guide\n1.) Open Steam, go to the PS VR2 app, click on the cog wheel, and go to \"Manage -> Browse local files\". (If you are using a copy of the PS VR2 app not installed by Steam, go to that instead.)\n\n2.) Inside the newly opened file explorer, go into \"SteamVR_Plug-In\", then \"bin\" and finally \"win64\".\n\n3.) Rename \"driver_playstation_vr2.dll\" to \"driver_playstation_vr2_orig.dll\" (**IT MUST BE CALLED \"driver_playstation_vr2_orig.dll\", DO NOT RENAME IT TO ANYTHING ELSE, IT MUST BE EXACTLY THAT**)\n\n4.) Download the \"driver_playstation_vr2.dll\" attached in a release, and copy/move it into the same folder where \"driver_playstation_vr2_orig.dll\" is at.\n\n5.) Your \"win64\" directory should now have 2 DLL files inside it, \"driver_playstation_vr2.dll\" and \"driver_playstation_vr2_orig.dll\". If you do not have both of those files, you fucked something up.\n\n6.) Enjoy your new features, please give us feedback in our [Discord](https://discord.gg/jym8CgJPF3).\n\n# Contact\nHave any legal complaints or questions?\n- Email: `wdh at bnuuy.solutions`\n- Discord: `notahopper`\n"
  },
  {
    "path": "include/psvr2_toolkit_capi.h",
    "content": "#pragma once\n\n#include <windows.h>\n#include <inttypes.h>\n\n#define TRIGGER_EFFECT_CONTROL_POINT_NUM 10\n\nenum EResultType {\n  Result_None = 0,\n  Result_NotInitialized = 1,\n  Result_AlreadyInitialized = 2,\n};\n\nenum EVRControllerType {\n  VRController_Left = 0,\n  VRController_Right = 1,\n  VRController_Both = 2,\n};\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n  // Initialize the PS VR2 Toolkit CAPI library. You must call this function EXACTLY ONCE\n  // at the beginning of your program.\n  EResultType WINAPI psvr2_toolkit_init();\n\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_off(EVRControllerType controllerType);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_feedback(EVRControllerType controllerType, uint8_t position, uint8_t strength);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_weapon(EVRControllerType controllerType, uint8_t startPosition, uint8_t endPosition, uint8_t strength);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_vibration(EVRControllerType controllerType, uint8_t position, uint8_t amplitude, uint8_t frequency);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_multiple_position_feedback(EVRControllerType controllerType, uint8_t strength[TRIGGER_EFFECT_CONTROL_POINT_NUM]);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_slope_feedback(EVRControllerType controllerType, uint8_t startPosition, uint8_t endPosition, uint8_t startStrength, uint8_t endStrength);\n  EResultType WINAPI psvr2_toolkit_set_trigger_effect_multiple_position_vibration(EVRControllerType controllerType, uint8_t frequency, uint8_t amplitude[TRIGGER_EFFECT_CONTROL_POINT_NUM]);\n\n  EResultType WINAPI psvr2_toolkit_get_gaze_state();\n\n  /* Private functions */\n\n  EResultType WINAPI psvr2_toolkit_private_set_gaze_enabled_eye();\n\n  EResultType WINAPI psvr2_toolkit_private_start_gaze_calibration();\n  EResultType WINAPI psvr2_toolkit_private_stop_gaze_calibration();\n\n  EResultType WINAPI psvr2_toolkit_private_set_gaze_calibration_point();\n\n  /* Unknown gaze functions */\n\n  EResultType WINAPI psvr2_toolkit_private_gaze_0x08a964bcd9e0a1f4();\n  EResultType WINAPI psvr2_toolkit_private_gaze_0x913203ac32f332fd();\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/App.xaml",
    "content": "﻿<Application x:Class=\"PSVR2Toolkit.App.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:local=\"clr-namespace:PSVR2Toolkit.App\"\n             StartupUri=\"MainWindow.xaml\">\n    <Application.Resources>\n         \n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/App.xaml.cs",
    "content": "﻿using System.Windows;\n\nnamespace PSVR2Toolkit.App;\n\n/// <summary>\n/// Interaction logic for App.xaml\n/// </summary>\npublic partial class App : Application\n{\n}\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/AssemblyInfo.cs",
    "content": "using System.Windows;\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None,            //where theme specific resource dictionaries are located\n                                                //(used if a resource is not found in the page,\n                                                // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly   //where the generic resource dictionary is located\n                                                //(used if a resource is not found in the page,\n                                                // app, or any theme specific resource dictionaries)\n)]\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/MainWindow.xaml",
    "content": "﻿<Window x:Class=\"PSVR2Toolkit.App.MainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:local=\"clr-namespace:PSVR2Toolkit.App\"\n        mc:Ignorable=\"d\"\n        Title=\"MainWindow\" Height=\"450\" Width=\"800\">\n    <Grid>\n\n    </Grid>\n</Window>\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/MainWindow.xaml.cs",
    "content": "﻿using System.Windows;\n\nnamespace PSVR2Toolkit.App;\n\n/// <summary>\n/// Interaction logic for MainWindow.xaml\n/// </summary>\npublic partial class MainWindow : Window\n{\n    public MainWindow()\n    {\n        InitializeComponent();\n    }\n}\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/PSVR2Toolkit.App.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFramework>net472</TargetFramework>\n    <LangVersion>11</LangVersion>\n    <Nullable>enable</Nullable>\n    <UseWPF>true</UseWPF>\n    <Configurations>Debug;Release;ReleaseCI;DebugCI</Configurations>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Folder Include=\"Resources\\\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "projects/PSVR2Toolkit.App/Resources/.gitkeep",
    "content": ""
  },
  {
    "path": "projects/PSVR2Toolkit.IPC/IpcClient.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Net.Sockets;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace PSVR2Toolkit.CAPI {\n    public class IpcClient {\n        private const ushort IPC_SERVER_PORT = 3364;\n        private const ushort k_unIpcVersion = 2;\n\n        private static IpcClient m_pInstance;\n\n        private bool m_running = false;\n        private TcpClient? m_client;\n        private NetworkStream? m_stream;\n        private Thread? m_receiveThread;\n\n        private readonly object m_gazeStateLock = new object();\n        private TaskCompletionSource<CommandDataServerGazeDataResult>? m_gazeTask;\n        private CancellationTokenSource m_forceShutdownToken;\n        private ushort m_serverIpcVersion = k_unIpcVersion;\n        private int m_gazePumpPeriodMs = 8; // 120Hz\n        private CommandDataServerGazeDataResult2? m_lastGazeState = null;\n\n        public static IpcClient Instance() {\n            if ( m_pInstance == null ) {\n                m_pInstance = new IpcClient();\n            }\n            return m_pInstance;\n        }\n        public bool Start() {\n            if ( m_running ) {\n                return false;\n            }\n\n            try {\n                m_client = new TcpClient();\n                m_client.Connect(\"127.0.0.1\", IPC_SERVER_PORT);\n                if ( m_client.Connected ) {\n                    m_stream = m_client.GetStream();\n\n                    m_running = true;\n                    m_forceShutdownToken = new CancellationTokenSource();\n                    m_receiveThread = new Thread(() => ReceiveLoop(m_forceShutdownToken.Token));\n                    m_receiveThread.Start();\n                    return true;\n                }\n                return false;\n            } catch ( SocketException ex ) {\n                Console.WriteLine($\"[IPC_CLIENT] Connection failed. LastError = {ex.SocketErrorCode}\");\n                return false;\n            }\n        }\n\n        public void Stop() {\n            if ( !m_running ) {\n                return;\n            }\n\n            m_running = false;\n            m_forceShutdownToken.Cancel();\n\n            lock ( m_gazeStateLock ) {\n                m_gazeTask?.TrySetCanceled();\n                m_gazeTask = null;\n            }\n\n            try {\n                m_stream?.Close();\n                m_client?.Close();\n            } catch { }\n\n            if ( m_receiveThread != null && m_receiveThread.IsAlive ) {\n                if ( !m_receiveThread.Join(2000) ) {\n                    m_receiveThread.Interrupt();\n                }\n            }\n\n            m_stream?.Dispose();\n            m_client?.Dispose();\n            m_forceShutdownToken.Dispose();\n        }\n\n        private void ReceiveLoop(CancellationToken token) {\n            byte[] buffer = new byte[1024];\n\n            try {\n                var clientSocket = m_client!.Client;\n                m_stream!.ReadTimeout = 1; // make the underlying stream non-blocking\n\n                CommandDataClientRequestHandshake clientHandshakeRequest = new CommandDataClientRequestHandshake() {\n                    ipcVersion = k_unIpcVersion,\n                    processId = ( uint ) Process.GetCurrentProcess().Id\n                };\n                SendIpcCommand(ECommandType.ClientRequestHandshake, clientHandshakeRequest);\n\n                var sw = Stopwatch.StartNew();\n                long nextPumpMs = sw.ElapsedMilliseconds;\n\n                while ( m_running && !token.IsCancellationRequested ) {\n                    // query gaze state every so often\n                    var now = sw.ElapsedMilliseconds;\n                    if ( now >= nextPumpMs ) {\n                        SendIpcCommand(ECommandType.ClientRequestGazeData);\n                        nextPumpMs = now + m_gazePumpPeriodMs;\n                    }\n\n                    bool readable = clientSocket.Poll(1000 /* 1ms */, SelectMode.SelectRead);\n                    if ( readable && clientSocket.Available > 0 ) {\n                        int available = clientSocket.Available;\n                        if ( available > buffer.Length ) {\n                            buffer = new byte[Math.Max(available, buffer.Length * 2)];\n                        }\n\n                        int bytesRead = m_stream.Read(buffer, 0, Math.Min(buffer.Length, available));\n                        if ( bytesRead <= 0 ) {\n                            Console.WriteLine(\"[IPC_CLIENT] Disconnected from server.\");\n                            break;\n                        }\n\n                        if ( bytesRead < Marshal.SizeOf<CommandHeader>() ) {\n                            Console.WriteLine(\"[IPC_CLIENT] Received invalid command header size.\");\n                            continue;\n                        }\n\n                        HandleIpcCommand(buffer, bytesRead);\n                        continue;\n                    }\n\n                    Thread.Sleep(1);\n                }\n            } catch ( OperationCanceledException ) {\n                // nothing special, this is from shutdown most likely\n            } catch ( Exception ex ) {\n                if ( m_running ) {\n                    Console.WriteLine($\"[IPC_CLIENT] Error in receive loop: {ex.Message}\");\n                }\n            }\n        }\n\n        private GazeEyeResult2 UpgradeGazeEyeResult(GazeEyeResult eye)\n        {\n            return new GazeEyeResult2\n            {\n                isGazeOriginValid = eye.isGazeOriginValid,\n                gazeOriginMm = eye.gazeOriginMm,\n                isGazeDirValid = eye.isGazeDirValid,\n                gazeDirNorm = eye.gazeDirNorm,\n                isPupilDiaValid = eye.isPupilDiaValid,\n                pupilDiaMm = eye.pupilDiaMm,\n                isBlinkValid = eye.isBlinkValid,\n                blink = eye.blink,\n                isOpenEnabled = false,\n                open = 0f\n            };\n        }\n\n        private CommandDataServerGazeDataResult2 UpgradeGazeDataResult(CommandDataServerGazeDataResult result)\n        {\n            return new CommandDataServerGazeDataResult2\n            {\n                leftEye = UpgradeGazeEyeResult(result.leftEye),\n                rightEye = UpgradeGazeEyeResult(result.rightEye)\n            };\n        }\n\n        private void HandleIpcCommand(byte[] pBuffer, int bytesReceived) {\n            CommandHeader header = ByteArrayToStructure<CommandHeader>(pBuffer, 0);\n\n            switch ( header.type ) {\n                case ECommandType.ServerPong: {\n                        Console.WriteLine(\"[IPC_CLIENT] Received Pong from server.\");\n                        break;\n                    }\n\n                case ECommandType.ServerHandshakeResult: {\n                        if ( header.dataLen == Marshal.SizeOf<CommandDataServerHandshakeResult>() ) {\n                            CommandDataServerHandshakeResult response = ByteArrayToStructure<CommandDataServerHandshakeResult>(pBuffer, Marshal.SizeOf<CommandHeader>());\n                            m_serverIpcVersion = response.ipcVersion;\n                            switch ( response.result ) {\n                                case EHandshakeResult.Success: {\n                                        Console.WriteLine(\"[IPC_CLIENT] Handshake successful!\");\n                                        break;\n                                    }\n                                case EHandshakeResult.Failed: {\n                                        Console.WriteLine(\"[IPC_CLIENT] Handshake failed!\");\n                                        break;\n                                    }\n                                case EHandshakeResult.Outdated: {\n                                        Console.WriteLine($\"[IPC_CLIENT] Handshake failed with reason: Outdated client. Please upgrade to an IPC version of {response.ipcVersion}\");\n                                        break;\n                                    }\n                            }\n                        }\n                        break;\n                    }\n                case ECommandType.ServerGazeDataResult: {\n                        if ( m_serverIpcVersion == 1 ) {\n                            if ( header.dataLen == Marshal.SizeOf<CommandDataServerGazeDataResult>() ) {\n                                CommandDataServerGazeDataResult response = ByteArrayToStructure<CommandDataServerGazeDataResult>(pBuffer, Marshal.SizeOf<CommandHeader>());\n                                m_lastGazeState = UpgradeGazeDataResult(response);\n\n                            }\n                        } else {\n                            if ( header.dataLen == Marshal.SizeOf<CommandDataServerGazeDataResult2>() ) {\n                                CommandDataServerGazeDataResult2 response = ByteArrayToStructure<CommandDataServerGazeDataResult2>(pBuffer, Marshal.SizeOf<CommandHeader>());\n                                m_lastGazeState = response;\n\n                            }\n                        }\n                        break;\n                    }\n            }\n        }\n\n        private void SendIpcCommand<T>(ECommandType type, T data = default) where T : struct {\n            if ( !m_running )\n                return;\n\n            int dataLen = data.Equals(default(T)) ? 0 : Marshal.SizeOf<T>();\n            int bufferLen = Marshal.SizeOf<CommandHeader>() + dataLen;\n            byte[] buffer = new byte[bufferLen];\n\n            CommandHeader header = new CommandHeader\n            {\n                type = type,\n                dataLen = dataLen\n            };\n\n            IntPtr headerPtr = Marshal.AllocHGlobal(Marshal.SizeOf<CommandHeader>());\n            Marshal.StructureToPtr(header, headerPtr, false);\n            Marshal.Copy(headerPtr, buffer, 0, Marshal.SizeOf<CommandHeader>());\n            Marshal.FreeHGlobal(headerPtr);\n\n            if ( dataLen > 0 ) {\n                IntPtr dataPtr = Marshal.AllocHGlobal(dataLen);\n                Marshal.StructureToPtr(data, dataPtr, false);\n                Marshal.Copy(dataPtr, buffer, Marshal.SizeOf<CommandHeader>(), dataLen);\n                Marshal.FreeHGlobal(dataPtr);\n            }\n\n            m_stream.Write(buffer, 0, buffer.Length);\n        }\n\n        // no data\n        private void SendIpcCommand(ECommandType type) {\n            if ( !m_running )\n                return;\n\n            int bufferLen = Marshal.SizeOf<CommandHeader>();\n            byte[] buffer = new byte[bufferLen];\n\n            CommandHeader header = new CommandHeader\n            {\n                type = type,\n                dataLen = 0\n            };\n\n            IntPtr headerPtr = Marshal.AllocHGlobal(Marshal.SizeOf<CommandHeader>());\n            Marshal.StructureToPtr(header, headerPtr, false);\n            Marshal.Copy(headerPtr, buffer, 0, Marshal.SizeOf<CommandHeader>());\n            Marshal.FreeHGlobal(headerPtr);\n\n            m_stream.Write(buffer, 0, buffer.Length);\n        }\n\n        private T ByteArrayToStructure<T>(byte[] bytes, int offset) where T : struct {\n            int size = Marshal.SizeOf<T>();\n            if ( size > bytes.Length - offset ) {\n                throw new ArgumentException(\"Byte array is too small to contain the structure.\");\n            }\n\n            IntPtr ptr = Marshal.AllocHGlobal(size);\n            Marshal.Copy(bytes, offset, ptr, size);\n            T structure = (T)Marshal.PtrToStructure(ptr, typeof(T));\n            Marshal.FreeHGlobal(ptr);\n\n            return structure;\n        }\n\n        public CommandDataServerGazeDataResult2 RequestEyeTrackingData() {\n\n            if ( !m_running ) {\n                return new CommandDataServerGazeDataResult2();\n            }\n\n            return m_lastGazeState ?? new CommandDataServerGazeDataResult2();\n        }\n\n        public void TriggerEffectDisable(EVRControllerType controllerType) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectOff effectOff = new CommandDataClientTriggerEffectOff() {\n                controllerType = controllerType\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectOff, effectOff);\n        }\n\n        public void TriggerEffectFeedback(EVRControllerType controllerType, byte position, byte strength) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectFeedback effectFeedback = new CommandDataClientTriggerEffectFeedback() {\n                controllerType = controllerType,\n                position = position,\n                strength = strength,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectFeedback, effectFeedback);\n        }\n        public void TriggerEffectWeapon(EVRControllerType controllerType, byte startPosition, byte endPosition, byte strength) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectWeapon effectWeapon = new CommandDataClientTriggerEffectWeapon() {\n                controllerType = controllerType,\n                startPosition = startPosition,\n                endPosition = endPosition,\n                strength = strength,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectWeapon, effectWeapon);\n        }\n        public void TriggerEffectVibration(EVRControllerType controllerType, byte position, byte amplitude, byte frequency) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectVibration effectVibration = new CommandDataClientTriggerEffectVibration() {\n                controllerType = controllerType,\n                position = position,\n                amplitude = amplitude,\n                frequency = frequency,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectVibration, effectVibration);\n        }\n        public void TriggerEffectMultiplePositionFeedback(EVRControllerType controllerType, byte[] strength) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectMultiplePositionFeedback effectVibration = new CommandDataClientTriggerEffectMultiplePositionFeedback() {\n                controllerType = controllerType,\n                strength = strength,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectMultiplePositionFeedback, effectVibration);\n        }\n        public void TriggerEffectSlopeFeedback(EVRControllerType controllerType, byte startPosition, byte endPosition, byte startStrength, byte endStrength) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectSlopeFeedback effectVibration = new CommandDataClientTriggerEffectSlopeFeedback() {\n                controllerType = controllerType,\n                startPosition = startPosition,\n                endPosition = endPosition,\n                startStrength = startStrength,\n                endStrength = endStrength,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectSlopeFeedback, effectVibration);\n        }\n        public void TriggerEffectMultiplePositionVibration(EVRControllerType controllerType, byte frequency, byte[] amplitude) {\n            if ( !m_running ) {\n                return;\n            }\n\n            CommandDataClientTriggerEffectMultiplePositionVibration effectVibration = new CommandDataClientTriggerEffectMultiplePositionVibration() {\n                controllerType = controllerType,\n                frequency = frequency,\n                amplitude = amplitude,\n            };\n            SendIpcCommand(ECommandType.ClientTriggerEffectMultiplePositionVibration, effectVibration);\n        }\n    }\n}\n"
  },
  {
    "path": "projects/PSVR2Toolkit.IPC/IpcProtocol.cs",
    "content": "﻿using System.Runtime.InteropServices;\n\nnamespace PSVR2Toolkit.CAPI {\n    public enum ECommandType : ushort {\n        ClientPing, // No command data.\n        ServerPong, // No command data.\n\n        ClientRequestHandshake, // CommandDataClientRequestHandshake\n        ServerHandshakeResult, // CommandDataServerHandshakeResult\n\n        ClientRequestGazeData, // No command data.\n        ServerGazeDataResult, // CommandDataServerGazeDataResult\n\n        ClientTriggerEffectOff, // CommandDataClientTriggerEffectOff\n        ClientTriggerEffectFeedback, // CommandDataClientTriggerEffectFeedback\n        ClientTriggerEffectWeapon, // CommandDataClientTriggerEffectWeapon\n        ClientTriggerEffectVibration, // CommandDataClientTriggerEffectVibration\n        ClientTriggerEffectMultiplePositionFeedback, // CommandDataClientTriggerEffectMultiplePositionFeedback\n        ClientTriggerEffectSlopeFeedback, // CommandDataClientTriggerEffectSlopeFeedback\n        ClientTriggerEffectMultiplePositionVibration, // CommandDataClientTriggerEffectMultiplePositionVibration\n    };\n\n    public enum EHandshakeResult : byte {\n        Failed,\n        Success,\n        Outdated,\n    };\n\n    public enum EVRControllerType : byte {\n        Left,\n        Right,\n        Both,\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientRequestHandshake {\n        public ushort ipcVersion; // The IPC version this client is using.\n        public uint processId;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataServerHandshakeResult {\n        public EHandshakeResult result;\n        public ushort ipcVersion; // The IPC version the server is using.\n    };\n\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    public struct GazeVector3 {\n        public float x, y, z;\n    };\n\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    public struct GazeEyeResult {\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isGazeOriginValid;\n        public GazeVector3 gazeOriginMm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isGazeDirValid;\n        public GazeVector3 gazeDirNorm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isPupilDiaValid;\n        public float pupilDiaMm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isBlinkValid;\n        [MarshalAs(UnmanagedType.I1)]\n        public bool blink;\n    };\n\n    [StructLayout(LayoutKind.Sequential, Pack = 1)]\n    public struct GazeEyeResult2 {\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isGazeOriginValid;\n        public GazeVector3 gazeOriginMm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isGazeDirValid;\n        public GazeVector3 gazeDirNorm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isPupilDiaValid;\n        public float pupilDiaMm;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isBlinkValid;\n        [MarshalAs(UnmanagedType.I1)]\n        public bool blink;\n\n        [MarshalAs(UnmanagedType.I1)]\n        public bool isOpenEnabled;\n        public float open;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataServerGazeDataResult {\n        public GazeEyeResult leftEye;\n        public GazeEyeResult rightEye;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataServerGazeDataResult2 {\n        public GazeEyeResult2 leftEye;\n        public GazeEyeResult2 rightEye;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandHeader {\n        public ECommandType type;\n        public int dataLen;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectOff {\n        public EVRControllerType controllerType;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectFeedback {\n        public EVRControllerType controllerType;\n        public byte position;\n        public byte strength;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectWeapon {\n        public EVRControllerType controllerType;\n        public byte startPosition;\n        public byte endPosition;\n        public byte strength;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectVibration {\n        public EVRControllerType controllerType;\n        public byte position;\n        public byte amplitude;\n        public byte frequency;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectMultiplePositionFeedback {\n        public EVRControllerType controllerType;\n        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]\n        public byte[] strength;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectSlopeFeedback {\n        public EVRControllerType controllerType;\n        public byte startPosition;\n        public byte endPosition;\n        public byte startStrength;\n        public byte endStrength;\n    };\n\n    [StructLayout(LayoutKind.Sequential)]\n    public struct CommandDataClientTriggerEffectMultiplePositionVibration {\n        public EVRControllerType controllerType;\n        public byte frequency;\n        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]\n        public byte[] amplitude;\n    };\n}\n"
  },
  {
    "path": "projects/PSVR2Toolkit.IPC/PSVR2Toolkit.IPC.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>netstandard2.0</TargetFramework>\n    <LangVersion>11</LangVersion>\n    <Configurations>Debug;Release;ReleaseCI;DebugCI</Configurations>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"DebugCI|x64\">\n      <Configuration>DebugCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"ReleaseCI|x64\">\n      <Configuration>ReleaseCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{a17f69a1-4cbd-4b92-bead-d331a378533a}</ProjectGuid>\n    <RootNamespace>UnifiedTelemetryClient</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <TargetName>UnifiedTelemetry.Client</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <TargetName>UnifiedTelemetry.Client</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <TargetName>UnifiedTelemetry.Client</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <TargetName>UnifiedTelemetry.Client</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Client_stub/dllmain.cpp",
    "content": "extern \"C\" __declspec(dllexport) void utCreateClient() {}\nextern \"C\" __declspec(dllexport) void utDestroyClient() {}\nextern \"C\" __declspec(dllexport) void utInitClient() {}\nextern \"C\" __declspec(dllexport) void utGetUserClockTimestamp() {}\nextern \"C\" __declspec(dllexport) void utDispatch() {}\nextern \"C\" __declspec(dllexport) void utUserDispatch() {}\nextern \"C\" __declspec(dllexport) void utDispatchRecord() {}\nextern \"C\" __declspec(dllexport) void utGetCommonPropertiesObject() {}\nextern \"C\" __declspec(dllexport) void utCreateObject() {}\nextern \"C\" __declspec(dllexport) void utApplyObjectToEvent() {}\nextern \"C\" __declspec(dllexport) void utSetClientTransport() {}\n"
  },
  {
    "path": "projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"DebugCI|x64\">\n      <Configuration>DebugCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"ReleaseCI|x64\">\n      <Configuration>ReleaseCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{479C51AE-D86B-433F-ADAA-DCDD1646300A}</ProjectGuid>\n    <RootNamespace>UnifiedTelemetryModel</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <TargetName>UnifiedTelemetry.Model</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <TargetName>UnifiedTelemetry.Model</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <TargetName>UnifiedTelemetry.Model</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <TargetName>UnifiedTelemetry.Model</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Model_stub/dllmain.cpp",
    "content": "extern \"C\" __declspec(dllexport) void utSetString() {}\nextern \"C\" __declspec(dllexport) void utSetNumber() {}\nextern \"C\" __declspec(dllexport) void utSetFloat() {}\nextern \"C\" __declspec(dllexport) void utSetBoolean() {}\nextern \"C\" __declspec(dllexport) void utSetDate() {}\nextern \"C\" __declspec(dllexport) void utSetCurrentDate() {}\nextern \"C\" __declspec(dllexport) void utSetObject() {}\nextern \"C\" __declspec(dllexport) void utRemoveProperty() {}\nextern \"C\" __declspec(dllexport) void utCreateEvent() {}\nextern \"C\" __declspec(dllexport) void utGetEventJson() {}\nextern \"C\" __declspec(dllexport) void utDestroyEvent() {}\nextern \"C\" __declspec(dllexport) void utCreateEventObject() {}\nextern \"C\" __declspec(dllexport) void utCreateEventArray() {}\nextern \"C\" __declspec(dllexport) void utPushString() {}\nextern \"C\" __declspec(dllexport) void utPushInt() {}\nextern \"C\" __declspec(dllexport) void utPushFloat() {}\nextern \"C\" __declspec(dllexport) void utPushObject() {}\nextern \"C\" __declspec(dllexport) void utCreateSchemaFilter() {}\nextern \"C\" __declspec(dllexport) void utDestroySchemaFilter() {}\nextern \"C\" __declspec(dllexport) void utFilterEvent() {}\nextern \"C\" __declspec(dllexport) void utGetJsTime() {}\nextern \"C\" __declspec(dllexport) void utGetTracingId() {}\nextern \"C\" __declspec(dllexport) void utCreateEventFromJson() {}\nextern \"C\" __declspec(dllexport) void utGetSbahnDispatchUrl() {}\n"
  },
  {
    "path": "projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"DebugCI|x64\">\n      <Configuration>DebugCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"ReleaseCI|x64\">\n      <Configuration>ReleaseCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{40ADD18D-A928-4ABF-BE63-4591F53A4801}</ProjectGuid>\n    <RootNamespace>UnifiedTelemetryService</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <TargetName>UnifiedTelemetry.Service</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <TargetName>UnifiedTelemetry.Service</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <TargetName>UnifiedTelemetry.Service</TargetName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <TargetName>UnifiedTelemetry.Service</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n    <PostBuildEvent>\n      <Command>copy /Y \"$(TargetPath)\" \"$(SolutionDir)projects\\PSVR2Toolkit.App\\Resources\\$(TargetFileName)\"</Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"dllmain.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "projects/UnifiedTelemetry.Service_stub/dllmain.cpp",
    "content": "extern \"C\" __declspec(dllexport) void utCreateService() {}\nextern \"C\" __declspec(dllexport) void utDestroyService() {}\nextern \"C\" __declspec(dllexport) void utServiceInit() {}\nextern \"C\" __declspec(dllexport) void utGetTestConfig() {}\nextern \"C\" __declspec(dllexport) void utSetTestConfig() {}\nextern \"C\" __declspec(dllexport) void utServiceGetEventsInQueueLength() {}\nextern \"C\" __declspec(dllexport) void utServiceSetDeviceWs1Setting() {}\nextern \"C\" __declspec(dllexport) void utServiceSetUserInt() {}\nextern \"C\" __declspec(dllexport) void utServiceSetUserString() {}\nextern \"C\" __declspec(dllexport) void utServiceSetUserBoolean() {}\nextern \"C\" __declspec(dllexport) void utServiceRemoveUser() {}\nextern \"C\" __declspec(dllexport) void utGetServiceState() {}\nextern \"C\" __declspec(dllexport) void utServiceStart() {}\nextern \"C\" __declspec(dllexport) void utServiceStop() {}\nextern \"C\" __declspec(dllexport) void utCreateStaticServiceTransport() {}\nextern \"C\" __declspec(dllexport) void utApplyServiceConfigEventSchema() {}\nextern \"C\" __declspec(dllexport) void utGetServiceConfig() {}\nextern \"C\" __declspec(dllexport) void utSetServiceConfig() {}\nextern \"C\" __declspec(dllexport) void utServiceSetLogCallback() {}\nextern \"C\" __declspec(dllexport) void utServiceDispatchRecord() {}\nextern \"C\" __declspec(dllexport) void utSetAuthToken() {}\nextern \"C\" __declspec(dllexport) void utServicePushAdobeReportSuite() {}\nextern \"C\" __declspec(dllexport) void utServiceGetCommonPropertiesObject() {}\n"
  },
  {
    "path": "projects/libcustomshare/custom_share_manager.cpp",
    "content": "#include \"custom_share_manager.h\"\n\nCustomShareManager *CustomShareManager::m_pInstance = nullptr;\n\nvoid CustomShareManager::createSingleton() {\n  m_initialized = true;\n\n  CustomShareManager *pInstance = m_pInstance;\n  if (!m_pInstance) {\n    pInstance = new CustomShareManager;\n    m_pInstance = pInstance;\n  }\n\n  pInstance->initialize();\n}\n\nCustomShareManager *CustomShareManager::getSingleton() {\n  CustomShareManager *pInstance = m_pInstance;\n  if (!m_pInstance) {\n    pInstance = new CustomShareManager;\n    m_pInstance = pInstance;\n  }\n\n  return pInstance;\n}\n\nvoid CustomShareManager::initialize() {\n  const char *shareNames[2][2] = {\n    {\"CUSTOM_SHARE_VRT2_WIN_GAZE_EVT\", \"CUSTOM_SHARE_VRT2_WIN_GAZE_MTX\"}\n  };\n}\n"
  },
  {
    "path": "projects/libcustomshare/custom_share_manager.h",
    "content": "#pragma once\n\nclass CustomShareManager {\npublic:\n  static void createSingleton();\n  static CustomShareManager *getSingleton();\n\nprivate:\n  static CustomShareManager *m_pInstance;\n  static bool m_initialized;\n\n  void initialize();\n};\n"
  },
  {
    "path": "projects/libcustomshare/libcustomshare.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{eabc1d23-54f9-455f-9fb4-c0a7a01ca592}</ProjectGuid>\n    <RootNamespace>libcustomshare</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n    </ClCompile>\n    <Link>\n      <SubSystem>\n      </SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n    </ClCompile>\n    <Link>\n      <SubSystem>\n      </SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"custom_share_manager.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"custom_share_manager.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "projects/libcustomshare/libcustomshare.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"custom_share_manager.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"custom_share_manager.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/caesar_manager_hooks.cpp",
    "content": "#include \"caesar_manager_hooks.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"usb_thread_gaze.h\"\n#include \"vr_settings.h\"\n#include \"util.h\"\n\nnamespace psvr2_toolkit {\n\n  void *(*Framework__Thread__start)(void *thisptr) = nullptr;\n\n  void *(*CaesarManager__initialize)(void *, void *, void *) = nullptr;\n  void *CaesarManager__initializeHook(void *thisptr, void *arg1, void *arg2) {\n    static CaesarUsbThreadGaze* pCaesarUsbThreadGaze = CaesarUsbThreadGaze::Instance();\n\n    void* result = CaesarManager__initialize(thisptr, arg1, arg2);\n    (*(void (__fastcall **)(__int64, __int64))(*(__int64 *)pCaesarUsbThreadGaze + 24LL))((__int64)pCaesarUsbThreadGaze, 0);\n    Framework__Thread__start(pCaesarUsbThreadGaze);\n    return result;\n  }\n\n  void (*CaesarManager__shutdown)(void *) = nullptr;\n  void CaesarManager__shutdownHook(void *thisptr) {\n    static CaesarUsbThreadGaze *pCaesarUsbThreadGaze = CaesarUsbThreadGaze::Instance();\n\n    (*(void(__fastcall **)(__int64))(*(__int64 *)pCaesarUsbThreadGaze + 16LL))((__int64)pCaesarUsbThreadGaze);\n\n    CaesarManager__shutdown(thisptr);\n  }\n\n  void CaesarManagerHooks::InstallHooks() {\n    static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n    Framework__Thread__start = decltype(Framework__Thread__start)(pHmdDriverLoader->GetBaseAddress() + 0x16B660);\n\n    if (!VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_GAZE, SETTING_DISABLE_GAZE_DEFAULT_VALUE)) {\n      Util::DriverLog(\"Enabling PSVR2 gaze tracking...\");\n      // CaesarManager::initialize\n      HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x123130),\n                           reinterpret_cast<void *>(CaesarManager__initializeHook),\n                           reinterpret_cast<void **>(&CaesarManager__initialize));\n\n      // CaesarManager::shutdown\n      HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x128320),\n                           reinterpret_cast<void *>(CaesarManager__shutdownHook),\n                           reinterpret_cast<void **>(&CaesarManager__shutdown));\n    }\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/caesar_manager_hooks.h",
    "content": "#pragma once\n\nnamespace psvr2_toolkit {\n\n  class CaesarManagerHooks {\n  public:\n    static void InstallHooks();\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/config.h",
    "content": "#pragma once\n\n#define DRIVER_IS_STABLE false\n#define DRIVER_IS_PRERELEASE true\n#define DRIVER_IS_EXPERIMENTAL false\n\n#define DRIVER_VERSION_MAJOR 0\n#define DRIVER_VERSION_MINOR 2\n#define DRIVER_VERSION_PATCH 1\n\n#if DRIVER_IS_STABLE\n#define DRIVER_VERSION_BRANCH \"stable\"\n#elif DRIVER_IS_PRERELEASE\n#define DRIVER_VERSION_BRANCH \"prerelease\"\n#elif DRIVER_IS_EXPERIMENTAL\n#define DRIVER_VERSION_BRANCH \"experimental\"\n#else\n#define DRIVER_VERSION_BRANCH \"development\"\n#endif\n\n// Whether or not we should mock/fake running the driver on Wine.\n#define MOCK_IS_RUNNING_ON_WINE false\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/device_provider_proxy.cpp",
    "content": "#include \"device_provider_proxy.h\"\n\n#include \"config.h\"\n#include \"caesar_manager_hooks.h\"\n#include \"driver_context_proxy.h\"\n#include \"hmd_device_hooks.h\"\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"ipc_server.h\"\n#include \"trigger_effect_manager.h\"\n#include \"usb_thread_hooks.h\"\n#include \"util.h\"\n#include \"vr_settings.h\"\n\n#include <windows.h>\n\nusing namespace psvr2_toolkit::ipc;\n\nnamespace psvr2_toolkit {\n\n  DeviceProviderProxy *DeviceProviderProxy::m_pInstance = nullptr;\n\n  DeviceProviderProxy::DeviceProviderProxy()\n    : m_initOnce(false)\n    , m_pDeviceProvider(nullptr)\n  {}\n\n  DeviceProviderProxy *DeviceProviderProxy::Instance() {\n    if (!m_pInstance) {\n      m_pInstance = new DeviceProviderProxy;\n    }\n\n    return m_pInstance;\n  }\n\n  void DeviceProviderProxy::SetDeviceProvider(vr::IServerTrackedDeviceProvider *pDeviceProvider) {\n    m_pDeviceProvider = pDeviceProvider;\n  }\n\n  vr::EVRInitError DeviceProviderProxy::Init(vr::IVRDriverContext *pDriverContext) {\n#if _DEBUG\n    Sleep(8000);\n#endif\n\n    VR_INIT_SERVER_DRIVER_CONTEXT(pDriverContext);\n\n    if (!m_initOnce) {\n      InitOnce();\n      m_initOnce = true;\n    }\n\n    IpcServer::Instance()->Start();\n\n    static DriverContextProxy *pDriverContextProxy = DriverContextProxy::Instance();\n    pDriverContextProxy->SetDriverContext(pDriverContext);\n    return m_pDeviceProvider->Init(pDriverContextProxy);\n  }\n\n  void DeviceProviderProxy::Cleanup() {\n    IpcServer::Instance()->Stop();\n\n    m_pDeviceProvider->Cleanup();\n\n    VR_CLEANUP_SERVER_DRIVER_CONTEXT();\n  }\n\n  const char *const *DeviceProviderProxy::GetInterfaceVersions() {\n    return m_pDeviceProvider->GetInterfaceVersions();\n  }\n\n  void DeviceProviderProxy::RunFrame() {\n    m_pDeviceProvider->RunFrame();\n  }\n\n  bool DeviceProviderProxy::ShouldBlockStandbyMode() {\n    return m_pDeviceProvider->ShouldBlockStandbyMode();\n  }\n\n  void DeviceProviderProxy::EnterStandby() {\n    m_pDeviceProvider->EnterStandby();\n  }\n\n  void DeviceProviderProxy::LeaveStandby() {\n    m_pDeviceProvider->LeaveStandby();\n  }\n\n  void DeviceProviderProxy::InitOnce() {\n    static bool isRunningOnWine = Util::IsRunningOnWine();\n\n    // Log ourselves here to show that we're proxied.\n    Util::DriverLog(\"PlayStation VR2 Toolkit - v{}.{}.{} [{}]\", DRIVER_VERSION_MAJOR, DRIVER_VERSION_MINOR, DRIVER_VERSION_PATCH, DRIVER_VERSION_BRANCH);\n#if DRIVER_IS_PRERELEASE\n    Util::DriverLog(\"You are using a pre-release build of PlayStation VR2 Toolkit, please report any issues that may occur to the developers!\");\n#elif DRIVER_IS_EXPERIMENTAL\n    Util::DriverLog(\"You are using an experimental build of PlayStation VR2 Toolkit, please report any issues that may occur to the developers!\");\n#endif\n\n    if (!HookLib::Initialize()) {\n      MessageBoxW(nullptr, L\"MinHook initialization failed, please report this to the developers!\", L\"PlayStation VR2 Toolkit (DriverEx)\", MB_ICONERROR | MB_OK);\n    }\n\n    if (isRunningOnWine) {\n      Util::DriverLog(\"PlayStation VR2 Toolkit has detected itself running on Wine, compatibility patches will be applied.\");\n    }\n\n    InitPatches();\n    InitSystems();\n  }\n\n  void DeviceProviderProxy::InitPatches() {\n    static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n    static bool isRunningOnWine = Util::IsRunningOnWine();\n\n    // Remove signature checks.\n    INSTALL_STUB_RET0(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x134FF0)); // VrDialogManager::VerifyLibrary\n\n    INSTALL_STUB(reinterpret_cast<void*>(pHmdDriverLoader->GetBaseAddress() + 0x12F830)); // VrDialogManager::CreateDashboardProcess\n    INSTALL_STUB(reinterpret_cast<void*>(pHmdDriverLoader->GetBaseAddress() + 0x130020)); // VrDialogManager::CreateDialogProcess\n\n    CaesarManagerHooks::InstallHooks();\n    HmdDeviceHooks::InstallHooks();\n    UsbThreadHooks::InstallHooks();\n  }\n\n  void DeviceProviderProxy::InitSystems() {\n    IpcServer::Instance()->Initialize();\n    TriggerEffectManager::Instance()->Initialize();\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/device_provider_proxy.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n  class DeviceProviderProxy : public vr::IServerTrackedDeviceProvider {\n  public:\n    DeviceProviderProxy();\n\n    static DeviceProviderProxy *Instance();\n\n    void SetDeviceProvider(vr::IServerTrackedDeviceProvider *pDeviceProvider);\n\n    /** IServerTrackedDeviceProvider **/\n\n    vr::EVRInitError Init(vr::IVRDriverContext *pDriverContext) override;\n    void Cleanup() override;\n    const char *const *GetInterfaceVersions() override;\n    void RunFrame() override;\n    bool ShouldBlockStandbyMode() override;\n    void EnterStandby() override;\n    void LeaveStandby() override;\n\n  private:\n    static DeviceProviderProxy *m_pInstance;\n\n    bool m_initOnce;\n\n    vr::IServerTrackedDeviceProvider *m_pDeviceProvider;\n\n    void InitOnce();\n\n    void InitPatches();\n    void InitSystems();\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/driver_context_proxy.cpp",
    "content": "#include \"driver_context_proxy.h\"\n\n#include \"driver_host_proxy.h\"\n\nnamespace psvr2_toolkit {\n\n  DriverContextProxy *DriverContextProxy::m_pInstance = nullptr;\n\n  DriverContextProxy::DriverContextProxy()\n    : m_pDriverContext(nullptr)\n  {}\n\n  DriverContextProxy *DriverContextProxy::Instance() {\n    if (!m_pInstance) {\n      m_pInstance = new DriverContextProxy;\n    }\n\n    return m_pInstance;\n  }\n\n  void DriverContextProxy::SetDriverContext(vr::IVRDriverContext *pDriverContext) {\n    m_pDriverContext = pDriverContext;\n  }\n\n  void *DriverContextProxy::GetGenericInterface(const char *pchInterfaceVersion, vr::EVRInitError *peError) {\n    void *result = m_pDriverContext->GetGenericInterface(pchInterfaceVersion, peError);\n\n    // Depends on our OpenVR driver SDK version matching the one inside the PS VR2 driver.\n    if (strcmp(vr::IVRServerDriverHost_Version, pchInterfaceVersion) == 0) {\n      static DriverHostProxy *pDriverHostProxy = DriverHostProxy::Instance();\n      pDriverHostProxy->SetDriverHost(static_cast<vr::IVRServerDriverHost *>(result));\n      return pDriverHostProxy;\n    }\n\n    return result;\n  }\n\n  vr::DriverHandle_t DriverContextProxy::GetDriverHandle() {\n    return m_pDriverContext->GetDriverHandle();\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/driver_context_proxy.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n  class DriverContextProxy : public vr::IVRDriverContext {\n  public:\n    DriverContextProxy();\n\n    static DriverContextProxy *Instance();\n\n    void SetDriverContext(vr::IVRDriverContext *pDriverContext);\n\n    /** IVRDriverContext **/\n\n    void *GetGenericInterface(const char *pchInterfaceVersion, vr::EVRInitError *peError = nullptr) override;\n    vr::DriverHandle_t GetDriverHandle() override;\n\n  private:\n    static DriverContextProxy *m_pInstance;\n\n    vr::IVRDriverContext *m_pDriverContext;\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/driver_host_proxy.cpp",
    "content": "#include \"driver_host_proxy.h\"\n\n#include \"hmd_math.h\"\n#include \"util.h\"\n#include \"vr_settings.h\"\n\n#include <cstdint>\n\nnamespace psvr2_toolkit {\n\n  /* Hardcoded device indexes, in order of when they are registered inside the driver. */\n\n  static constexpr uint32_t k_unDeviceIndexHeadset = 0; // Currently not used.\n  static constexpr uint32_t k_unDeviceIndexSenseControllerLeft = 1;\n  static constexpr uint32_t k_unDeviceIndexSenseControllerRight = 2;\n\n  DriverHostProxy *DriverHostProxy::m_pInstance = nullptr;\n\n  DriverHostProxy::DriverHostProxy()\n    : m_pDriverHost(nullptr)\n    , m_pfnEventHandlers()\n  {}\n  \n  DriverHostProxy *DriverHostProxy::Instance() {\n    if (!m_pInstance) {\n      m_pInstance = new DriverHostProxy;\n    }\n\n    return m_pInstance;\n  }\n\n  void DriverHostProxy::SetDriverHost(vr::IVRServerDriverHost *pDriverHost) {\n    m_pDriverHost = pDriverHost;\n  }\n\n  void DriverHostProxy::AddEventHandler(void (*pfnEventHandler)(vr::VREvent_t *)) {\n    m_pfnEventHandlers.push_back(pfnEventHandler);\n  }\n\n  bool DriverHostProxy::TrackedDeviceAdded(const char *pchDeviceSerialNumber, vr::ETrackedDeviceClass eDeviceClass, vr::ITrackedDeviceServerDriver *pDriver) {\n    if (Util::StartsWith(pchDeviceSerialNumber, \"playstation_vr2_sense_controller_\") &&\n        VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_SENSE, SETTING_DISABLE_SENSE_DEFAULT_VALUE))\n    {\n      return false;\n    }\n\n    return m_pDriverHost->TrackedDeviceAdded(pchDeviceSerialNumber, eDeviceClass, pDriver);\n  }\n\n  void DriverHostProxy::TrackedDevicePoseUpdated(uint32_t unWhichDevice, const vr::DriverPose_t &newPose, uint32_t unPoseStructSize) {\n    if (unWhichDevice != k_unDeviceIndexSenseControllerLeft && unWhichDevice != k_unDeviceIndexSenseControllerRight) {\n      return m_pDriverHost->TrackedDevicePoseUpdated(unWhichDevice, newPose, unPoseStructSize);\n    }\n\n    return m_pDriverHost->TrackedDevicePoseUpdated(unWhichDevice, GetPose(unWhichDevice, newPose), unPoseStructSize);\n  }\n\n  void DriverHostProxy::VsyncEvent(double vsyncTimeOffsetSeconds) {\n    m_pDriverHost->VsyncEvent(vsyncTimeOffsetSeconds);\n  }\n\n  void DriverHostProxy::VendorSpecificEvent(uint32_t unWhichDevice, vr::EVREventType eventType, const vr::VREvent_Data_t &eventData, double eventTimeOffset) {\n    m_pDriverHost->VendorSpecificEvent(unWhichDevice, eventType, eventData, eventTimeOffset);\n  }\n\n  bool DriverHostProxy::IsExiting() {\n    return m_pDriverHost->IsExiting();\n  }\n\n  bool DriverHostProxy::PollNextEvent(vr::VREvent_t *pEvent, uint32_t uncbVREvent) {\n    if (m_pDriverHost->PollNextEvent(pEvent, uncbVREvent)) {\n      for (auto& m_pfnEventHandler : m_pfnEventHandlers) {\n        m_pfnEventHandler(pEvent);\n      }\n      return true;\n    }\n    return false;\n  }\n\n  void DriverHostProxy::GetRawTrackedDevicePoses(float fPredictedSecondsFromNow, vr::TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount) {\n    m_pDriverHost->GetRawTrackedDevicePoses(fPredictedSecondsFromNow, pTrackedDevicePoseArray, unTrackedDevicePoseArrayCount);\n  }\n\n  void DriverHostProxy::RequestRestart(const char *pchLocalizedReason, const char *pchExecutableToStart, const char *pchArguments, const char *pchWorkingDirectory) {\n    m_pDriverHost->RequestRestart(pchLocalizedReason, pchExecutableToStart, pchArguments, pchWorkingDirectory);\n  }\n\n  uint32_t DriverHostProxy::GetFrameTimings(vr::Compositor_FrameTiming *pTiming, uint32_t nFrames) {\n    return m_pDriverHost->GetFrameTimings(pTiming, nFrames);\n  }\n\n  void DriverHostProxy::SetDisplayEyeToHead(uint32_t unWhichDevice, const vr::HmdMatrix34_t &eyeToHeadLeft, const vr::HmdMatrix34_t &eyeToHeadRight) {\n    m_pDriverHost->SetDisplayEyeToHead(unWhichDevice, eyeToHeadLeft, eyeToHeadRight);\n  }\n\n  void DriverHostProxy::SetDisplayProjectionRaw(uint32_t unWhichDevice, const vr::HmdRect2_t &eyeLeft, const vr::HmdRect2_t &eyeRight) {\n    m_pDriverHost->SetDisplayProjectionRaw(unWhichDevice, eyeLeft, eyeRight);\n  }\n\n  void DriverHostProxy::SetRecommendedRenderTargetSize(uint32_t unWhichDevice, uint32_t nWidth, uint32_t nHeight) {\n    m_pDriverHost->SetRecommendedRenderTargetSize(unWhichDevice, nWidth, nHeight);\n  }\n\n  vr::DriverPose_t DriverHostProxy::GetPose(uint32_t unWhichDevice, const vr::DriverPose_t &originalPose) {\n    static vr::HmdQuaternion_t imuRotationOffset = HmdMath::EulerToQuaternion(0, 0, 0.680678427219391);\n    static vr::HmdQuaternion_t imuRotationOffsetInverse = HmdMath::QuaternionInverse(imuRotationOffset);\n\n    // Whether this is the left controller or not.\n    bool isLeft = unWhichDevice == k_unDeviceIndexSenseControllerLeft;\n\n    // Our new pose is a copy of the original pose.\n    vr::DriverPose_t newPose = originalPose;\n\n    // Apply inverse of imuRotationOffset to qRotation.\n    newPose.qRotation = HmdMath::QuaternionMultiply(newPose.qRotation, imuRotationOffsetInverse);\n\n    // PS VR2 driver pose offset.\n    vr::HmdVector3d_t poseOffset = {isLeft ? 0.03439270332455635 : -0.03439270332455635, 0.05370872840285301, -0.09804324805736542};\n\n    // Rotate the offset by the new rotation.\n    vr::HmdVector3d_t rotationOffset = HmdMath::RotateVectorByQuaternion(poseOffset, newPose.qRotation);\n\n    // Adjust position (negate the offset from the driver).\n    newPose.vecPosition[0] -= rotationOffset.v[0];\n    newPose.vecPosition[1] -= rotationOffset.v[1];\n    newPose.vecPosition[2] -= rotationOffset.v[2];\n\n    // Offset from the driver's root to the IMU. Given by the PS VR2 driver.\n    // We'll also have to factor it to make the result pose identical to the one from the driver.\n    vr::HmdVector3d_t imuOffset = {isLeft ? -0.00937270000576973 : 0.020072702318429947, 0.012248100712895393, 0.006003900431096554};\n\n    // Rotate IMU offset to counteract the rotation we did on qRotation. See next comment.\n    imuOffset = HmdMath::RotateVectorByQuaternion(imuOffset, imuRotationOffset);\n\n    poseOffset.v[0] += imuOffset.v[0];\n    poseOffset.v[1] += imuOffset.v[1];\n    poseOffset.v[2] += imuOffset.v[2];\n\n    newPose.vecDriverFromHeadTranslation[0] = poseOffset.v[0];\n    newPose.vecDriverFromHeadTranslation[1] = poseOffset.v[1];\n    newPose.vecDriverFromHeadTranslation[2] = poseOffset.v[2];\n\n    // Since qRotation was rotated by the inverse of imuRotationOffset, we'll have to counteract it.\n    newPose.qDriverFromHeadRotation = imuRotationOffset;\n\n    return newPose;\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/driver_host_proxy.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\n#include <list>\n\nnamespace psvr2_toolkit {\n\n  class DriverHostProxy : public vr::IVRServerDriverHost {\n  public:\n    DriverHostProxy();\n\n    static DriverHostProxy *Instance();\n\n    void SetDriverHost(vr::IVRServerDriverHost *pDriverHost);\n    void AddEventHandler(void (*pfnEventHandler)(vr::VREvent_t *)); // Required for intercepting polled events from the PS VR2 driver.\n\n    /** IVRServerDriverHost **/\n\n    bool TrackedDeviceAdded(const char *pchDeviceSerialNumber, vr::ETrackedDeviceClass eDeviceClass, vr::ITrackedDeviceServerDriver *pDriver) override;\n    void TrackedDevicePoseUpdated(uint32_t unWhichDevice, const vr::DriverPose_t &newPose, uint32_t unPoseStructSize) override;\n    void VsyncEvent(double vsyncTimeOffsetSeconds) override;\n    void VendorSpecificEvent(uint32_t unWhichDevice, vr::EVREventType eventType, const vr::VREvent_Data_t &eventData, double eventTimeOffset) override;\n    bool IsExiting() override;\n    bool PollNextEvent(vr::VREvent_t *pEvent, uint32_t uncbVREvent) override;\n    void GetRawTrackedDevicePoses(float fPredictedSecondsFromNow, vr::TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount) override;\n    void RequestRestart(const char *pchLocalizedReason, const char *pchExecutableToStart, const char *pchArguments, const char *pchWorkingDirectory) override;\n    uint32_t GetFrameTimings(vr::Compositor_FrameTiming *pTiming, uint32_t nFrames) override;\n    void SetDisplayEyeToHead(uint32_t unWhichDevice, const vr::HmdMatrix34_t &eyeToHeadLeft, const vr::HmdMatrix34_t &eyeToHeadRight) override;\n    void SetDisplayProjectionRaw(uint32_t unWhichDevice, const vr::HmdRect2_t &eyeLeft, const vr::HmdRect2_t &eyeRight) override;\n    void SetRecommendedRenderTargetSize(uint32_t unWhichDevice, uint32_t nWidth, uint32_t nHeight) override;\n\n  private:\n    static DriverHostProxy *m_pInstance;\n\n    vr::IVRServerDriverHost *m_pDriverHost;\n    std::list<void (*)(vr::VREvent_t *)> m_pfnEventHandlers;\n\n    // Used internally for controller pose correction.\n    vr::DriverPose_t GetPose(uint32_t unWhichDevice, const vr::DriverPose_t &originalPose);\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/eyelid_estimator.cpp",
    "content": "#include \"eyelid_estimator.h\"\n\n#include <algorithm>\n#include <cmath>\n\nnamespace psvr2_toolkit {\n\n  // parameters\n  static constexpr float openLR = 0.001f; // slow open adaptation\n  static constexpr float closedLR = 0.01f;  // faster closed adaptation\n  static constexpr float smoothAlpha = 0.2f;   // EMA smoothing\n\n  EyelidEstimator::EyelidEstimator()\n    : m_openDia(4.0f)\n    , m_closedDia(2.0f)\n    , m_sensorYOpen(0.55f)\n    , m_sensorYClosed(0.45f)\n    , m_lastOpenness(1.0f)\n  {}\n\n  bool EyelidEstimator::IsNeutral(const Hmd2GazeEye &eye) const {\n    if (eye.isGazeDirValid == HMD2_BOOL_FALSE) {\n      return false;\n    }\n\n    // Forward assumed to be (0,0,1). Require within ~20deg of forward.\n    return eye.gazeDirNorm.z > 0.94f;\n  }\n\n  float EyelidEstimator::Estimate(const Hmd2GazeEye &eye) {\n    if (eye.isBlinkValid && eye.blink == HMD2_BOOL_TRUE) {\n      // Update CLOSED reference on blink\n      if (eye.isPupilDiaValid) {\n        m_closedDia = m_closedDia * (1.0f - closedLR) +\n          eye.pupilDiaMm * closedLR;\n      }\n      if (eye.isPupilPosInSensorValid) {\n        m_sensorYClosed = m_sensorYClosed * (1.0f - closedLR) +\n          eye.pupilPosInSensor.y * closedLR;\n      }\n    } else if (eye.isPupilDiaValid && eye.isPupilPosInSensorValid && IsNeutral(eye)) {\n      // Update OPEN reference only if gaze is neutral\n      bool stable = std::fabs(eye.pupilDiaMm - m_openDia) < 1.0f;\n      if (stable) {\n        m_openDia = m_openDia * (1.0f - openLR) +\n          eye.pupilDiaMm * openLR;\n        m_sensorYOpen = m_sensorYOpen * (1.0f - openLR) +\n          eye.pupilPosInSensor.y * openLR;\n      }\n    }\n\n    float opennessRaw = m_lastOpenness;\n    if (eye.isBlinkValid && eye.blink == HMD2_BOOL_TRUE) {\n      opennessRaw = 0.0f; // explicit blink\n    } else if (eye.isPupilDiaValid && eye.isPupilPosInSensorValid) {\n      float denomDia = std::max(1e-6f, m_openDia - m_closedDia);\n      float normDia = (eye.pupilDiaMm - m_closedDia) / denomDia;\n      normDia = std::clamp(normDia, 0.0f, 1.0f);\n\n      float denomPos = std::max(1e-6f, m_sensorYOpen - m_sensorYClosed);\n      float normPos = (eye.pupilPosInSensor.y - m_sensorYClosed) / denomPos;\n      normPos = std::clamp(normPos, 0.0f, 1.0f);\n\n      // Weight cues based on gaze vertical angle\n      float gazeWeight = 1.0f;\n      if (eye.isGazeDirValid) {\n        float vertical = eye.gazeDirNorm.y; // +up, -down\n        gazeWeight = std::clamp(1.0f - std::fabs(vertical) * 1.5f, 0.2f, 1.0f);\n      }\n\n      opennessRaw = gazeWeight * (0.65f * normDia + 0.35f * normPos)\n        + (1.0f - gazeWeight) * normDia; // fallback to diameter when gaze extreme\n    } else {\n      // Missing data ? decay toward closed\n      opennessRaw = m_lastOpenness * 0.9f;\n    }\n\n    float openness = m_lastOpenness * (1.0f - smoothAlpha) +\n      opennessRaw * smoothAlpha;\n    m_lastOpenness = openness;\n\n    return openness; // 0 = closed, 1 = open\n  }\n\n}\n\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/eyelid_estimator.h",
    "content": "#pragma once\n\n#include \"hmd2_gaze.h\"\n\nnamespace psvr2_toolkit {\n\n  class EyelidEstimator {\n  public:\n    EyelidEstimator();\n\n    float Estimate(const Hmd2GazeEye &eye);\n\n  private:\n    float m_openDia;\n    float m_closedDia;\n    float m_sensorYOpen;\n    float m_sensorYClosed;\n    float m_lastOpenness;\n\n    bool IsNeutral(const Hmd2GazeEye &eye) const;\n  };\n\n}\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd2_gaze.h",
    "content": "#pragma once\n\n#include <cstdint>\n\ntypedef enum {\n  HMD2_BOOL_FALSE = 0,\n  HMD2_BOOL_TRUE = 1\n} Hmd2Bool;\n\ntypedef struct {\n  float x, y;\n} Hmd2Vector2;\n\ntypedef struct {\n  float x, y, z;\n} Hmd2Vector3;\n\ntypedef struct {\n  Hmd2Bool isGazeOriginValid;\n  Hmd2Vector3 gazeOriginMm;\n\n  Hmd2Bool isGazeDirValid;\n  Hmd2Vector3 gazeDirNorm;\n\n  Hmd2Bool isPupilDiaValid;\n  float pupilDiaMm;\n\n  Hmd2Bool isPupilPosInSensorValid;\n  Hmd2Vector2 pupilPosInSensor;\n\n  Hmd2Bool isPosGuideValid;\n  Hmd2Vector2 posGuide;\n\n  Hmd2Bool isBlinkValid;\n  Hmd2Bool blink;\n} Hmd2GazeEye;\n\nstruct Hmd2GazeCombined {\n  Hmd2Bool isGazeOriginValid;\n  Hmd2Vector3 gazeOriginMm;\n\n  Hmd2Bool isGazeDirValid;\n  Hmd2Vector3 gazeDirNorm;\n\n  Hmd2Bool isValid;\n  uint32_t timestamp;\n\n  Hmd2Bool unk06;\n  float unk07;\n\n  Hmd2Bool unk08;\n\n  // All gazes seem to be repeated here?\n  // No obvious differences here.\n  Hmd2Vector3 leftGazeDirNormal;\n  Hmd2Vector3 rightGazeDirNormal;\n  Hmd2Vector3 combinedGazeDirNormal;\n\n  float unk09;\n};\n\nstruct Hmd2GazeState {\n  char magic[2];\n  uint16_t version;\n  uint32_t size;\n\n  float unk03; // 0.700\n  float unk04; // 0.700\n\n  uint32_t unk05; // 0xFFFFF\n\n  // Appears to be related to some sort of timestamp?\n  uint32_t timestamp06;\n  uint32_t timestamp07;\n  uint32_t timestamp08;\n\n  uint32_t unk09;\n\n  float leftEyeXPosMm; // Example: -32.000 (64mm IPD)\n\n  uint32_t unk11;\n  uint32_t unk12;\n\n  float rightEyeXPosMm; // Example: 32.000 (64mm IPD)\n\n  uint32_t unk14;\n  uint32_t unk15;\n  uint32_t unk16;\n  uint32_t unk17;\n  uint32_t unk18;\n\n  float eyeZPosMm; // -27.000\n\n  // More unknown garbage.\n  uint32_t unk20;\n  uint32_t timestamp21;\n  uint32_t unk22;\n  uint32_t timestamp23;\n\n  Hmd2GazeEye leftEye;\n  Hmd2GazeEye rightEye;\n  Hmd2GazeCombined combined;\n};\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_device_hooks.cpp",
    "content": "#ifdef OPENVR_EXTENSIONS_AVAILABLE\n#include \"psvr2_openvr_driver/openvr_ex/openvr_ex.h\"\n#endif\n\n#include \"driver_host_proxy.h\"\n#include \"hmd2_gaze.h\"\n#include \"hmd_device_hooks.h\"\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"vr_settings.h\"\n#include \"util.h\"\n\n#include <cmath>\n#include <cstdint>\n\nnamespace psvr2_toolkit {\n  void* (*CaesarManager__getInstance)();\n  uint64_t (*CaesarManager__getIMUTimestampOffset)(void* thisptr, int64_t* hmdToHostOffset);\n  void* (*ShareManager__getInstance)();\n  void (*ShareManager__getIntConfig)(void* thisPtr, uint32_t configId, int64_t* outValue);\n  void (*ShareManager__setIntConfig)(void* thisPtr, uint32_t configId, int64_t* value);\n\n#ifdef OPENVR_EXTENSIONS_AVAILABLE\n  void* g_pOpenVRExHandle = nullptr;\n#endif\n  vr::VRInputComponentHandle_t eyeTrackingComponent = vr::k_ulInvalidInputComponentHandle;\n  int64_t currentBrightness;\n\n  vr::EVRInitError (*sie__psvr2__HmdDevice__Activate)(void *, uint32_t) = nullptr;\n  vr::EVRInitError sie__psvr2__HmdDevice__ActivateHook(void *thisptr, uint32_t unObjectId) {\n    vr::EVRInitError result = sie__psvr2__HmdDevice__Activate(thisptr, unObjectId);\n    vr::PropertyContainerHandle_t ulPropertyContainer = vr::VRProperties()->TrackedDeviceToPropertyContainer(unObjectId);\n\n    // Tell SteamVR we want the chaperone visibility disabled if we're actually disabling the chaperone.\n    if (VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_CHAPERONE, SETTING_DISABLE_CHAPERONE_DEFAULT_VALUE)) {\n      vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DriverProvidedChaperoneVisibility_Bool, false);\n    }\n\n    // Tell SteamVR to allow runtime framerate changes.\n    // SteamVR does not allow this feature on AMD GPUs, so this is NVIDIA-only currently.\n    vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplaySupportsRuntimeFramerateChange_Bool, true);\n\n    // Tell SteamVR to allow night mode setting.\n    vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplayAllowNightMode_Bool, true);\n\n    // Tell SteamVR we support brightness controls.\n    vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplaySupportsAnalogGain_Bool, true);\n    vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DisplayMinAnalogGain_Float, 0.0f);\n    vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DisplayMaxAnalogGain_Float, 1.0f);\n\n    // Fill in brightness from PSVR2 config to SteamVR settings key.\n    // Also, \"analogGain\" is stored as a gamma corrected value.\n    ShareManager__getIntConfig(ShareManager__getInstance(), 2, &currentBrightness);\n    vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, \"analogGain\", powf(static_cast<float>(currentBrightness) / 31.0f, 2.2f));\n\n    // Set event handler for when brightness (\"analogGain\") changes.\n    DriverHostProxy::Instance()->AddEventHandler([](vr::VREvent_t* event) {\n      if (event->eventType == vr::EVREventType::VREvent_SteamVRSectionSettingChanged) {\n        float currentFloatBrightness = powf(vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, \"analogGain\"), 1 / 2.2f);\n        if (static_cast<int64_t>(ceilf(currentFloatBrightness * 31.0f)) != currentBrightness)\n        {\n          currentBrightness = static_cast<int64_t>(ceilf(currentFloatBrightness * 31.0f));\n          ShareManager__setIntConfig(ShareManager__getInstance(), 2, &currentBrightness);\n        }\n      }\n    });\n\n    // Tell SteamVR our dashboard scale.\n    vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DashboardScale_Float, .9f);\n\n    vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_SupportsXrEyeGazeInteraction_Bool, true);\n\n    if (vr::VRDriverInput())\n    {\n        vr::EVRInputError result = (vr::VRDriverInput())->CreateEyeTrackingComponent(ulPropertyContainer, \"/eyetracking\", &eyeTrackingComponent);\n        if (result != vr::VRInputError_None) {\n            vr::VRDriverLog()->Log(\"Failed to create eye tracking component.\");\n        }\n    }\n    else\n    {\n        vr::VRDriverLog()->Log(\"Failed to get driver input interface. Are you on the latest version of SteamVR?\");\n    }\n\n#ifdef OPENVR_EXTENSIONS_AVAILABLE\n    psvr2_toolkit::openvr_ex::OnHmdActivate(ulPropertyContainer, &g_pOpenVRExHandle);\n#endif\n\n    return result;\n  }\n\n  void (*sie__psvr2__HmdDevice__Deactivate)(void *) = nullptr;\n  void sie__psvr2__HmdDevice__DeactivateHook(void *thisptr) {\n    sie__psvr2__HmdDevice__Deactivate(thisptr);\n\n#ifdef OPENVR_EXTENSIONS_AVAILABLE\n    if (g_pOpenVRExHandle) {\n      psvr2_toolkit::openvr_ex::OnHmdDeactivate(&g_pOpenVRExHandle);\n    }\n#endif\n  }\n\n  inline const int64_t GetHostTimestamp()\n  {\n    static LARGE_INTEGER frequency{};\n    if (frequency.QuadPart == 0)\n    {\n      QueryPerformanceFrequency(&frequency);\n    }\n\n    LARGE_INTEGER now;\n    QueryPerformanceCounter(&now);\n\n    return static_cast<int64_t>((static_cast<double>(now.QuadPart) /\n        static_cast<double>(frequency.QuadPart)) * 1e6);\n  }\n\n  void HmdDeviceHooks::UpdateGaze(void* pData, size_t dwSize)\n  {\n      if (eyeTrackingComponent == vr::k_ulInvalidInputComponentHandle)\n      {\n        return;\n      }\n\n      Hmd2GazeState* pGazeState = reinterpret_cast<Hmd2GazeState*>(pData);\n      vr::VREyeTrackingData_t eyeTrackingData {};\n\n      bool valid = pGazeState->combined.isGazeDirValid;\n\n      eyeTrackingData.bActive = valid;\n      eyeTrackingData.bTracked = valid;\n      eyeTrackingData.bValid = valid;\n\n      auto& origin = pGazeState->combined.gazeOriginMm;\n      auto& direction = pGazeState->combined.gazeDirNorm;\n\n      eyeTrackingData.vGazeOrigin = vr::HmdVector3_t { -origin.x / 1000.0f, origin.y / 1000.0f, -origin.z / 1000.0f };\n      eyeTrackingData.vGazeTarget = vr::HmdVector3_t { -direction.x, direction.y, -direction.z };\n\n      int64_t hmdToHostOffset;\n\n      CaesarManager__getIMUTimestampOffset(CaesarManager__getInstance(), &hmdToHostOffset);\n\n      double timeOffset = ((static_cast<int64_t>(pGazeState->combined.timestamp) + hmdToHostOffset) - GetHostTimestamp()) / 1e6;\n\n      (vr::VRDriverInput())->UpdateEyeTrackingComponent(eyeTrackingComponent, &eyeTrackingData, timeOffset);\n\n  #ifdef OPENVR_EXTENSIONS_AVAILABLE\n      if (g_pOpenVRExHandle) {\n        psvr2_toolkit::openvr_ex::OnHmdUpdate(&g_pOpenVRExHandle, pData, dwSize);\n      }\n  #endif\n  }\n\n  void HmdDeviceHooks::InstallHooks() {\n    static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n    // sie::psvr2::HmdDevice::Activate\n    HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x19D1B0),\n                         reinterpret_cast<void *>(sie__psvr2__HmdDevice__ActivateHook),\n                         reinterpret_cast<void **>(&sie__psvr2__HmdDevice__Activate));\n\n    // sie::psvr2::HmdDevice::Deactivate\n    HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x19EBF0),\n                         reinterpret_cast<void *>(sie__psvr2__HmdDevice__DeactivateHook),\n                         reinterpret_cast<void **>(&sie__psvr2__HmdDevice__Deactivate));\n\n    CaesarManager__getInstance = decltype(CaesarManager__getInstance)(pHmdDriverLoader->GetBaseAddress() + 0x124c90);\n    CaesarManager__getIMUTimestampOffset = decltype(CaesarManager__getIMUTimestampOffset)(pHmdDriverLoader->GetBaseAddress() + 0x1252e0);\n    ShareManager__getInstance = decltype(ShareManager__getInstance)(pHmdDriverLoader->GetBaseAddress() + 0x15bbd0);\n    ShareManager__getIntConfig = decltype(ShareManager__getIntConfig)(pHmdDriverLoader->GetBaseAddress() + 0x15d270);\n    ShareManager__setIntConfig = decltype(ShareManager__setIntConfig)(pHmdDriverLoader->GetBaseAddress() + 0x15f3d0);\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_device_hooks.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n  class HmdDeviceHooks {\n  public:\n    static void InstallHooks();\n    static void UpdateGaze(void* pData, size_t dwSize);\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_driver_factory.cpp",
    "content": "#include \"device_provider_proxy.h\"\n#include \"hmd_driver_loader.h\"\n\n#include <openvr_driver.h>\n#include <windows.h>\n\nusing namespace psvr2_toolkit;\n\nextern \"C\" __declspec(dllexport) void *HmdDriverFactory(const char *pInterfaceName, int *pReturnCode) {\n  static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n  // Check if the HMD driver DLL is actually loaded.\n  if (pHmdDriverLoader->GetBaseAddress()) {\n    void *result = pHmdDriverLoader->pfnHmdDriverFactory(pInterfaceName, pReturnCode);\n\n    if (strcmp(vr::IServerTrackedDeviceProvider_Version, pInterfaceName) == 0 &&\n        *pReturnCode == vr::VRInitError_None /* no point injecting if the original driver failed to initialise */) {\n      static DeviceProviderProxy *pDeviceProviderProxy = DeviceProviderProxy::Instance();\n      pDeviceProviderProxy->SetDeviceProvider(static_cast<vr::IServerTrackedDeviceProvider *>(result));\n      return pDeviceProviderProxy;\n    }\n\n    return result;\n  }\n\n  MessageBoxW(nullptr, L\"Loading original HMD driver failed, please report this to the developers!\", L\"PlayStation VR2 Toolkit (DriverEx)\", MB_ICONERROR | MB_OK);\n\n  if (pReturnCode) {\n    *pReturnCode = vr::VRInitError_Init_InterfaceNotFound;\n  }\n\n  return nullptr;\n}\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_driver_loader.cpp",
    "content": "#include \"hmd_driver_loader.h\"\n\n#include <shlwapi.h>\n\n#define HMD_DLL_NAME L\"driver_playstation_vr2_orig.dll\"\n\nextern \"C\" IMAGE_DOS_HEADER __ImageBase;\n\nnamespace psvr2_toolkit {\n\n  // Allows the C++ standard library load the original HMD driver automatically for us.\n  class HmdDriverLoaderInitializer {\n  public:\n    HmdDriverLoaderInitializer() {\n      HmdDriverLoader::Instance();\n    }\n  };\n  HmdDriverLoaderInitializer __initializer;\n\n  HmdDriverLoader *HmdDriverLoader::m_pInstance = nullptr;\n\n  HmdDriverLoader::HmdDriverLoader()\n    : pfnHmdDriverFactory(nullptr)\n    , m_hModule(nullptr)\n  {\n    wchar_t pszHmdDllPath[MAX_PATH] = { 0 };\n    if (GetHmdDllPath(pszHmdDllPath)) {\n      m_hModule = LoadLibraryW(pszHmdDllPath);\n      if (m_hModule) {\n        pfnHmdDriverFactory = decltype(pfnHmdDriverFactory)(GetProcAddress(m_hModule, \"HmdDriverFactory\"));\n      }\n    }\n  }\n\n  HmdDriverLoader *HmdDriverLoader::Instance() {\n    if (!m_pInstance) {\n      m_pInstance = new HmdDriverLoader;\n    }\n\n    return m_pInstance;\n  }\n\n  uintptr_t HmdDriverLoader::GetBaseAddress() {\n    return reinterpret_cast<uintptr_t>(m_hModule);\n  }\n\n  bool HmdDriverLoader::GetHmdDllPath(wchar_t *pszHmdDllPath) {\n    if (!pszHmdDllPath) {\n      return false;\n    }\n\n    wchar_t pszPath[MAX_PATH] = {0};\n    DWORD dwLength = GetModuleFileNameW(reinterpret_cast<HINSTANCE>(&__ImageBase), pszPath, MAX_PATH);\n    if (dwLength > 0 && dwLength < MAX_PATH) {\n      if (PathRemoveFileSpecW(pszPath)) {\n        if (PathCombineW(pszHmdDllPath, pszPath, HMD_DLL_NAME)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_driver_loader.h",
    "content": "#pragma once\n\n#include <windows.h>\n\n#include <cstdint>\n\nnamespace psvr2_toolkit {\n\n  // Provides a thin interface between our proxy library and the original HMD driver.\n  class HmdDriverLoader {\n  public:\n    HmdDriverLoader();\n\n    static HmdDriverLoader *Instance();\n\n    uintptr_t GetBaseAddress();\n\n    void *(*pfnHmdDriverFactory)(const char *pInterfaceName, int *pReturnCode);\n\n  private:\n    static HmdDriverLoader *m_pInstance;\n\n    HMODULE m_hModule;\n\n    bool GetHmdDllPath(wchar_t *pszHmdDllPath);\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hmd_math.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n  class HmdMath {\n  public:\n    static vr::HmdQuaternion_t EulerToQuaternion(double yaw, double pitch, double roll) {\n      double cy = cos(yaw * 0.5);\n      double sy = sin(yaw * 0.5);\n      double cp = cos(pitch * 0.5);\n      double sp = sin(pitch * 0.5);\n      double cr = cos(roll * 0.5);\n      double sr = sin(roll * 0.5);\n      return {\n        cr * cp * cy + sr * sp * sy,\n        sr * cp * cy - cr * sp * sy,\n        cr * sp * cy + sr * cp * sy,\n        cr * cp * sy - sr * sp * cy\n      };\n    }\n\n    static vr::HmdQuaternion_t QuaternionMultiply(const vr::HmdQuaternion_t &a, const vr::HmdQuaternion_t &b) {\n      return {\n        a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n        a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n        a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n        a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w\n      };\n    }\n\n    static vr::HmdQuaternion_t QuaternionInverse(const vr::HmdQuaternion_t &q) {\n      double normSq = q.w * q.w + q.x * q.x + q.y * q.y + q.z * q.z;\n      return { q.w / normSq, -q.x / normSq, -q.y / normSq, -q.z / normSq };\n    }\n\n    static vr::HmdVector3d_t RotateVectorByQuaternion(const vr::HmdVector3d_t &v, const vr::HmdQuaternion_t &q) {\n      vr::HmdQuaternion_t vQuat = { 0.0, v.v[0], v.v[1], v.v[2] };\n      vr::HmdQuaternion_t qv = QuaternionMultiply(q, vQuat);\n      vr::HmdQuaternion_t qInv = QuaternionInverse(q);\n      vr::HmdQuaternion_t result = QuaternionMultiply(qv, qInv);\n      return { result.x, result.y, result.z };\n    }\n\n  };\n\n}\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/hook_lib.h",
    "content": "#pragma once\n\n#include <minhook.h>\n\n#define INSTALL_STUB(pTarget) psvr2_toolkit::HookLib::InstallStub(pTarget)\n#define INSTALL_STUB_ORIGINAL(pTarget, ppOriginal) psvr2_toolkit::HookLib::InstallStub(pTarget, ppOriginal)\n\n#define INSTALL_STUB_RET0(pTarget) psvr2_toolkit::HookLib::InstallStubRet0(pTarget)\n#define INSTALL_STUB_RET0_ORIGINAL(pTarget, ppOriginal) psvr2_toolkit::HookLib::InstallStubRet0(pTarget, ppOriginal)\n\nnamespace psvr2_toolkit {\n\n  // Provides a thin wrapper around MinHook.\n  class HookLib {\n  private:\n    static void Stub() {}\n    static __int64 StubRet0() { return 0; }\n\n  public:\n    static bool Initialize() {\n      return MH_Initialize() == MH_OK;\n    }\n\n    static void InstallHook(void *pTarget, void* pDetour, void **ppOriginal = nullptr) {\n      MH_CreateHook(pTarget, pDetour, ppOriginal);\n      MH_EnableHook(pTarget);\n    }\n\n    static void InstallStub(void* pTarget, void** ppOriginal = nullptr) {\n      InstallHook(pTarget, reinterpret_cast<void *>(Stub), ppOriginal);\n    }\n\n    static void InstallStubRet0(void *pTarget, void **ppOriginal = nullptr) {\n      InstallHook(pTarget, reinterpret_cast<void *>(StubRet0), ppOriginal);\n    }\n\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/ipc_server.cpp",
    "content": "#include \"ipc_server.h\"\n\n#include \"trigger_effect_manager.h\"\n#include \"util.h\"\n#include \"vr_settings.h\"\n\n#include <cstdio>\n\nnamespace psvr2_toolkit {\n  namespace ipc {\n\n    IpcServer *IpcServer::m_pInstance = nullptr;\n\n    IpcServer::IpcServer()\n      : m_initialized(false)\n      , m_running(false)\n      , m_doGaze(false)\n      , m_socket{}\n      , m_serverAddr{}\n      , m_pGazeState(nullptr)\n    {}\n\n    IpcServer *IpcServer::Instance() {\n      if (!m_pInstance) {\n        m_pInstance = new IpcServer;\n      }\n\n      return m_pInstance;\n    }\n\n    bool IpcServer::Initialized() {\n      return m_initialized;\n    }\n\n    void IpcServer::Initialize() {\n      if (m_initialized) {\n        return;\n      }\n\n      WSADATA wsaData = {};\n      int result = WSAStartup(MAKEWORD(2, 2), &wsaData);\n      if (result != 0) {\n        Util::DriverLog(\"[IPC_SERVER] WSAStartup failed. Result = {}\", result);\n        return;\n      }\n\n      m_initialized = true;\n      m_doGaze = !VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_GAZE, SETTING_DISABLE_GAZE_DEFAULT_VALUE);\n      m_doOpenness = VRSettings::GetBool(STEAMVR_SETTINGS_ENABLE_EYELID_ESTIMATION, SETTING_ENABLE_EYELID_ESTIMATION_DEFAULT_VALUE);\n    }\n\n    void IpcServer::Start() {\n      if (!m_initialized && m_running) {\n        return;\n      }\n\n      m_socket = socket(AF_INET, SOCK_STREAM, 0);\n      if (m_socket == INVALID_SOCKET) {\n        Util::DriverLog(\"[IPC_SERVER] Creating socket failed. LastError = {}\", WSAGetLastError());\n        return;\n      }\n\n      m_serverAddr.sin_family = AF_INET;\n      m_serverAddr.sin_addr.s_addr = htonl(INADDR_ANY);\n      m_serverAddr.sin_port = htons(IPC_SERVER_PORT);\n\n      if (bind(m_socket, reinterpret_cast<SOCKADDR * >(&m_serverAddr), sizeof(m_serverAddr)) == SOCKET_ERROR) {\n        Util::DriverLog(\"[IPC_SERVER] Bind failed. LastError = {}\", WSAGetLastError());\n        closesocket(m_socket);\n        return;\n      }\n\n      if (listen(m_socket, SOMAXCONN) == SOCKET_ERROR) {\n        Util::DriverLog(\"[IPC_SERVER] Listen failed. LastError = {}\", WSAGetLastError());\n        closesocket(m_socket);\n        return;\n      }\n\n      m_running = true;\n      m_receiveThread = std::thread(&IpcServer::ReceiveLoop, this);\n    }\n\n    void IpcServer::Stop() {\n      if (!m_running) {\n        return;\n      }\n\n      m_running = false;\n      closesocket(m_socket);\n      m_receiveThread.join();\n    }\n\n    void IpcServer::UpdateGazeState(Hmd2GazeState *pGazeState, float leftEyelidOpenness, float rightEyelidOpenness) {\n      if (!m_pGazeState) {\n        m_pGazeState = reinterpret_cast<Hmd2GazeState *>(malloc(sizeof(Hmd2GazeState)));\n      }\n      if (m_pGazeState) {\n        memcpy(m_pGazeState, pGazeState, sizeof(Hmd2GazeState)); // Realistically, we should have a mutex here. Sadly, we do not have the time.\n      }\n      m_leftEyelidOpenness = leftEyelidOpenness;\n      m_rightEyelidOpenness = rightEyelidOpenness;\n    }\n\n    void IpcServer::ReceiveLoop() {\n      char pBuffer[1024] = {}; // This does not need to be static.\n      sockaddr_in clientAddr = {};\n      int clientAddrLen = sizeof(clientAddr);\n\n      while (m_running) {\n        SOCKADDR_IN clientAddr = {};\n        int clientAddrLen = sizeof(clientAddr);\n\n        SOCKET clientSocket = accept(m_socket, reinterpret_cast<SOCKADDR*>(&clientAddr), &clientAddrLen);\n        if (clientSocket == INVALID_SOCKET) {\n          int error = WSAGetLastError();\n          if (m_running) {\n              Util::DriverLog(\"[IPC_SERVER] Accept failed. LastError = {}\", error);\n          }\n          else {\n            Util::DriverLog(\"[IPC_SERVER] Server socket closed. Exiting receive loop.\");\n          }\n          break;\n        }\n\n        std::thread clientThread(&IpcServer::HandleClient, this, clientSocket, clientAddr);\n        clientThread.detach(); // client thread shouldnt block receive thread\n      }\n    }\n\n    void IpcServer::HandleClient(SOCKET clientSocket, SOCKADDR_IN clientAddr) {\n      char pBuffer[1024] = {};\n      int clientPort = ntohs(clientAddr.sin_port);\n\n      while (m_running) {\n\n        int dwBufferSize = recv(clientSocket, pBuffer, sizeof(pBuffer), 0);\n        if (dwBufferSize <= 0) {\n          if (dwBufferSize == 0) {\n            Util::DriverLog(\"[IPC_SERVER] Client on port {} disconnected.\", clientPort);\n          } else {\n            Util::DriverLog(\"[IPC_SERVER] Receive failed for client on port {}. LastError = {}\", clientPort, WSAGetLastError());\n          }\n\n          break;\n        }\n\n        if (dwBufferSize < sizeof(CommandHeader_t)) {\n          Util::DriverLog(\"[IPC_SERVER] Received invalid command header size from client on port {}.\", clientPort);\n          continue;\n        }\n\n        HandleIpcCommand(clientSocket, clientAddr, pBuffer);\n      }\n      closesocket(clientSocket);\n    }\n\n    void IpcServer::HandleIpcCommand(SOCKET clientSocket, const sockaddr_in &clientAddr, char *pBuffer) {\n      static TriggerEffectManager *pTriggerEffectManager = TriggerEffectManager::Instance();\n\n      uint16_t clientPort = ntohs(clientAddr.sin_port);\n\n      CommandHeader_t *pHeader = reinterpret_cast<CommandHeader_t *>(pBuffer);\n      void *pData = pBuffer + sizeof(CommandHeader_t);\n\n      switch (pHeader->type) {\n        case Command_ClientPing: {\n          if (pHeader->dataLen == 0 && m_connections.contains(clientPort)) {\n            SendIpcCommand(clientSocket, Command_ServerPong); // TODO\n          }\n          break;\n        }\n\n        case Command_ClientRequestHandshake: {\n          CommandDataServerHandshakeResult_t response;\n          response.result = HandshakeResult_Failed;\n          response.ipcVersion = k_unIpcVersion; // Communicate the IPC version the server supports.\n\n          if (pHeader->dataLen == sizeof(CommandDataClientRequestHandshake_t) && !m_connections.contains(clientPort)) {\n            CommandDataClientRequestHandshake_t *pRequest = reinterpret_cast<CommandDataClientRequestHandshake_t *>(pData);\n\n            // We only want real running processes to handshake with us.\n            if (Util::IsProcessRunning(pRequest->processId)) {\n              m_connections[clientPort] = {\n                .clientAddr = clientAddr,\n                .ipcVersion = pRequest->ipcVersion,\n                .processId = pRequest->processId\n              };\n\n              response.result = HandshakeResult_Success;\n            }\n          }\n\n          SendIpcCommand(clientSocket, Command_ServerHandshakeResult, &response, sizeof(response));\n          break;\n        }\n\n        case Command_ClientRequestGazeData: {\n          if (pHeader->dataLen == 0 && m_connections.contains(clientPort)) {\n\n            if (m_doGaze && m_pGazeState) {\n              // Handle old client IPC version requests here.\n              if (m_connections[clientPort].ipcVersion == 1) {\n                CommandDataServerGazeDataResult_t response = {\n                  .leftEye = {\n                    .isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->leftEye.gazeOriginMm.x,\n                      .y = m_pGazeState->leftEye.gazeOriginMm.y,\n                      .z = m_pGazeState->leftEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->leftEye.gazeDirNorm.x,\n                      .y = m_pGazeState->leftEye.gazeDirNorm.y,\n                      .z = m_pGazeState->leftEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,\n                    .isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                  },\n\n                  .rightEye = {\n                    .isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->rightEye.gazeOriginMm.x,\n                      .y = m_pGazeState->rightEye.gazeOriginMm.y,\n                      .z = m_pGazeState->rightEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->rightEye.gazeDirNorm.x,\n                      .y = m_pGazeState->rightEye.gazeDirNorm.y,\n                      .z = m_pGazeState->rightEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,\n                    .isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                  }\n                };\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              } else if (m_connections[clientPort].ipcVersion == 2) {\n                CommandDataServerGazeDataResult2_t response = {\n                  .leftEye = {\n                    .isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->leftEye.gazeOriginMm.x,\n                      .y = m_pGazeState->leftEye.gazeOriginMm.y,\n                      .z = m_pGazeState->leftEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->leftEye.gazeDirNorm.x,\n                      .y = m_pGazeState->leftEye.gazeDirNorm.y,\n                      .z = m_pGazeState->leftEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,\n                    .isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .isOpenEnabled = m_doOpenness,\n                    .open = m_doOpenness ? m_leftEyelidOpenness : 0.0f,\n                  },\n\n                  .rightEye = {\n                    .isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->rightEye.gazeOriginMm.x,\n                      .y = m_pGazeState->rightEye.gazeOriginMm.y,\n                      .z = m_pGazeState->rightEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->rightEye.gazeDirNorm.x,\n                      .y = m_pGazeState->rightEye.gazeDirNorm.y,\n                      .z = m_pGazeState->rightEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,\n                    .isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .isOpenEnabled = m_doOpenness,\n                    .open = m_doOpenness ? m_rightEyelidOpenness : 0.0f,\n                  }\n                };\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              } else {\n                CommandDataServerGazeDataResult3_t response = {\n                  .leftEye = {\n                    .isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->leftEye.gazeOriginMm.x,\n                      .y = m_pGazeState->leftEye.gazeOriginMm.y,\n                      .z = m_pGazeState->leftEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->leftEye.gazeDirNorm.x,\n                      .y = m_pGazeState->leftEye.gazeDirNorm.y,\n                      .z = m_pGazeState->leftEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,\n                    .isPupilPosInSensorValid = m_pGazeState->leftEye.isPupilPosInSensorValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilPosInSensor = {\n                      .x = m_pGazeState->leftEye.pupilPosInSensor.x,\n                      .y = m_pGazeState->leftEye.pupilPosInSensor.y,\n                    },\n                    .isPosGuideValid = m_pGazeState->leftEye.isPosGuideValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .posGuide = {\n                      .x = m_pGazeState->leftEye.posGuide.x,\n                      .y = m_pGazeState->leftEye.posGuide.y,\n                    },\n                    .isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .isOpenEnabled = m_doOpenness,\n                    .open = m_doOpenness ? m_leftEyelidOpenness : 0.0f,\n                  },\n\n                  .rightEye = {\n                    .isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeOriginMm = {\n                      .x = m_pGazeState->rightEye.gazeOriginMm.x,\n                      .y = m_pGazeState->rightEye.gazeOriginMm.y,\n                      .z = m_pGazeState->rightEye.gazeOriginMm.z,\n                    },\n                    .isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .gazeDirNorm {\n                      .x = m_pGazeState->rightEye.gazeDirNorm.x,\n                      .y = m_pGazeState->rightEye.gazeDirNorm.y,\n                      .z = m_pGazeState->rightEye.gazeDirNorm.z,\n                    },\n                    .isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,\n                    .isPupilPosInSensorValid = m_pGazeState->rightEye.isPupilPosInSensorValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .pupilPosInSensor = {\n                      .x = m_pGazeState->rightEye.pupilPosInSensor.x,\n                      .y = m_pGazeState->rightEye.pupilPosInSensor.y,\n                    },\n                    .isPosGuideValid = m_pGazeState->rightEye.isPosGuideValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .posGuide = {\n                      .x = m_pGazeState->rightEye.posGuide.x,\n                      .y = m_pGazeState->rightEye.posGuide.y,\n                    },\n                    .isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,\n                    .isOpenEnabled = m_doOpenness,\n                    .open = m_doOpenness ? m_rightEyelidOpenness : 0.0f,\n                  }\n                };\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              }\n            } else {\n              // Handle old client IPC version requests here, as well.\n              if (m_connections[clientPort].ipcVersion == 1) {\n                CommandDataServerGazeDataResult_t response = {};\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              } else if (m_connections[clientPort].ipcVersion == 2) {\n                CommandDataServerGazeDataResult2_t response = {};\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              } else {\n                CommandDataServerGazeDataResult3_t response = {};\n                SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));\n              }\n            }\n            \n          }\n          break;\n        }\n\n        case Command_ClientTriggerEffectOff:\n        case Command_ClientTriggerEffectFeedback:\n        case Command_ClientTriggerEffectWeapon:\n        case Command_ClientTriggerEffectVibration:\n        case Command_ClientTriggerEffectMultiplePositionFeedback:\n        case Command_ClientTriggerEffectSlopeFeedback:\n        case Command_ClientTriggerEffectMultiplePositionVibration: {\n          if (m_connections.contains(clientPort)) {\n            pTriggerEffectManager->HandleIpcCommand(m_connections[clientPort].processId, pHeader, pData);\n          }\n          break;\n        }\n      }\n    }\n\n    void IpcServer::SendIpcCommand(SOCKET clientSocket, ECommandType type, void *pData, int dataLen) {\n      // Reduce the allocations by making the buffer static.\n      // I'm sure this isn't thread-safe, but we only have one receive thread anyways.\n      static char pBuffer[1024] = {};\n\n      int actualDataLen = pData ? dataLen : 0;\n      int actualBufferLen = sizeof(CommandHeader_t) + actualDataLen;\n\n      CommandHeader_t *pHeader = reinterpret_cast<CommandHeader_t *>(pBuffer);\n      pHeader->type = type;\n      pHeader->dataLen = actualDataLen;\n      memcpy(pBuffer + sizeof(CommandHeader_t), pData, actualDataLen);\n\n      send(clientSocket, pBuffer, actualBufferLen, 0);\n    }\n\n  } // ipc\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/ipc_server.h",
    "content": "#pragma once\n\n#include \"hmd2_gaze.h\"\n#include \"../shared/ipc_protocol.h\"\n\n#include <windows.h>\n\n#include <cstdint>\n#include <map>\n#include <thread>\n\nnamespace psvr2_toolkit {\n  namespace ipc {\n\n    class IpcServer {\n    public:\n      IpcServer();\n\n      static IpcServer *Instance();\n\n      bool Initialized();\n      void Initialize();\n\n      void Start();\n      void Stop();\n\n      void UpdateGazeState(Hmd2GazeState *pGazeState, float leftEyelidOpenness, float rightEyelidOpenness);\n\n    private:\n      struct ConnectionInfo_t {\n        sockaddr_in clientAddr;\n        uint16_t ipcVersion;\n        uint32_t processId;\n      };\n\n      static IpcServer *m_pInstance;\n\n      bool m_initialized;\n      bool m_running;\n      bool m_doGaze;\n      bool m_doOpenness;\n      SOCKET m_socket;\n      sockaddr_in m_serverAddr;\n      std::thread m_receiveThread;\n      std::map<uint16_t, ConnectionInfo_t> m_connections;\n\n      Hmd2GazeState *m_pGazeState;\n      float m_leftEyelidOpenness;\n      float m_rightEyelidOpenness;\n\n      void ReceiveLoop();\n      void HandleClient(SOCKET clientSocket, SOCKADDR_IN clientAddr);\n\n      void HandleIpcCommand(SOCKET clientSocket, const sockaddr_in &clientAddr, char *pBuffer);\n      void SendIpcCommand(SOCKET clientSocket, ECommandType type, void *pData = nullptr, int dataSize = 0);\n    };\n\n  } // ipc\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/minhook/LICENSE.txt",
    "content": "﻿MinHook - The Minimalistic API Hooking Library for x64/x86\nCopyright (C) 2009-2017 Tsuda Kageyu.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n 1. Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================================\nPortions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.\n================================================================================\nHacker Disassembler Engine 32 C\nCopyright (c) 2008-2009, Vyacheslav Patkov.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n 1. Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n-------------------------------------------------------------------------------\nHacker Disassembler Engine 64 C\nCopyright (c) 2008-2009, Vyacheslav Patkov.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n 1. Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/minhook/include/MinHook.h",
    "content": "/*\n *  MinHook - The Minimalistic API Hooking Library for x64/x86\n *  Copyright (C) 2009-2017 Tsuda Kageyu.\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   1. Redistributions of source code must retain the above copyright\n *      notice, this list of conditions and the following disclaimer.\n *   2. Redistributions in binary form must reproduce the above copyright\n *      notice, this list of conditions and the following disclaimer in the\n *      documentation and/or other materials provided with the distribution.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER\n *  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#pragma once\n\n#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)\n    #error MinHook supports only x86 and x64 systems.\n#endif\n\n#include <windows.h>\n\n// MinHook Error Codes.\ntypedef enum MH_STATUS\n{\n    // Unknown error. Should not be returned.\n    MH_UNKNOWN = -1,\n\n    // Successful.\n    MH_OK = 0,\n\n    // MinHook is already initialized.\n    MH_ERROR_ALREADY_INITIALIZED,\n\n    // MinHook is not initialized yet, or already uninitialized.\n    MH_ERROR_NOT_INITIALIZED,\n\n    // The hook for the specified target function is already created.\n    MH_ERROR_ALREADY_CREATED,\n\n    // The hook for the specified target function is not created yet.\n    MH_ERROR_NOT_CREATED,\n\n    // The hook for the specified target function is already enabled.\n    MH_ERROR_ENABLED,\n\n    // The hook for the specified target function is not enabled yet, or already\n    // disabled.\n    MH_ERROR_DISABLED,\n\n    // The specified pointer is invalid. It points the address of non-allocated\n    // and/or non-executable region.\n    MH_ERROR_NOT_EXECUTABLE,\n\n    // The specified target function cannot be hooked.\n    MH_ERROR_UNSUPPORTED_FUNCTION,\n\n    // Failed to allocate memory.\n    MH_ERROR_MEMORY_ALLOC,\n\n    // Failed to change the memory protection.\n    MH_ERROR_MEMORY_PROTECT,\n\n    // The specified module is not loaded.\n    MH_ERROR_MODULE_NOT_FOUND,\n\n    // The specified function is not found.\n    MH_ERROR_FUNCTION_NOT_FOUND\n}\nMH_STATUS;\n\n// Can be passed as a parameter to MH_EnableHook, MH_DisableHook,\n// MH_QueueEnableHook or MH_QueueDisableHook.\n#define MH_ALL_HOOKS NULL\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n    // Initialize the MinHook library. You must call this function EXACTLY ONCE\n    // at the beginning of your program.\n    MH_STATUS WINAPI MH_Initialize(VOID);\n\n    // Uninitialize the MinHook library. You must call this function EXACTLY\n    // ONCE at the end of your program.\n    MH_STATUS WINAPI MH_Uninitialize(VOID);\n\n    // Creates a hook for the specified target function, in disabled state.\n    // Parameters:\n    //   pTarget     [in]  A pointer to the target function, which will be\n    //                     overridden by the detour function.\n    //   pDetour     [in]  A pointer to the detour function, which will override\n    //                     the target function.\n    //   ppOriginal  [out] A pointer to the trampoline function, which will be\n    //                     used to call the original target function.\n    //                     This parameter can be NULL.\n    MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);\n\n    // Creates a hook for the specified API function, in disabled state.\n    // Parameters:\n    //   pszModule   [in]  A pointer to the loaded module name which contains the\n    //                     target function.\n    //   pszProcName [in]  A pointer to the target function name, which will be\n    //                     overridden by the detour function.\n    //   pDetour     [in]  A pointer to the detour function, which will override\n    //                     the target function.\n    //   ppOriginal  [out] A pointer to the trampoline function, which will be\n    //                     used to call the original target function.\n    //                     This parameter can be NULL.\n    MH_STATUS WINAPI MH_CreateHookApi(\n        LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);\n\n    // Creates a hook for the specified API function, in disabled state.\n    // Parameters:\n    //   pszModule   [in]  A pointer to the loaded module name which contains the\n    //                     target function.\n    //   pszProcName [in]  A pointer to the target function name, which will be\n    //                     overridden by the detour function.\n    //   pDetour     [in]  A pointer to the detour function, which will override\n    //                     the target function.\n    //   ppOriginal  [out] A pointer to the trampoline function, which will be\n    //                     used to call the original target function.\n    //                     This parameter can be NULL.\n    //   ppTarget    [out] A pointer to the target function, which will be used\n    //                     with other functions.\n    //                     This parameter can be NULL.\n    MH_STATUS WINAPI MH_CreateHookApiEx(\n        LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);\n\n    // Removes an already created hook.\n    // Parameters:\n    //   pTarget [in] A pointer to the target function.\n    MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);\n\n    // Enables an already created hook.\n    // Parameters:\n    //   pTarget [in] A pointer to the target function.\n    //                If this parameter is MH_ALL_HOOKS, all created hooks are\n    //                enabled in one go.\n    MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);\n\n    // Disables an already created hook.\n    // Parameters:\n    //   pTarget [in] A pointer to the target function.\n    //                If this parameter is MH_ALL_HOOKS, all created hooks are\n    //                disabled in one go.\n    MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);\n\n    // Queues to enable an already created hook.\n    // Parameters:\n    //   pTarget [in] A pointer to the target function.\n    //                If this parameter is MH_ALL_HOOKS, all created hooks are\n    //                queued to be enabled.\n    MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);\n\n    // Queues to disable an already created hook.\n    // Parameters:\n    //   pTarget [in] A pointer to the target function.\n    //                If this parameter is MH_ALL_HOOKS, all created hooks are\n    //                queued to be disabled.\n    MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);\n\n    // Applies all queued changes in one go.\n    MH_STATUS WINAPI MH_ApplyQueued(VOID);\n\n    // Translates the MH_STATUS to its name as a string.\n    const char *WINAPI MH_StatusToString(MH_STATUS status);\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/pad_trigger_effect.h",
    "content": "/* SIE CONFIDENTIAL\n * $PSLibId$\n * Copyright (C) 2019 Sony Interactive Entertainment Inc.\n * All Rights Reserved.\n */\n\n\n#ifndef _SCE_PAD_TRIGGER_EFFECT_H\n#define _SCE_PAD_TRIGGER_EFFECT_H\n\n#include <stdint.h>\n\n#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2\t\t\t0x01\n#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2\t\t\t0x02\n\n#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2\t\t0\n#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2\t\t1\n\n#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM\t\t\t\t2\n\n/* Definition of control point num */\n#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM\t\t10\n\ntypedef enum ScePadTriggerEffectMode{\n\tSCE_PAD_TRIGGER_EFFECT_MODE_OFF,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_WEAPON,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK,\n\tSCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION,\n} ScePadTriggerEffectMode;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to off mode.\n *         Off Mode: Stop trigger effect.\n **/\ntypedef struct ScePadTriggerEffectOffParam{\n\tuint8_t padding[48];\n} ScePadTriggerEffectOffParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to Feedback mode.\n *         Feedback Mode: The motor arm pushes back trigger.\n *                        Trigger obtains stiffness at specified position.\n **/\ntypedef struct ScePadTriggerEffectFeedbackParam{\n\tuint8_t position;\t/*E position where the strength of target trigger start changing(0~9). */\n\tuint8_t strength;\t/*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */\n\tuint8_t padding[46];\n} ScePadTriggerEffectFeedbackParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to Weapon mode.\n *         Weapon Mode: Emulate weapon like gun trigger.\n **/\ntypedef struct ScePadTriggerEffectWeaponParam{\n\tuint8_t startPosition;\t/*E position where the stiffness of trigger start changing(2~7). */\n\tuint8_t endPosition;\t/*E position where the stiffness of trigger finish changing(startPosition+1~8). */\n\tuint8_t strength;\t\t/*E strength of gun trigger(0~8 (0: Same as Off mode)). */\n\tuint8_t padding[45];\n} ScePadTriggerEffectWeaponParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to Vibration mode.\n *         Vibration Mode: Vibrates motor arm around specified position.\n **/\ntypedef struct ScePadTriggerEffectVibrationParam{\n\tuint8_t position;\t/*E position where the motor arm start vibrating(0~9). */\n\tuint8_t amplitude;\t/*E vibration amplitude(0~8 (0: Same as Off mode)). */\n\tuint8_t frequency;\t/*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */\n\tuint8_t padding[45];\n} ScePadTriggerEffectVibrationParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode.\n *         Multi Position Feedback Mode: The motor arm pushes back trigger.\n *                                       Trigger obtains specified stiffness at each control point.\n **/\ntypedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{\n\tuint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM];\t/*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)).\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  strength[0] means strength of motor arm at position0.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  strength[1] means strength of motor arm at position1.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  ...\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\tuint8_t padding[38];\n} ScePadTriggerEffectMultiplePositionFeedbackParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to Feedback3 mode.\n *         Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points.\n *                              Stiffness of the trigger is changing depending on the set place.\n **/\ntypedef struct ScePadTriggerEffectSlopeFeedbackParam{\n\n\tuint8_t startPosition;\t/*E position where the strength of target trigger start changing(0~endPosition). */\n\tuint8_t endPosition; \t/*E position where the strength of target trigger finish changing(startPosition+1~9). */\n\tuint8_t startStrength;\t/*E strength when trigger's position is startPosition(1~8) */\n\tuint8_t endStrength;\t/*E strength when trigger's position is endPosition(1~8) */\n\tuint8_t padding[44];\n} ScePadTriggerEffectSlopeFeedbackParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect to Vibration2 mode.\n *         Multi Position Vibration Mode: Vibrates motor arm around specified control point.\n *                                        Trigger vibrates specified amplitude at each control point.\n **/\ntypedef struct ScePadTriggerEffectMultiplePositionVibrationParam{\n\tuint8_t frequency;\t\t\t\t\t\t\t\t\t\t\t\t/*E vibration frequency(0~255 (0: Same as Off mode)) */\n\tuint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM];\t/*E vibration amplitude at position(0~8 (0: Same as Off mode)).\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  amplitude[0] means amplitude of vibration at position0.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  amplitude[1] means amplitude of vibration at position1.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  ...\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\tuint8_t padding[37];\n} ScePadTriggerEffectMultiplePositionVibrationParam;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect mode.\n **/\ntypedef union ScePadTriggerEffectCommandData{\n\tScePadTriggerEffectOffParam\t\t\t\t\t\t\toffParam;\n\tScePadTriggerEffectFeedbackParam\t\t\t\t\tfeedbackParam;\n\tScePadTriggerEffectWeaponParam\t\t\t\t\t\tweaponParam;\n\tScePadTriggerEffectVibrationParam\t\t\t\t\tvibrationParam;\n\tScePadTriggerEffectMultiplePositionFeedbackParam\tmultiplePositionFeedbackParam;\n\tScePadTriggerEffectSlopeFeedbackParam\t\t\t\tslopeFeedbackParam;\n\tScePadTriggerEffectMultiplePositionVibrationParam\tmultiplePositionVibrationParam;\n} ScePadTriggerEffectCommandData;\n\n/**\n *E  \n *  @brief parameter for setting the trigger effect.\n **/\ntypedef struct ScePadTriggerEffectCommand{\n\tScePadTriggerEffectMode mode;\n\tuint8_t padding[4];\n\tScePadTriggerEffectCommandData commandData;\n} ScePadTriggerEffectCommand;\n\n/**\n *E  \n *  @brief parameter for the scePadSetTriggerEffect function.\n **/\ntypedef struct ScePadTriggerEffectParam{\n\n\tuint8_t triggerMask;\t\t/*E Set trigger mask to activate trigger effect commands.\n\t\t\t\t\t\t\t\t *  SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01\n\t\t\t\t\t\t\t\t *  SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02\n\t\t\t\t\t\t\t\t * */\n\tuint8_t padding[7];\n\n\tScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM];\t/*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *  and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n} ScePadTriggerEffectParam;\n\n#if defined(__cplusplus) && __cplusplus >= 201103L\nstatic_assert( sizeof( ScePadTriggerEffectParam ) == 120, \"ScePadTriggerEffectParam has incorrect size\" );\n#endif\n\n#endif /* _SCE_PAD_TRIGGER_EFFECT_H */\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/LICENSE",
    "content": "Copyright (c) 2015, Valve Corporation\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation and/or\nother materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/headers/openvr_driver.h",
    "content": "#pragma once\n\n// openvr_driver.h\n//========= Copyright Valve Corporation ============//\n// Dynamically generated file. Do not modify this file directly.\n\n#ifndef _OPENVR_DRIVER_API\n#define _OPENVR_DRIVER_API\n\n#include <stdint.h>\n\n\n\n// version.h\n\nnamespace vr\n{\n\tstatic const uint32_t k_nSteamVRVersionMajor = 2;\n\tstatic const uint32_t k_nSteamVRVersionMinor = 12;\n\tstatic const uint32_t k_nSteamVRVersionBuild = 14;\n} // namespace vr\n\n// public_vrtypes.h\n\n#ifndef _INCLUDE_CORE_VRTYPES_PUBLIC_H\n#define _INCLUDE_CORE_VRTYPES_PUBLIC_H\n\nnamespace vr\n{\n#pragma pack( push, 8 )\n\ntypedef uint32_t PropertyTypeTag_t;\n\n// right-handed system\n// +y is up\n// +x is to the right\n// -z is forward\n// Distance unit is  meters\nstruct HmdMatrix34_t\n{\n\tfloat m[3][4];\n};\n\nstruct HmdMatrix33_t\n{\n\tfloat m[3][3];\n};\n\nstruct HmdMatrix44_t\n{\n\tfloat m[4][4];\n};\n\nstruct HmdVector3_t\n{\n\tfloat v[3];\n};\n\nstruct HmdVector4_t\n{\n\tfloat v[4];\n};\n\nstruct HmdVector3d_t\n{\n\tdouble v[3];\n};\n\nstruct HmdVector2_t\n{\n\tfloat v[2];\n};\n\nstruct HmdQuaternion_t\n{\n\tdouble w, x, y, z;\n};\n\nstruct HmdQuaternionf_t\n{\n\tfloat w, x, y, z;\n};\n\nstruct HmdColor_t\n{\n\tfloat r, g, b, a;\n};\n\nstruct HmdQuad_t\n{\n\tHmdVector3_t vCorners[ 4 ];\n};\n\nstruct HmdRect2_t\n{\n\tHmdVector2_t vTopLeft;\n\tHmdVector2_t vBottomRight;\n};\n\n/** Holds the transform for a single bone */\nstruct VRBoneTransform_t\n{\n\tHmdVector4_t position;\n\tHmdQuaternionf_t orientation;\n};\n\nstruct VREyeTrackingData_t\n{\n\tbool bActive;\n\tbool bValid;\n\tbool bTracked;\n\n\tvr::HmdVector3_t vGazeOrigin;  // Ray origin\n\tvr::HmdVector3_t vGazeTarget;  // Gaze target (fixation point)\n};\n\n/** Used to return the post-distortion UVs for each color channel.\n* UVs range from 0 to 1 with 0,0 in the upper left corner of the\n* source render target. The 0,0 to 1,1 range covers a single eye. */\nstruct DistortionCoordinates_t\n{\n\tfloat rfRed[2];\n\tfloat rfGreen[2];\n\tfloat rfBlue[2];\n};\n\nenum EVREye\n{\n\tEye_Left = 0,\n\tEye_Right = 1\n};\n\nenum ETextureType\n{\n\tTextureType_Invalid = -1, // Handle has been invalidated\n\tTextureType_DirectX = 0, // Handle is an ID3D11Texture\n\tTextureType_OpenGL = 1,  // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags\n\tTextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure\n\tTextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef, deprecated in favor of TextureType_Metal on supported platforms\n\tTextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure\n\tTextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets.\n\t\t\t\t\t\t\t\t\t  // this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it\n\tTextureType_Metal = 6,\t// Handle is a MTLTexture conforming to the MTLSharedTexture protocol. Textures submitted to IVRCompositor::Submit which\n\t\t\t\t\t\t\t// are of type MTLTextureType2DArray assume layer 0 is the left eye texture (vr::EVREye::Eye_left), layer 1 is the right\n\t\t\t\t\t\t\t// eye texture (vr::EVREye::Eye_Right)\n\n\tTextureType_Reserved = 7,\n\tTextureType_SharedTextureHandle = 8, // A pointer to a vr::SharedTextureHandle_t that was imported via, eg. ImportDmabuf.\n};\n\nenum EColorSpace\n{\n\tColorSpace_Auto = 0,\t// Assumes 'gamma' for 8-bit per component formats, otherwise 'linear'.  This mirrors the DXGI formats which have _SRGB variants.\n\tColorSpace_Gamma = 1,\t// Texture data can be displayed directly on the display without any conversion (a.k.a. display native format).\n\tColorSpace_Linear = 2,\t// Same as gamma but has been converted to a linear representation using DXGI's sRGB conversion algorithm.\n};\n\nstruct Texture_t\n{\n\tvoid* handle; // See ETextureType definition above\n\tETextureType eType;\n\tEColorSpace eColorSpace;\n};\n\n/** Allows the application to control what part of the provided texture will be used in the\n* frame buffer. */\nstruct VRTextureBounds_t\n{\n\tfloat uMin, vMin;\n\tfloat uMax, vMax;\n};\n\n/** Allows specifying pose used to render provided scene texture (if different from value returned by WaitGetPoses). */\nstruct VRTextureWithPose_t : public Texture_t\n{\n\tHmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures.\n};\n\nstruct VRTextureDepthInfo_t\n{\n\tvoid* handle; // See ETextureType definition above\n\tHmdMatrix44_t mProjection;\n\tHmdVector2_t vRange; // 0..1\n};\n\nstruct VRTextureWithDepth_t : public Texture_t\n{\n\tVRTextureDepthInfo_t depth;\n};\n\nstruct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t\n{\n\tVRTextureDepthInfo_t depth;\n};\n\n// 64-bit types that are part of public structures\n// that are replicated in shared memory.\n#if defined(__linux__) || defined(__APPLE__)\ntypedef uint64_t vrshared_uint64_t __attribute__ ((aligned(8)));\ntypedef double vrshared_double __attribute__ ((aligned(8)));\n#else\ntypedef uint64_t vrshared_uint64_t;\ntypedef double vrshared_double;\n#endif\n\nstatic const uint32_t MaxDmabufPlaneCount = 4;\n\nstruct DmabufPlane_t\n{\n\tuint32_t unOffset;\n\tuint32_t unStride;\n\tint32_t nFd;\n};\n\nstruct DmabufAttributes_t\n{\n\tvoid *pNext; // MUST be NULL. Unused right now, but could be used to extend this structure in the future.\n\n\tuint32_t unWidth;\n\tuint32_t unHeight;\n\tuint32_t unDepth;\n\tuint32_t unMipLevels;\n\tuint32_t unArrayLayers;\n\tuint32_t unSampleCount;\n\tuint32_t unFormat;   // DRM_FORMAT_\n\tuint64_t ulModifier; // DRM_FORMAT_MOD_\n\n\tuint32_t unPlaneCount;\n\tDmabufPlane_t plane[MaxDmabufPlaneCount];\n};\n\n#pragma pack( pop )\n\n} // namespace vr\n\n#endif\n\n// vrtypes.h\n\n#ifndef _INCLUDE_VRTYPES_H\n#define _INCLUDE_VRTYPES_H\n\n// Forward declarations to avoid requiring vulkan.h\nstruct VkDevice_T;\nstruct VkPhysicalDevice_T;\nstruct VkInstance_T;\nstruct VkQueue_T;\n\n// Forward declarations to avoid requiring d3d12.h\nstruct ID3D12Resource;\nstruct ID3D12CommandQueue;\n\nnamespace vr\n{\n#pragma pack( push, 8 )\n\n/** A handle for a spatial anchor.  This handle is only valid during the session it was created in.\n* Anchors that live beyond one session should be saved by their string descriptors. */\ntypedef uint32_t SpatialAnchorHandle_t;\n\ntypedef void* glSharedTextureHandle_t;\ntypedef int32_t glInt_t;\ntypedef uint32_t glUInt_t;\n\n\n// Handle to a shared texture (HANDLE on Windows obtained using OpenSharedResource).\ntypedef uint64_t SharedTextureHandle_t;\n#define INVALID_SHARED_TEXTURE_HANDLE\t((vr::SharedTextureHandle_t)0)\n\nenum ETrackingResult\n{\n\tTrackingResult_Uninitialized\t\t\t= 1,\n\n\tTrackingResult_Calibrating_InProgress\t= 100,\n\tTrackingResult_Calibrating_OutOfRange\t= 101,\n\n\tTrackingResult_Running_OK\t\t\t\t= 200,\n\tTrackingResult_Running_OutOfRange\t\t= 201,\n\n\tTrackingResult_Fallback_RotationOnly\t= 300,\n};\n\ntypedef uint32_t DriverId_t;\nstatic const uint32_t k_nDriverNone = 0xFFFFFFFF;\n\nstatic const uint32_t k_unMaxDriverDebugResponseSize = 32768;\n\n/** Used to pass device IDs to API calls */\ntypedef uint32_t TrackedDeviceIndex_t;\nstatic const uint32_t k_unTrackedDeviceIndex_Hmd = 0;\nstatic const uint32_t k_unMaxTrackedDeviceCount = 64;\nstatic const uint32_t k_unTrackedDeviceIndexOther = 0xFFFFFFFE;\nstatic const uint32_t k_unTrackedDeviceIndexInvalid = 0xFFFFFFFF;\n\n/** Describes what kind of object is being tracked at a given ID */\nenum ETrackedDeviceClass\n{\n\tTrackedDeviceClass_Invalid = 0,\t\t\t\t// the ID was not valid.\n\tTrackedDeviceClass_HMD = 1,\t\t\t\t\t// Head-Mounted Displays\n\tTrackedDeviceClass_Controller = 2,\t\t\t// Tracked controllers\n\tTrackedDeviceClass_GenericTracker = 3,\t\t// Generic trackers, similar to controllers\n\tTrackedDeviceClass_TrackingReference = 4,\t// Camera and base stations that serve as tracking reference points\n\tTrackedDeviceClass_DisplayRedirect = 5,\t\t// Accessories that aren't necessarily tracked themselves, but may redirect video output from other tracked devices\n\n\tTrackedDeviceClass_Max\n};\n\n\n/** Describes what specific role associated with a tracked device */\nenum ETrackedControllerRole\n{\n\tTrackedControllerRole_Invalid = 0,\t\t\t\t\t// Invalid value for controller type\n\tTrackedControllerRole_LeftHand = 1,\t\t\t\t\t// Tracked device associated with the left hand\n\tTrackedControllerRole_RightHand = 2,\t\t\t\t// Tracked device associated with the right hand\n\tTrackedControllerRole_OptOut = 3,\t\t\t\t\t// Tracked device is opting out of left/right hand selection\n\tTrackedControllerRole_Treadmill = 4,\t\t\t\t// Tracked device is a treadmill or other locomotion device\n\tTrackedControllerRole_Stylus = 5,\t\t\t\t\t// Tracked device is a stylus\n\tTrackedControllerRole_Max = 5\n};\n\n\n/** Returns true if the tracked controller role is allowed to be a hand */\ninline bool IsRoleAllowedAsHand( ETrackedControllerRole eRole )\n{\n\tswitch ( eRole )\n\t{\n\tcase TrackedControllerRole_Invalid:\n\tcase TrackedControllerRole_LeftHand:\n\tcase TrackedControllerRole_RightHand:\n\t\treturn true;\n\tdefault:\n\t\treturn false;\n\t}\n}\n\n\n/** describes a single pose for a tracked object */\nstruct TrackedDevicePose_t\n{\n\tHmdMatrix34_t mDeviceToAbsoluteTracking;\n\tHmdVector3_t vVelocity;\t\t\t\t// velocity in tracker space in m/s\n\tHmdVector3_t vAngularVelocity;\t\t// angular velocity in radians/s (?)\n\tETrackingResult eTrackingResult;\n\tbool bPoseIsValid;\n\n\t// This indicates that there is a device connected for this spot in the pose array.\n\t// It could go from true to false if the user unplugs the device.\n\tbool bDeviceIsConnected;\n};\n\n/** Identifies which style of tracking origin the application wants to use\n* for the poses it is requesting */\nenum ETrackingUniverseOrigin\n{\n\tTrackingUniverseSeated = 0,\t\t// Poses are provided relative to the seated zero pose\n\tTrackingUniverseStanding = 1,\t// Poses are provided relative to the safe bounds configured by the user\n\tTrackingUniverseRawAndUncalibrated = 2,\t// Poses are provided in the coordinate system defined by the driver.  It has Y up and is unified for devices of the same driver. You usually don't want this one.\n};\n\nenum EAdditionalRadioFeatures\n{\n\tAdditionalRadioFeatures_None           = 0x00000000,\n\tAdditionalRadioFeatures_HTCLinkBox     = 0x00000001,\n\tAdditionalRadioFeatures_InternalDongle = 0x00000002,\n\tAdditionalRadioFeatures_ExternalDongle = 0x00000004,\n};\n\ntypedef uint64_t WebConsoleHandle_t;\n#define INVALID_WEB_CONSOLE_HANDLE\t((vr::WebConsoleHandle_t)0)\n\n// Refers to a single container of properties\ntypedef uint64_t PropertyContainerHandle_t;\ntypedef uint32_t PropertyTypeTag_t;\n\nstatic const PropertyContainerHandle_t k_ulInvalidPropertyContainer = 0;\nstatic const PropertyTypeTag_t k_unInvalidPropertyTag = 0;\n\ntypedef PropertyContainerHandle_t DriverHandle_t;\nstatic const PropertyContainerHandle_t k_ulInvalidDriverHandle = 0;\n\n// Use these tags to set/get common types as struct properties\nstatic const PropertyTypeTag_t k_unFloatPropertyTag = 1;\nstatic const PropertyTypeTag_t k_unInt32PropertyTag = 2;\nstatic const PropertyTypeTag_t k_unUint64PropertyTag = 3;\nstatic const PropertyTypeTag_t k_unBoolPropertyTag = 4;\nstatic const PropertyTypeTag_t k_unStringPropertyTag = 5;\nstatic const PropertyTypeTag_t k_unErrorPropertyTag = 6;\nstatic const PropertyTypeTag_t k_unDoublePropertyTag = 7;\n\nstatic const PropertyTypeTag_t k_unHmdMatrix34PropertyTag = 20;\nstatic const PropertyTypeTag_t k_unHmdMatrix44PropertyTag = 21;\nstatic const PropertyTypeTag_t k_unHmdVector3PropertyTag = 22;\nstatic const PropertyTypeTag_t k_unHmdVector4PropertyTag = 23;\nstatic const PropertyTypeTag_t k_unHmdVector2PropertyTag = 24;\nstatic const PropertyTypeTag_t k_unHmdQuadPropertyTag = 25;\n\nstatic const PropertyTypeTag_t k_unHiddenAreaPropertyTag = 30;\nstatic const PropertyTypeTag_t k_unPathHandleInfoTag = 31;\nstatic const PropertyTypeTag_t k_unActionPropertyTag = 32;\nstatic const PropertyTypeTag_t k_unInputValuePropertyTag = 33;\nstatic const PropertyTypeTag_t k_unWildcardPropertyTag = 34;\nstatic const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35;\nstatic const PropertyTypeTag_t k_unSkeletonPropertyTag = 36;\n\nstatic const PropertyTypeTag_t k_unSpatialAnchorPosePropertyTag = 40;\nstatic const PropertyTypeTag_t k_unJsonPropertyTag = 41;\nstatic const PropertyTypeTag_t k_unActiveActionSetPropertyTag = 42;\n\nstatic const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000;\nstatic const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000;\n\n\n/** Each entry in this enum represents a property that can be retrieved about a\n* tracked device. Many fields are only valid for one ETrackedDeviceClass. */\nenum ETrackedDeviceProperty\n{\n\tProp_Invalid\t\t\t\t\t\t\t\t= 0,\n\n\t// general properties that apply to all device classes\n\tProp_TrackingSystemName_String\t\t\t\t= 1000,\n\tProp_ModelNumber_String\t\t\t\t\t\t= 1001,\n\tProp_SerialNumber_String\t\t\t\t\t= 1002,\n\tProp_RenderModelName_String\t\t\t\t\t= 1003,\n\tProp_WillDriftInYaw_Bool\t\t\t\t\t= 1004,\n\tProp_ManufacturerName_String\t\t\t\t= 1005,\n\tProp_TrackingFirmwareVersion_String\t\t\t= 1006,\n\tProp_HardwareRevision_String\t\t\t\t= 1007,\n\tProp_AllWirelessDongleDescriptions_String\t= 1008,\n\tProp_ConnectedWirelessDongle_String\t\t\t= 1009,\n\tProp_DeviceIsWireless_Bool\t\t\t\t\t= 1010,\n\tProp_DeviceIsCharging_Bool\t\t\t\t\t= 1011,\n\tProp_DeviceBatteryPercentage_Float\t\t\t= 1012, // 0 is empty, 1 is full\n\tProp_StatusDisplayTransform_Matrix34\t\t= 1013,\n\tProp_Firmware_UpdateAvailable_Bool\t\t\t= 1014,\n\tProp_Firmware_ManualUpdate_Bool\t\t\t\t= 1015,\n\tProp_Firmware_ManualUpdateURL_String\t\t= 1016,\n\tProp_HardwareRevision_Uint64\t\t\t\t= 1017,\n\tProp_FirmwareVersion_Uint64\t\t\t\t\t= 1018,\n\tProp_FPGAVersion_Uint64\t\t\t\t\t\t= 1019,\n\tProp_VRCVersion_Uint64\t\t\t\t\t\t= 1020,\n\tProp_RadioVersion_Uint64\t\t\t\t\t= 1021,\n\tProp_DongleVersion_Uint64\t\t\t\t\t= 1022,\n\tProp_BlockServerShutdown_Bool\t\t\t\t= 1023,\n\tProp_CanUnifyCoordinateSystemWithHmd_Bool\t= 1024,\n\tProp_ContainsProximitySensor_Bool\t\t\t= 1025,\n\tProp_DeviceProvidesBatteryStatus_Bool\t\t= 1026,\n\tProp_DeviceCanPowerOff_Bool\t\t\t\t\t= 1027,\n\tProp_Firmware_ProgrammingTarget_String\t\t= 1028,\n\tProp_DeviceClass_Int32\t\t\t\t\t\t= 1029,\n\tProp_HasCamera_Bool\t\t\t\t\t\t\t= 1030,\n\tProp_DriverVersion_String                   = 1031,\n\tProp_Firmware_ForceUpdateRequired_Bool      = 1032,\n\tProp_ViveSystemButtonFixRequired_Bool\t\t= 1033,\n\tProp_ParentDriver_Uint64\t\t\t\t\t= 1034,\n\tProp_ResourceRoot_String\t\t\t\t\t= 1035,\n\tProp_RegisteredDeviceType_String\t\t\t= 1036,\n\tProp_InputProfilePath_String\t\t\t\t= 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided\n\tProp_NeverTracked_Bool\t\t\t\t\t\t= 1038, // Used for devices that will never have a valid pose by design\n\tProp_NumCameras_Int32\t\t\t\t\t\t= 1039,\n\tProp_CameraFrameLayout_Int32\t\t\t\t= 1040, // EVRTrackedCameraFrameLayout value\n\tProp_CameraStreamFormat_Int32\t\t\t\t= 1041, // ECameraVideoStreamFormat value\n\tProp_AdditionalDeviceSettingsPath_String\t= 1042, // driver-relative path to additional device and global configuration settings\n\tProp_Identifiable_Bool\t\t\t\t\t\t= 1043, // Whether device supports being identified from vrmonitor (e.g. blink LED, vibrate haptics, etc)\n\tProp_BootloaderVersion_Uint64\t\t\t    = 1044,\n\tProp_AdditionalSystemReportData_String\t\t= 1045, // additional string to include in system reports about a tracked device\n\tProp_CompositeFirmwareVersion_String        = 1046, // additional FW components from a device that gets propagated into reports\n\tProp_Firmware_RemindUpdate_Bool             = 1047,\n\tProp_PeripheralApplicationVersion_Uint64\t= 1048,\n\tProp_ManufacturerSerialNumber_String\t\t= 1049,\n\tProp_ComputedSerialNumber_String\t\t\t= 1050,\n\tProp_EstimatedDeviceFirstUseTime_Int32\t\t= 1051,\n\tProp_DevicePowerUsage_Float\t\t\t\t\t= 1052,\n\tProp_IgnoreMotionForStandby_Bool\t\t\t= 1053,\n\tProp_ActualTrackingSystemName_String\t\t= 1054, // the literal local driver name in case someone is playing games with prop 1000\n\tProp_AllowCameraToggle_Bool\t\t\t\t\t= 1055, // Shows the Enable/Disable camera option. Hide this for certain headsets if they have the camera tracking (since it's always on)\n\tProp_AllowLightSourceFrequency_Bool\t\t\t= 1056, // Shows the Anti-Flicker option in camera settings.\n\tProp_SteamRemoteClientID_Uint64\t\t\t\t= 1057, // For vrlink\n\tProp_Reserved_1058\t\t\t\t\t\t\t= 1058,\n\n\t// Properties that are unique to TrackedDeviceClass_HMD\n\tProp_ReportsTimeSinceVSync_Bool\t\t\t\t= 2000,\n\tProp_SecondsFromVsyncToPhotons_Float\t\t= 2001,\n\tProp_DisplayFrequency_Float\t\t\t\t\t= 2002,\n\tProp_UserIpdMeters_Float\t\t\t\t\t= 2003,\n\tProp_CurrentUniverseId_Uint64\t\t\t\t= 2004,\n\tProp_PreviousUniverseId_Uint64\t\t\t\t= 2005,\n\tProp_DisplayFirmwareVersion_Uint64\t\t\t= 2006,\n\tProp_IsOnDesktop_Bool\t\t\t\t\t\t= 2007,\n\tProp_DisplayMCType_Int32\t\t\t\t\t= 2008,\n\tProp_DisplayMCOffset_Float\t\t\t\t\t= 2009,\n\tProp_DisplayMCScale_Float\t\t\t\t\t= 2010,\n\tProp_EdidVendorID_Int32\t\t\t\t\t\t= 2011,\n\tProp_DisplayMCImageLeft_String              = 2012,\n\tProp_DisplayMCImageRight_String             = 2013,\n\tProp_DisplayGCBlackClamp_Float\t\t\t\t= 2014,\n\tProp_EdidProductID_Int32\t\t\t\t\t= 2015,\n\tProp_CameraToHeadTransform_Matrix34\t\t\t= 2016,\n\tProp_DisplayGCType_Int32\t\t\t\t\t= 2017,\n\tProp_DisplayGCOffset_Float\t\t\t\t\t= 2018,\n\tProp_DisplayGCScale_Float\t\t\t\t\t= 2019,\n\tProp_DisplayGCPrescale_Float\t\t\t\t= 2020,\n\tProp_DisplayGCImage_String\t\t\t\t\t= 2021,\n\tProp_LensCenterLeftU_Float\t\t\t\t\t= 2022,\n\tProp_LensCenterLeftV_Float\t\t\t\t\t= 2023,\n\tProp_LensCenterRightU_Float\t\t\t\t\t= 2024,\n\tProp_LensCenterRightV_Float\t\t\t\t\t= 2025,\n\tProp_UserHeadToEyeDepthMeters_Float\t\t\t= 2026,\n\tProp_CameraFirmwareVersion_Uint64\t\t\t= 2027,\n\tProp_CameraFirmwareDescription_String\t\t= 2028,\n\tProp_DisplayFPGAVersion_Uint64\t\t\t\t= 2029,\n\tProp_DisplayBootloaderVersion_Uint64\t\t= 2030,\n\tProp_DisplayHardwareVersion_Uint64\t\t\t= 2031,\n\tProp_AudioFirmwareVersion_Uint64\t\t\t= 2032,\n\tProp_CameraCompatibilityMode_Int32\t\t\t= 2033,\n\tProp_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034,\n\tProp_ScreenshotVerticalFieldOfViewDegrees_Float = 2035,\n\tProp_DisplaySuppressed_Bool\t\t\t\t\t= 2036,\n\tProp_DisplayAllowNightMode_Bool\t\t\t\t= 2037,\n\tProp_DisplayMCImageWidth_Int32\t\t\t\t= 2038,\n\tProp_DisplayMCImageHeight_Int32\t\t\t\t= 2039,\n\tProp_DisplayMCImageNumChannels_Int32\t\t= 2040,\n\tProp_DisplayMCImageData_Binary\t\t\t\t= 2041,\n\tProp_SecondsFromPhotonsToVblank_Float\t\t= 2042,\n\tProp_DriverDirectModeSendsVsyncEvents_Bool\t= 2043,\n\tProp_DisplayDebugMode_Bool\t\t\t\t\t= 2044,\n\tProp_GraphicsAdapterLuid_Uint64\t\t\t\t= 2045,\n\tProp_DriverProvidedChaperonePath_String\t\t= 2048,\n\tProp_ExpectedTrackingReferenceCount_Int32\t= 2049, // expected number of sensors or basestations to reserve UI space for\n\tProp_ExpectedControllerCount_Int32\t\t\t= 2050, // expected number of tracked controllers to reserve UI space for\n\tProp_NamedIconPathControllerLeftDeviceOff_String\t= 2051, // placeholder icon for \"left\" controller if not yet detected/loaded\n\tProp_NamedIconPathControllerRightDeviceOff_String\t= 2052, // placeholder icon for \"right\" controller if not yet detected/loaded\n\tProp_NamedIconPathTrackingReferenceDeviceOff_String\t= 2053, // placeholder icon for sensor/base if not yet detected/loaded\n\tProp_DoNotApplyPrediction_Bool\t\t\t\t= 2054, // currently no effect. was used to disable HMD pose prediction on MR, which is now done by MR driver setting velocity=0\n\tProp_CameraToHeadTransforms_Matrix34_Array\t= 2055,\n\tProp_DistortionMeshResolution_Int32\t\t\t= 2056, // custom resolution of compositor calls to IVRSystem::ComputeDistortion\n\tProp_DriverIsDrawingControllers_Bool\t\t= 2057,\n\tProp_DriverRequestsApplicationPause_Bool\t= 2058,\n\tProp_DriverRequestsReducedRendering_Bool\t= 2059,\n\tProp_MinimumIpdStepMeters_Float\t\t\t\t= 2060,\n\tProp_AudioBridgeFirmwareVersion_Uint64\t\t= 2061,\n\tProp_ImageBridgeFirmwareVersion_Uint64\t\t= 2062,\n\tProp_ImuToHeadTransform_Matrix34\t\t\t= 2063,\n\tProp_ImuFactoryGyroBias_Vector3\t\t\t\t= 2064,\n\tProp_ImuFactoryGyroScale_Vector3\t\t\t= 2065,\n\tProp_ImuFactoryAccelerometerBias_Vector3\t= 2066,\n\tProp_ImuFactoryAccelerometerScale_Vector3\t= 2067,\n\t// reserved 2068\n\tProp_ConfigurationIncludesLighthouse20Features_Bool = 2069,\n\tProp_AdditionalRadioFeatures_Uint64         = 2070,\n\tProp_CameraWhiteBalance_Vector4_Array\t\t= 2071, // Prop_NumCameras_Int32-sized array of float[4] RGBG white balance calibration data (max size is vr::k_unMaxCameras)\n\tProp_CameraDistortionFunction_Int32_Array\t= 2072, // Prop_NumCameras_Int32-sized array of vr::EVRDistortionFunctionType values (max size is vr::k_unMaxCameras)\n\tProp_CameraDistortionCoefficients_Float_Array = 2073, // Prop_NumCameras_Int32-sized array of double[vr::k_unMaxDistortionFunctionParameters] (max size is vr::k_unMaxCameras)\n\tProp_ExpectedControllerType_String\t\t\t= 2074,\n\tProp_HmdTrackingStyle_Int32\t\t\t\t\t= 2075, // one of EHmdTrackingStyle\n\tProp_DriverProvidedChaperoneVisibility_Bool = 2076,\n\tProp_HmdColumnCorrectionSettingPrefix_String = 2077,\n\tProp_CameraSupportsCompatibilityModes_Bool\t= 2078,\n\tProp_SupportsRoomViewDepthProjection_Bool\t= 2079,\n\tProp_DisplayAvailableFrameRates_Float_Array = 2080, // populated by compositor from actual EDID list when available from GPU driver\n\tProp_DisplaySupportsMultipleFramerates_Bool = 2081, // if this is true but Prop_DisplayAvailableFrameRates_Float_Array is empty, explain to user\n\tProp_DisplayColorMultLeft_Vector3\t\t\t= 2082,\n\tProp_DisplayColorMultRight_Vector3\t\t\t= 2083,\n\tProp_DisplaySupportsRuntimeFramerateChange_Bool = 2084,\n\tProp_DisplaySupportsAnalogGain_Bool \t\t= 2085,\n\tProp_DisplayMinAnalogGain_Float \t\t\t= 2086,\n\tProp_DisplayMaxAnalogGain_Float \t\t\t= 2087,\n    Prop_CameraExposureTime_Float               = 2088,\n    Prop_CameraGlobalGain_Float                 = 2089,\n\t// Prop_DashboardLayoutPathName_String \t\t= 2090, // DELETED\n\tProp_DashboardScale_Float \t\t\t\t\t= 2091,\n\t// Prop_PeerButtonInfo_String\t\t\t\t\t= 2092, // DELETED\n\tProp_Hmd_SupportsHDR10_Bool\t\t\t\t\t= 2093,\n\tProp_Hmd_EnableParallelRenderCameras_Bool\t= 2094,\n\tProp_DriverProvidedChaperoneJson_String\t\t= 2095, // higher priority than Prop_DriverProvidedChaperonePath_String\n\tProp_ForceSystemLayerUseAppPoses_Bool\t\t= 2096,\n\tProp_DashboardLinkSupport_Int32\t\t\t\t= 2097,\n\tProp_DisplayMinUIAnalogGain_Float \t\t\t= 2098,\n\n\tProp_IpdUIRangeMinMeters_Float \t\t\t\t= 2100,\n\tProp_IpdUIRangeMaxMeters_Float \t\t\t\t= 2101,\n\tProp_Hmd_SupportsHDCP14LegacyCompat_Bool\t= 2102,\n\tProp_Hmd_SupportsMicMonitoring_Bool \t\t= 2103,\n\tProp_Hmd_SupportsDisplayPortTrainingMode_Bool\t= 2104,\n\tProp_Hmd_SupportsRoomViewDirect_Bool \t\t= 2105,\n\tProp_Hmd_SupportsAppThrottling_Bool\t\t\t= 2106,\n\tProp_Hmd_SupportsGpuBusMonitoring_Bool\t\t= 2107,\n\tProp_DriverDisplaysIPDChanges_Bool\t\t\t= 2108,\n\t// Prop_Driver_RecenterSupport_Int32\t\t\t= 2109, // DELETED\n\tProp_Reserved_2110\t\t\t\t\t\t\t= 2110,\n\tProp_Reserved_2111\t\t\t\t\t\t\t= 2111,\n\tProp_Reserved_2112\t\t\t\t\t\t\t= 2112,\n\n\tProp_Hmd_MaxDistortedTextureWidth_Int32\t\t= 2113,\n\tProp_Hmd_MaxDistortedTextureHeight_Int32\t= 2114,\n\tProp_Hmd_AllowSupersampleFiltering_Bool\t\t= 2115,\n\n\tProp_Hmd_AllowsClientToControlTextureIndex  = 2116,\n\tProp_Reserved_2117\t\t\t\t\t\t\t= 2117,\n\n\t// Driver requested mura correction properties\n\tProp_DriverRequestedMuraCorrectionMode_Int32\t\t= 2200,\n\tProp_DriverRequestedMuraFeather_InnerLeft_Int32\t\t= 2201,\n\tProp_DriverRequestedMuraFeather_InnerRight_Int32\t= 2202,\n\tProp_DriverRequestedMuraFeather_InnerTop_Int32\t\t= 2203,\n\tProp_DriverRequestedMuraFeather_InnerBottom_Int32\t= 2204,\n\tProp_DriverRequestedMuraFeather_OuterLeft_Int32\t\t= 2205,\n\tProp_DriverRequestedMuraFeather_OuterRight_Int32\t= 2206,\n\tProp_DriverRequestedMuraFeather_OuterTop_Int32\t\t= 2207,\n\tProp_DriverRequestedMuraFeather_OuterBottom_Int32\t= 2208,\n\n\tProp_Audio_DefaultPlaybackDeviceId_String\t\t\t\t= 2300,\n\tProp_Audio_DefaultRecordingDeviceId_String\t\t\t\t= 2301,\n\tProp_Audio_DefaultPlaybackDeviceVolume_Float\t\t\t= 2302,\n\tProp_Audio_SupportsDualSpeakerAndJackOutput_Bool\t\t= 2303,\n\tProp_Audio_DriverManagesPlaybackVolumeControl_Bool\t\t= 2304,\n\tProp_Audio_DriverPlaybackVolume_Float\t\t\t\t\t= 2305,\n\tProp_Audio_DriverPlaybackMute_Bool\t\t\t\t\t\t= 2306,\n\tProp_Audio_DriverManagesRecordingVolumeControl_Bool\t\t= 2307,\n\tProp_Audio_DriverRecordingVolume_Float\t\t\t\t\t= 2308,\n\tProp_Audio_DriverRecordingMute_Bool\t\t\t\t\t\t= 2309,\n\n\t// Pipewire Audio Stuff\n\tProp_Audio_PipewirePlaybackNode_Int32\t\t\t\t\t= 2400,\n\tProp_Audio_PipewireRecordingNode_Int32\t\t\t\t\t= 2401,\n\n\t// Properties that are unique to TrackedDeviceClass_Controller\n\tProp_AttachedDeviceId_String\t\t\t\t= 3000,\n\tProp_SupportedButtons_Uint64\t\t\t\t= 3001,\n\tProp_Axis0Type_Int32\t\t\t\t\t\t= 3002, // Return value is of type EVRControllerAxisType\n\tProp_Axis1Type_Int32\t\t\t\t\t\t= 3003, // Return value is of type EVRControllerAxisType\n\tProp_Axis2Type_Int32\t\t\t\t\t\t= 3004, // Return value is of type EVRControllerAxisType\n\tProp_Axis3Type_Int32\t\t\t\t\t\t= 3005, // Return value is of type EVRControllerAxisType\n\tProp_Axis4Type_Int32\t\t\t\t\t\t= 3006, // Return value is of type EVRControllerAxisType\n\tProp_ControllerRoleHint_Int32\t\t\t\t= 3007, // Return value is of type ETrackedControllerRole\n\n\t// Properties that are unique to TrackedDeviceClass_TrackingReference\n\tProp_FieldOfViewLeftDegrees_Float\t\t\t= 4000,\n\tProp_FieldOfViewRightDegrees_Float\t\t\t= 4001,\n\tProp_FieldOfViewTopDegrees_Float\t\t\t= 4002,\n\tProp_FieldOfViewBottomDegrees_Float\t\t\t= 4003,\n\tProp_TrackingRangeMinimumMeters_Float\t\t= 4004,\n\tProp_TrackingRangeMaximumMeters_Float\t\t= 4005,\n\tProp_ModeLabel_String\t\t\t\t\t\t= 4006,\n\tProp_CanWirelessIdentify_Bool               = 4007, // volatile, based on radio presence and fw discovery\n\tProp_Nonce_Int32                            = 4008,\n\n\t// Properties that are used for user interface like icons names\n\tProp_IconPathName_String\t\t\t\t\t\t= 5000, // DEPRECATED. Value not referenced. Now expected to be part of icon path properties.\n\tProp_NamedIconPathDeviceOff_String\t\t\t\t= 5001, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceSearching_String\t\t= 5002, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceSearchingAlert_String\t= 5003, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceReady_String\t\t\t= 5004, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceReadyAlert_String\t\t= 5005, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceNotReady_String\t\t\t= 5006, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceStandby_String\t\t\t= 5007, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceAlertLow_String\t\t\t= 5008, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\tProp_NamedIconPathDeviceStandbyAlert_String\t\t= 5009, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others\n\n\t// Properties that are used by helpers, but are opaque to applications\n\tProp_DisplayHiddenArea_Binary_Start\t\t\t\t= 5100,\n\tProp_DisplayHiddenArea_Binary_End\t\t\t\t= 5150,\n\tProp_ParentContainer\t\t\t\t\t\t\t= 5151,\n\tProp_OverrideContainer_Uint64\t\t\t\t\t= 5152,\n\n\t// Properties that are unique to drivers\n\tProp_UserConfigPath_String\t\t\t\t\t= 6000,\n\tProp_InstallPath_String\t\t\t\t\t\t= 6001,\n\tProp_HasDisplayComponent_Bool\t\t\t\t= 6002,\n\tProp_HasControllerComponent_Bool\t\t\t= 6003,\n\tProp_HasCameraComponent_Bool\t\t\t\t= 6004,\n\tProp_HasDriverDirectModeComponent_Bool\t\t= 6005,\n\tProp_HasVirtualDisplayComponent_Bool\t\t= 6006,\n\tProp_HasSpatialAnchorsSupport_Bool\t\t\t= 6007,\n\tProp_SupportsXrTextureSets_Bool\t\t\t\t= 6008,\n\tProp_SupportsXrEyeGazeInteraction_Bool\t\t= 6009,\n\tProp_DeviceHasNoIMU_Bool\t\t\t\t\t= 6010,\n\tProp_UseAdvancedPrediction_Bool\t\t\t\t= 6011,\n\n\t// Properties that are set internally based on other information provided by drivers\n\tProp_ControllerType_String\t\t\t\t\t= 7000,\n\t//Prop_LegacyInputProfile_String\t\t\t\t= 7001, // This is no longer used. See \"legacy_binding\" in the input profile instead.\n\tProp_ControllerHandSelectionPriority_Int32\t= 7002, // Allows hand assignments to prefer some controllers over others. High numbers are selected over low numbers\n\n\t// Vendors are free to expose private debug data in this reserved region\n\tProp_VendorSpecific_Reserved_Start\t\t\t= 10000,\n\tProp_VendorSpecific_Reserved_End\t\t\t= 10999,\n\n\t// Addl SteamVR Reserved Space\n\tProp_Reserved_11000\t\t\t\t\t\t\t= 11000,\n\tProp_Reserved_11001\t\t\t\t\t\t\t= 11001,\n\tProp_Reserved_11002\t\t\t\t\t\t\t= 11002,\n\tProp_Reserved_11003\t\t\t\t\t\t\t= 11003,\n\tProp_Reserved_11004\t\t\t\t\t\t\t= 11004,\n\n\tProp_TrackedDeviceProperty_Max\t\t\t\t= 1000000,\n};\n\n/** No string property will ever be longer than this length */\nstatic const uint32_t k_unMaxPropertyStringSize = 32 * 1024;\n\n/** Used to return errors that occur when reading properties. */\nenum ETrackedPropertyError\n{\n\tTrackedProp_Success\t\t\t\t\t\t= 0,\n\tTrackedProp_WrongDataType\t\t\t\t= 1,\n\tTrackedProp_WrongDeviceClass\t\t\t= 2,\n\tTrackedProp_BufferTooSmall\t\t\t\t= 3,\n\tTrackedProp_UnknownProperty\t\t\t\t= 4, // Driver has not set the property (and may not ever).\n\tTrackedProp_InvalidDevice\t\t\t\t= 5,\n\tTrackedProp_CouldNotContactServer\t\t= 6,\n\tTrackedProp_ValueNotProvidedByDevice\t= 7,\n\tTrackedProp_StringExceedsMaximumLength\t= 8,\n\tTrackedProp_NotYetAvailable\t\t\t\t= 9, // The property value isn't known yet, but is expected soon. Call again later.\n\tTrackedProp_PermissionDenied\t\t\t= 10,\n\tTrackedProp_InvalidOperation\t\t\t= 11,\n\tTrackedProp_CannotWriteToWildcards\t\t= 12,\n\tTrackedProp_IPCReadFailure\t\t\t\t= 13,\n\tTrackedProp_OutOfMemory\t\t\t\t\t= 14,\n\tTrackedProp_InvalidContainer\t\t\t= 15,\n};\n\n/** Used to drive certain text in the UI when talking about the tracking system for the HMD */\nenum EHmdTrackingStyle\n{\n\tHmdTrackingStyle_Unknown\t\t\t\t= 0,\n\n\tHmdTrackingStyle_Lighthouse\t\t\t\t= 1, // base stations and lasers\n\tHmdTrackingStyle_OutsideInCameras\t\t= 2, // Cameras and LED, Rift 1 style\n\tHmdTrackingStyle_InsideOutCameras\t\t= 3, // Cameras on HMD looking at the world\n};\n\ntypedef uint64_t VRActionHandle_t;\ntypedef uint64_t VRActionSetHandle_t;\ntypedef uint64_t VRInputValueHandle_t;\ntypedef uint64_t VRInputComponentHandle_t;\n\nstatic const VRActionHandle_t k_ulInvalidActionHandle = 0;\nstatic const VRActionSetHandle_t k_ulInvalidActionSetHandle = 0;\nstatic const VRInputValueHandle_t k_ulInvalidInputValueHandle = 0;\nstatic const VRInputComponentHandle_t k_ulInvalidInputComponentHandle = 0;\n\n\n/** Allows the application to control how scene textures are used by the compositor when calling Submit. */\nenum EVRSubmitFlags\n{\n\t// Simple render path. App submits rendered left and right eye images with no lens distortion correction applied.\n\tSubmit_Default = 0x00,\n\n\t// App submits final left and right eye images with lens distortion already applied (lens distortion makes the images appear\n\t// barrel distorted with chromatic aberration correction applied). The app would have used the data returned by\n\t// vr::IVRSystem::ComputeDistortion() to apply the correct distortion to the rendered images before calling Submit().\n\tSubmit_LensDistortionAlreadyApplied = 0x01,\n\n\t// If the texture pointer passed in is actually a renderbuffer (e.g. for MSAA in OpenGL) then set this flag.\n\tSubmit_GlRenderBuffer = 0x02,\n\n\t// Do not use\n\tSubmit_Reserved = 0x04,\n\n\t// Set to indicate that pTexture is a pointer to a VRTextureWithPose_t.\n\t// This flag can be combined with Submit_TextureWithDepth to pass a VRTextureWithPoseAndDepth_t.\n\tSubmit_TextureWithPose = 0x08,\n\n\t// Set to indicate that pTexture is a pointer to a VRTextureWithDepth_t.\n\t// This flag can be combined with Submit_TextureWithPose to pass a VRTextureWithPoseAndDepth_t.\n\tSubmit_TextureWithDepth = 0x10,\n\n\t// Set to indicate a discontinuity between this and the last frame.\n\t// This will prevent motion smoothing from attempting to extrapolate using the pair.\n\tSubmit_FrameDiscontinuity = 0x20,\n\n\t// Set to indicate that pTexture->handle is a contains VRVulkanTextureArrayData_t\n\tSubmit_VulkanTextureWithArrayData = 0x40,\n\n\t// If the texture pointer passed in is an OpenGL Array texture, set this flag\n\tSubmit_GlArrayTexture = 0x80,\n\n\t// If the texture is an EGL texture and not an glX/wGL texture (Linux only, currently)\n\tSubmit_IsEgl = 0x100,\n\n\t// Do not use\n\tSubmit_Reserved2 = 0x08000,\n\tSubmit_Reserved3 = 0x10000,\n\tSubmit_Reserved4 = 0x20000,\n\tSubmit_Reserved5 = 0x40000,\n};\n\n/** Data required for passing Vulkan textures to IVRCompositor::Submit.\n* Be sure to call OpenVR_Shutdown before destroying these resources.\n* Please see https://github.com/ValveSoftware/openvr/wiki/Vulkan for Vulkan-specific documentation */\nstruct VRVulkanTextureData_t\n{\n\tuint64_t m_nImage; // VkImage\n\tVkDevice_T *m_pDevice;\n\tVkPhysicalDevice_T *m_pPhysicalDevice;\n\tVkInstance_T *m_pInstance;\n\tVkQueue_T *m_pQueue;\n\tuint32_t m_nQueueFamilyIndex;\n\tuint32_t m_nWidth, m_nHeight, m_nFormat, m_nSampleCount;\n};\n\n/** Data required for passing Vulkan texture arrays to IVRCompositor::Submit.\n* Be sure to call OpenVR_Shutdown before destroying these resources.\n* Please see https://github.com/ValveSoftware/openvr/wiki/Vulkan for Vulkan-specific documentation */\nstruct VRVulkanTextureArrayData_t : public VRVulkanTextureData_t\n{\n\tuint32_t m_unArrayIndex;\n\tuint32_t m_unArraySize;\n};\n\n/** Data required for passing D3D12 textures to IVRCompositor::Submit.\n* Be sure to call OpenVR_Shutdown before destroying these resources. */\nstruct D3D12TextureData_t\n{\n\tID3D12Resource *m_pResource;\n\tID3D12CommandQueue *m_pCommandQueue;\n\tuint32_t m_nNodeMask;\n};\n\n/** Status of the overall system or tracked objects */\nenum EVRState\n{\n\tVRState_Undefined = -1,\n\tVRState_Off = 0,\n\tVRState_Searching = 1,\n\tVRState_Searching_Alert = 2,\n\tVRState_Ready = 3,\n\tVRState_Ready_Alert = 4,\n\tVRState_NotReady = 5,\n\tVRState_Standby = 6,\n\tVRState_Ready_Alert_Low = 7,\n};\n\n/** The types of events that could be posted (and what the parameters mean for each event type) */\nenum EVREventType\n{\n\tVREvent_None = 0,\n\n\tVREvent_TrackedDeviceActivated\t\t= 100,\n\tVREvent_TrackedDeviceDeactivated\t= 101,\n\tVREvent_TrackedDeviceUpdated\t\t= 102,\n\tVREvent_TrackedDeviceUserInteractionStarted\t= 103,\n\tVREvent_TrackedDeviceUserInteractionEnded\t= 104,\n\tVREvent_IpdChanged\t\t\t\t\t= 105,\n\tVREvent_EnterStandbyMode\t\t\t= 106,\n\tVREvent_LeaveStandbyMode\t\t\t= 107,\n\tVREvent_TrackedDeviceRoleChanged\t= 108,\n\tVREvent_WatchdogWakeUpRequested\t\t= 109,\n\tVREvent_LensDistortionChanged\t\t= 110,\n\tVREvent_PropertyChanged\t\t\t\t= 111,\n\tVREvent_WirelessDisconnect\t\t\t= 112,\n\tVREvent_WirelessReconnect\t\t\t= 113,\n\tVREvent_Reserved_0114\t\t\t\t= 114,\n\tVREvent_Reserved_0115\t\t\t\t= 115,\n\n\tVREvent_ButtonPress\t\t\t\t\t= 200, // data is controller\n\tVREvent_ButtonUnpress\t\t\t\t= 201, // data is controller\n\tVREvent_ButtonTouch\t\t\t\t\t= 202, // data is controller\n\tVREvent_ButtonUntouch\t\t\t\t= 203, // data is controller\n\n\t// VREvent_DualAnalog_Press\t\t\t= 250, // No longer sent\n\t// VREvent_DualAnalog_Unpress\t\t= 251, // No longer sent\n\t// VREvent_DualAnalog_Touch\t\t\t= 252, // No longer sent\n\t// VREvent_DualAnalog_Untouch\t\t= 253, // No longer sent\n\t// VREvent_DualAnalog_Move\t\t\t= 254, // No longer sent\n\t// VREvent_DualAnalog_ModeSwitch1\t= 255, // No longer sent\n\t// VREvent_DualAnalog_ModeSwitch2\t= 256, // No longer sent\n\tVREvent_Modal_Cancel\t\t\t\t= 257, // Sent to overlays with the\n\n\tVREvent_MouseMove\t\t\t\t\t= 300, // data is mouse\n\tVREvent_MouseButtonDown\t\t\t\t= 301, // data is mouse\n\tVREvent_MouseButtonUp\t\t\t\t= 302, // data is mouse\n\tVREvent_FocusEnter\t\t\t\t\t= 303, // data is overlay\n\tVREvent_FocusLeave\t\t\t\t\t= 304, // data is overlay\n\tVREvent_ScrollDiscrete\t\t\t\t= 305, // data is scroll\n\tVREvent_TouchPadMove\t\t\t\t= 306, // data is mouse\n\tVREvent_OverlayFocusChanged\t\t\t= 307, // data is overlay, global event\n\tVREvent_ReloadOverlays\t\t\t\t= 308,\n\tVREvent_ScrollSmooth\t\t\t\t= 309, // data is scroll\n\tVREvent_LockMousePosition\t\t\t= 310, // data is mouse\n\tVREvent_UnlockMousePosition\t\t\t= 311, // data is mouse\n\n\tVREvent_InputFocusCaptured\t\t\t= 400, // data is process DEPRECATED\n\tVREvent_InputFocusReleased\t\t\t= 401, // data is process DEPRECATED\n\t// VREvent_SceneFocusLost\t\t\t= 402, // data is process\n\t// VREvent_SceneFocusGained\t\t\t= 403, // data is process\n\tVREvent_SceneApplicationChanged\t\t= 404, // data is process - The App actually drawing the scene changed (usually to or from the compositor)\n\t// VREvent_SceneFocusChanged\t\t= 405, // data is process - This is defunct and will not be called.\n\tVREvent_InputFocusChanged\t\t\t= 406, // data is process\n\t// VREvent_SceneApplicationSecondaryRenderingStarted = 407,\n\tVREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, // data is process\n\tVREvent_ActionBindingReloaded\t\t = 409, // data is process - The App that action binds reloaded for\n\n\tVREvent_HideRenderModels\t\t\t= 410, // Sent to the scene application to request hiding render models temporarily\n\tVREvent_ShowRenderModels\t\t\t= 411, // Sent to the scene application to request restoring render model visibility\n\n\tVREvent_SceneApplicationStateChanged = 412, // No data; but query VRApplications()->GetSceneApplicationState();\n\n\tVREvent_SceneAppPipeDisconnected    = 413, // data is process - Called when the scene app's pipe has been closed.\n\n\tVREvent_ConsoleOpened               = 420,\n\tVREvent_ConsoleClosed               = 421,\n\n\tVREvent_OverlayShown\t\t\t\t= 500, // Indicates that an overlay is now visible to someone and should be rendering normally. Reflects IVROverlay::IsOverlayVisible() becoming true.\n\tVREvent_OverlayHidden\t\t\t\t= 501, // Indicates that an overlay is no longer visible to someone and doesn't need to render frames. Reflects IVROverlay::IsOverlayVisible() becoming false.\n\tVREvent_DashboardActivated\t\t\t= 502,\n\tVREvent_DashboardDeactivated\t\t= 503,\n\t//VREvent_DashboardThumbSelected\t\t= 504, // Sent to the overlay manager - data is overlay - No longer sent\n\t//VREvent_DashboardRequested\t\t\t= 505, // Sent to the overlay manager - data is overlay\n\tVREvent_ResetDashboard\t\t\t\t= 506, // Send to the overlay manager\n\t//VREvent_RenderToast\t\t\t\t\t= 507, // Send to the dashboard to render a toast - data is the notification ID -- no longer sent\n\tVREvent_ImageLoaded\t\t\t\t\t= 508, // Sent to overlays when a SetOverlayRaw or SetOverlayFromFile call finishes loading\n\tVREvent_ShowKeyboard\t\t\t\t= 509, // Sent to keyboard renderer in the dashboard to invoke it\n\tVREvent_HideKeyboard\t\t\t\t= 510, // Sent to keyboard renderer in the dashboard to hide it\n\tVREvent_OverlayGamepadFocusGained\t= 511, // Sent to an overlay when IVROverlay::SetFocusOverlay is called on it\n\tVREvent_OverlayGamepadFocusLost\t\t= 512, // Send to an overlay when it previously had focus and IVROverlay::SetFocusOverlay is called on something else\n\tVREvent_OverlaySharedTextureChanged = 513,\n\t//VREvent_DashboardGuideButtonDown\t= 514, // These are no longer sent\n\t//VREvent_DashboardGuideButtonUp\t\t= 515,\n\tVREvent_ScreenshotTriggered\t\t\t= 516, // Screenshot button combo was pressed, Dashboard should request a screenshot\n\tVREvent_ImageFailed\t\t\t\t\t= 517, // Sent to overlays when a SetOverlayRaw or SetOverlayfromFail fails to load\n\tVREvent_DashboardOverlayCreated\t\t= 518,\n\tVREvent_SwitchGamepadFocus\t\t\t= 519,\n\n\t// Screenshot API\n\tVREvent_RequestScreenshot\t\t\t\t= 520, // Sent by vrclient application to compositor to take a screenshot\n\tVREvent_ScreenshotTaken\t\t\t\t\t= 521, // Sent by compositor to the application that the screenshot has been taken\n\tVREvent_ScreenshotFailed\t\t\t\t= 522, // Sent by compositor to the application that the screenshot failed to be taken\n\tVREvent_SubmitScreenshotToDashboard\t\t= 523, // Sent by compositor to the dashboard that a completed screenshot was submitted\n\tVREvent_ScreenshotProgressToDashboard\t= 524, // Sent by compositor to the dashboard that a completed screenshot was submitted\n\n\tVREvent_PrimaryDashboardDeviceChanged\t= 525,\n\tVREvent_RoomViewShown\t\t\t\t\t= 526, // Sent by compositor whenever room-view is enabled\n\tVREvent_RoomViewHidden\t\t\t\t\t= 527, // Sent by compositor whenever room-view is disabled\n\tVREvent_ShowUI\t\t\t\t\t\t\t= 528, // data is showUi\n\tVREvent_ShowDevTools\t\t\t\t\t= 529, // data is showDevTools\n\tVREvent_DesktopViewUpdating\t\t\t\t= 530,\n\tVREvent_DesktopViewReady\t\t\t\t= 531,\n\n\tVREvent_StartDashboard\t\t\t\t\t= 532,\n\tVREvent_ElevatePrism\t\t\t\t\t= 533,\n\tVREvent_OverlayClosed\t\t\t\t\t= 534,\n\tVREvent_DashboardThumbChanged\t\t\t= 535, // Sent when a dashboard thumbnail image changes\n\tVREvent_DesktopMightBeVisible\t\t\t= 536, // Sent when any known desktop related overlay is visible\n\tVREvent_DesktopMightBeHidden\t\t\t= 537, // Sent when all known desktop related overlays are hidden\n\tVREvent_MutualSteamCapabilitiesChanged\t= 538, // Sent when the set of capabilities common between both Steam and SteamVR have changed.\n\tVREvent_OverlayCreated\t\t\t\t\t= 539, // An OpenVR overlay of any sort was created. Data is overlay.\n\tVREvent_OverlayDestroyed\t\t\t\t= 540, // An OpenVR overlay of any sort was destroyed. Data is overlay.\n\n\tVREvent_TrackingRecordingStarted\t\t= 541,\n\tVREvent_TrackingRecordingStopped\t\t= 542,\n\tVREvent_SetTrackingRecordingPath\t\t= 543,\n\n\tVREvent_Reserved_0560  \t\t\t\t\t= 560, // No data\n\tVREvent_Reserved_0561  \t\t\t\t\t= 561, // No data\n\tVREvent_Reserved_0562\t\t\t\t\t= 562, // No data\n\tVREvent_Reserved_0563\t\t\t\t\t= 563, // No data\n\n\tVREvent_Notification_Shown\t\t\t\t= 600,\n\tVREvent_Notification_Hidden\t\t\t\t= 601,\n\tVREvent_Notification_BeginInteraction\t= 602,\n\tVREvent_Notification_Destroyed\t\t\t= 603,\n\n\tVREvent_Quit\t\t\t\t\t\t\t= 700, // data is process\n\tVREvent_ProcessQuit\t\t\t\t\t\t= 701, // data is process\n\t//VREvent_QuitAborted_UserPrompt\t\t\t= 702, // data is process\n\tVREvent_QuitAcknowledged\t\t\t\t= 703, // data is process\n\tVREvent_DriverRequestedQuit\t\t\t\t= 704, // The driver has requested that SteamVR shut down\n\tVREvent_RestartRequested\t\t\t\t= 705, // A driver or other component wants the user to restart SteamVR\n\tVREvent_InvalidateSwapTextureSets\t\t= 706,\n\tVREvent_RequestDisconnectWirelessHMD\t= 707, // vrserver asks vrlink to disconnect\n\n\tVREvent_ChaperoneDataHasChanged\t\t\t= 800, // this will never happen with the new chaperone system\n\tVREvent_ChaperoneUniverseHasChanged\t\t= 801,\n\tVREvent_ChaperoneTempDataHasChanged\t\t= 802, // this will never happen with the new chaperone system\n\tVREvent_ChaperoneSettingsHaveChanged\t= 803,\n\tVREvent_SeatedZeroPoseReset\t\t\t\t= 804,\n\tVREvent_ChaperoneFlushCache\t\t\t\t= 805, // Sent when the process needs to reload any cached data it retrieved from VRChaperone()\n\tVREvent_ChaperoneRoomSetupStarting\t    = 806, // Triggered by CVRChaperoneClient::RoomSetupStarting\n\tVREvent_ChaperoneRoomSetupCommitted\t    = 807, // Triggered by CVRChaperoneClient::CommitWorkingCopy (formerly VREvent_ChaperoneRoomSetupFinished)\n\tVREvent_StandingZeroPoseReset\t\t\t= 808,\n\tVREvent_Reserved_0809  \t\t\t\t\t= 809,\n\tVREvent_Reserved_0810  \t\t\t\t\t= 810,\n\tVREvent_Reserved_0811  \t\t\t\t\t= 811,\n\n\tVREvent_AudioSettingsHaveChanged\t\t= 820,\n\n\tVREvent_BackgroundSettingHasChanged\t\t\t\t= 850,\n\tVREvent_CameraSettingsHaveChanged\t\t\t\t= 851,\n\tVREvent_ReprojectionSettingHasChanged\t\t\t= 852,\n\tVREvent_ModelSkinSettingsHaveChanged\t\t\t= 853,\n\tVREvent_EnvironmentSettingsHaveChanged\t\t\t= 854,\n\tVREvent_PowerSettingsHaveChanged\t\t\t\t= 855,\n\tVREvent_EnableHomeAppSettingsHaveChanged\t\t= 856,\n\tVREvent_SteamVRSectionSettingChanged\t\t\t= 857,\n\tVREvent_LighthouseSectionSettingChanged\t\t\t= 858,\n\tVREvent_NullSectionSettingChanged\t\t\t\t= 859,\n\tVREvent_UserInterfaceSectionSettingChanged\t\t= 860,\n\tVREvent_NotificationsSectionSettingChanged\t\t= 861,\n\tVREvent_KeyboardSectionSettingChanged\t\t\t= 862,\n\tVREvent_PerfSectionSettingChanged\t\t\t\t= 863,\n\tVREvent_DashboardSectionSettingChanged\t\t\t= 864,\n\tVREvent_WebInterfaceSectionSettingChanged\t\t= 865,\n\tVREvent_TrackersSectionSettingChanged\t\t\t= 866,\n\tVREvent_LastKnownSectionSettingChanged\t\t\t= 867,\n\tVREvent_DismissedWarningsSectionSettingChanged\t= 868,\n\tVREvent_GpuSpeedSectionSettingChanged\t\t\t= 869,\n\tVREvent_WindowsMRSectionSettingChanged\t\t\t= 870,\n\tVREvent_OtherSectionSettingChanged\t\t\t\t= 871,\n\tVREvent_AnyDriverSettingsChanged\t\t\t\t= 872,\n\n\tVREvent_StatusUpdate\t\t\t\t\t= 900,\n\n\tVREvent_WebInterface_InstallDriverCompleted = 950,\n\n\tVREvent_MCImageUpdated\t\t\t\t\t= 1000,\n\n\tVREvent_FirmwareUpdateStarted\t\t\t= 1100,\n\tVREvent_FirmwareUpdateFinished\t\t\t= 1101,\n\n\tVREvent_KeyboardClosed\t\t\t\t\t= 1200, // DEPRECATED: Sent only to the overlay it closed for, or globally if it was closed for a scene app\n\tVREvent_KeyboardCharInput\t\t\t\t= 1201, // Sent on keyboard input. Warning: event type appears as both global event and overlay event\n\tVREvent_KeyboardDone\t\t\t\t\t= 1202, // Sent when DONE button clicked on keyboard. Warning: event type appears as both global event and overlay event\n\tVREvent_KeyboardOpened_Global\t\t\t= 1203, // Sent globally when the keyboard is opened. data.keyboard.overlayHandle is who it was opened for (scene app if k_ulOverlayHandleInvalid)\n\tVREvent_KeyboardClosed_Global\t\t\t= 1204, // Sent globally when the keyboard is closed. data.keyboard.overlayHandle is who it was opened for (scene app if k_ulOverlayHandleInvalid)\n\n\t//VREvent_ApplicationTransitionStarted\t\t= 1300,\n\t//VREvent_ApplicationTransitionAborted\t\t= 1301,\n\t//VREvent_ApplicationTransitionNewAppStarted\t= 1302,\n\tVREvent_ApplicationListUpdated\t\t\t\t= 1303,\n\tVREvent_ApplicationMimeTypeLoad\t\t\t\t= 1304,\n\t// VREvent_ApplicationTransitionNewAppLaunchComplete = 1305,\n\tVREvent_ProcessConnected\t\t\t\t\t= 1306,\n\tVREvent_ProcessDisconnected\t\t\t\t\t= 1307,\n\n\t//VREvent_Compositor_MirrorWindowShown\t\t= 1400, // DEPRECATED\n\t//VREvent_Compositor_MirrorWindowHidden\t\t= 1401, // DEPRECATED\n\tVREvent_Compositor_ChaperoneBoundsShown\t\t= 1410,\n\tVREvent_Compositor_ChaperoneBoundsHidden\t= 1411,\n\tVREvent_Compositor_DisplayDisconnected\t\t= 1412,\n\tVREvent_Compositor_DisplayReconnected\t\t= 1413,\n\tVREvent_Compositor_HDCPError\t\t\t\t= 1414, // data is hdcpError\n\tVREvent_Compositor_ApplicationNotResponding\t= 1415,\n\tVREvent_Compositor_ApplicationResumed\t\t= 1416,\n\tVREvent_Compositor_OutOfVideoMemory\t\t\t= 1417,\n\tVREvent_Compositor_DisplayModeNotSupported\t= 1418, // k_pch_SteamVR_PreferredRefreshRate\n\tVREvent_Compositor_StageOverrideReady\t\t= 1419,\n\tVREvent_Compositor_RequestDisconnectReconnect = 1420,\n\n\tVREvent_TrackedCamera_StartVideoStream  = 1500,\n\tVREvent_TrackedCamera_StopVideoStream   = 1501,\n\tVREvent_TrackedCamera_PauseVideoStream  = 1502,\n\tVREvent_TrackedCamera_ResumeVideoStream = 1503,\n\tVREvent_TrackedCamera_EditingSurface    = 1550,\n\n\tVREvent_PerformanceTest_EnableCapture\t= 1600,\n\tVREvent_PerformanceTest_DisableCapture\t= 1601,\n\tVREvent_PerformanceTest_FidelityLevel\t= 1602,\n\n\tVREvent_MessageOverlay_Closed\t\t\t= 1650,\n\tVREvent_MessageOverlayCloseRequested\t= 1651,\n\n\tVREvent_Input_HapticVibration\t\t\t= 1700, // data is hapticVibration\n\tVREvent_Input_BindingLoadFailed\t\t\t= 1701, // data is inputBinding\n\tVREvent_Input_BindingLoadSuccessful\t\t= 1702, // data is inputBinding\n\tVREvent_Input_ActionManifestReloaded\t= 1703, // no data\n\tVREvent_Input_ActionManifestLoadFailed\t= 1704, // data is actionManifest\n\tVREvent_Input_ProgressUpdate\t\t\t= 1705, // data is progressUpdate\n\tVREvent_Input_TrackerActivated\t\t\t= 1706,\n\tVREvent_Input_BindingsUpdated\t\t\t= 1707,\n\tVREvent_Input_BindingSubscriptionChanged = 1708,\n\n\tVREvent_SpatialAnchors_PoseUpdated\t\t= 1800,        // data is spatialAnchor. broadcast\n\tVREvent_SpatialAnchors_DescriptorUpdated = 1801,       // data is spatialAnchor. broadcast\n\tVREvent_SpatialAnchors_RequestPoseUpdate = 1802,       // data is spatialAnchor. sent to specific driver\n\tVREvent_SpatialAnchors_RequestDescriptorUpdate = 1803, // data is spatialAnchor. sent to specific driver\n\n\tVREvent_SystemReport_Started\t\t\t= 1900, // user or system initiated generation of a system report. broadcast\n\n\tVREvent_Monitor_ShowHeadsetView\t\t\t= 2000, // data is process\n\tVREvent_Monitor_HideHeadsetView\t\t\t= 2001, // data is process\n\n\tVREvent_Audio_SetSpeakersVolume\t\t\t= 2100,\n\tVREvent_Audio_SetSpeakersMute\t\t\t= 2101,\n\tVREvent_Audio_SetMicrophoneVolume\t\t= 2102,\n\tVREvent_Audio_SetMicrophoneMute\t\t\t= 2103,\n\n\tVREvent_RenderModel_CountChanged       = 2200, //Number of RenderModels in the system has changed\n\n\t// Vendors are free to expose private events in this reserved region\n\tVREvent_VendorSpecific_Reserved_Start\t= 10000,\n\tVREvent_VendorSpecific_Reserved_End\t\t= 19999,\n};\n\n\n/** Level of Hmd activity */\n// UserInteraction_Timeout means the device is in the process of timing out.\n// InUse = ( k_EDeviceActivityLevel_UserInteraction || k_EDeviceActivityLevel_UserInteraction_Timeout )\n// VREvent_TrackedDeviceUserInteractionStarted fires when the devices transitions from Standby -> UserInteraction or Idle -> UserInteraction.\n// VREvent_TrackedDeviceUserInteractionEnded fires when the devices transitions from UserInteraction_Timeout -> Idle\nenum EDeviceActivityLevel\n{\n\tk_EDeviceActivityLevel_Unknown = -1,\n\tk_EDeviceActivityLevel_Idle = 0,\t\t\t\t\t\t// No activity for the last 10 seconds\n\tk_EDeviceActivityLevel_UserInteraction = 1,\t\t\t\t// Activity (movement or prox sensor) is happening now\n\tk_EDeviceActivityLevel_UserInteraction_Timeout = 2,\t\t// No activity for the last 0.5 seconds\n\tk_EDeviceActivityLevel_Standby = 3,\t\t\t\t\t\t// Idle for at least 5 seconds (configurable in Settings -> Power Management)\n\tk_EDeviceActivityLevel_Idle_Timeout = 4,\n};\n\n\n/** VR controller button and axis IDs */\nenum EVRButtonId\n{\n\tk_EButton_System\t\t\t= 0,\n\tk_EButton_ApplicationMenu\t= 1,\n\tk_EButton_Grip\t\t\t\t= 2,\n\tk_EButton_DPad_Left\t\t\t= 3,\n\tk_EButton_DPad_Up\t\t\t= 4,\n\tk_EButton_DPad_Right\t\t= 5,\n\tk_EButton_DPad_Down\t\t\t= 6,\n\tk_EButton_A\t\t\t\t\t= 7,\n\n\tk_EButton_ProximitySensor   = 31,\n\n\tk_EButton_Axis0\t\t\t\t= 32,\n\tk_EButton_Axis1\t\t\t\t= 33,\n\tk_EButton_Axis2\t\t\t\t= 34,\n\tk_EButton_Axis3\t\t\t\t= 35,\n\tk_EButton_Axis4\t\t\t\t= 36,\n\n\t// aliases for well known controllers\n\tk_EButton_SteamVR_Touchpad\t= k_EButton_Axis0,\n\tk_EButton_SteamVR_Trigger\t= k_EButton_Axis1,\n\n\tk_EButton_Dashboard_Back\t= k_EButton_Grip,\n\n\tk_EButton_IndexController_A\t\t= k_EButton_Grip,\n\tk_EButton_IndexController_B\t\t= k_EButton_ApplicationMenu,\n\tk_EButton_IndexController_JoyStick\t= k_EButton_Axis3,\n\n\tk_EButton_Reserved0\t\t\t= 50,\n\tk_EButton_Reserved1\t\t\t= 51,\n\n\tk_EButton_Max\t\t\t\t= 64\n};\n\ninline uint64_t ButtonMaskFromId( EVRButtonId id ) { return 1ull << id; }\n\n/** used for controller button events */\nstruct VREvent_Controller_t\n{\n\tuint32_t button; // EVRButtonId enum\n};\n\n\n/** used for simulated mouse events in overlay space */\nenum EVRMouseButton\n{\n\tVRMouseButton_Left\t\t\t\t\t= 0x0001,\n\tVRMouseButton_Right\t\t\t\t\t= 0x0002,\n\tVRMouseButton_Middle\t\t\t\t= 0x0004,\n};\n\n\n/** used for simulated mouse events in overlay space */\nstruct VREvent_Mouse_t\n{\n\tfloat x, y; // co-ords are in GL space, bottom left of the texture is 0,0\n\tuint32_t button; // EVRMouseButton enum\n\n\t// if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of\n\t// which tracked cursor the event is for\n\tuint32_t cursorIndex;\n};\n\n/** used for simulated mouse wheel scroll */\nstruct VREvent_Scroll_t\n{\n\tfloat xdelta, ydelta;\n\tuint32_t unused;\n\tfloat viewportscale; // For scrolling on an overlay with laser mouse, this is the overlay's vertical size relative to the overlay height. Range: [0,1]\n\n\t// if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of\n\t// which tracked cursor the event is for\n\tuint32_t cursorIndex;\n};\n\n/** when in mouse input mode you can receive data from the touchpad, these events are only sent if the users finger\n   is on the touchpad (or just released from it). These events are sent to overlays with the VROverlayFlags_SendVRTouchpadEvents\n   flag set.\n**/\nstruct VREvent_TouchPadMove_t\n{\n\t// true if the users finger is detected on the touch pad\n\tbool bFingerDown;\n\n\t// How long the finger has been down in seconds\n\tfloat flSecondsFingerDown;\n\n\t// These values indicate the starting finger position (so you can do some basic swipe stuff)\n\tfloat fValueXFirst;\n\tfloat fValueYFirst;\n\n\t// This is the raw sampled coordinate without deadzoning\n\tfloat fValueXRaw;\n\tfloat fValueYRaw;\n};\n\n/** notification related events. Details will still change at this point */\nstruct VREvent_Notification_t\n{\n\tuint64_t ulUserValue;\n\tuint32_t notificationId;\n};\n\n/** Used for events about processes */\nstruct VREvent_Process_t\n{\n\tuint32_t pid;\n\tuint32_t oldPid;\n\tbool bForced;\n\t// If the associated event was triggered by a connection loss\n\tbool bConnectionLost;\n};\n\n\n/** Used for a few events about overlays */\nstruct VREvent_Overlay_t\n{\n\tuint64_t overlayHandle; // VROverlayHandle_t\n\tuint64_t devicePath;\n\tuint64_t memoryBlockId;\n\n\t// if from an event triggered by cursor input on an overlay that supports multiple cursors, this is the index of\n\t// which tracked cursor the event is for\n\tuint32_t cursorIndex;\n};\n\n\n/** Used for a few events about overlays */\nstruct VREvent_Status_t\n{\n\tuint32_t statusState; // EVRState enum\n};\n\n/** Used for keyboard events */\nstruct VREvent_Keyboard_t\n{\n\tchar cNewInput[8]; // 7 bytes of utf8 + null\n\tuint64_t uUserValue; // caller specified opaque token\n\tuint64_t overlayHandle; // VROverlayHandle_t\n};\n\nstruct VREvent_Ipd_t\n{\n\tfloat ipdMeters;\n};\n\nstruct VREvent_Chaperone_t\n{\n\tuint64_t m_nPreviousUniverse;\n\tuint64_t m_nCurrentUniverse;\n};\n\n/** Not actually used for any events */\nstruct VREvent_Reserved_t\n{\n\tuint64_t reserved0;\n\tuint64_t reserved1;\n\tuint64_t reserved2;\n\tuint64_t reserved3;\n\tuint64_t reserved4;\n\tuint64_t reserved5;\n};\n\nstruct VREvent_PerformanceTest_t\n{\n\tuint32_t m_nFidelityLevel;\n};\n\nstruct VREvent_SeatedZeroPoseReset_t\n{\n\tbool bResetBySystemMenu;\n};\n\nstruct VREvent_Screenshot_t\n{\n\tuint32_t handle;\n\tuint32_t type;\n};\n\nstruct VREvent_ScreenshotProgress_t\n{\n\tfloat progress;\n};\n\nstruct VREvent_ApplicationLaunch_t\n{\n\tuint32_t pid;\n\tuint32_t unArgsHandle;\n};\n\nstruct VREvent_EditingCameraSurface_t\n{\n\tuint64_t overlayHandle;\n\tuint32_t nVisualMode;\n};\n\nstruct VREvent_MessageOverlay_t\n{\n\tuint32_t unVRMessageOverlayResponse; // vr::VRMessageOverlayResponse enum\n};\n\nstruct VREvent_Property_t\n{\n\tPropertyContainerHandle_t container;\n\tETrackedDeviceProperty prop;\n};\n\nstruct VREvent_HapticVibration_t\n{\n\tuint64_t containerHandle; // property container handle of the device with the haptic component\n\tuint64_t componentHandle; // Which haptic component needs to vibrate\n\tfloat fDurationSeconds;\n\tfloat fFrequency;\n\tfloat fAmplitude;\n};\n\nstruct VREvent_WebConsole_t\n{\n\tWebConsoleHandle_t webConsoleHandle;\n};\n\nstruct VREvent_InputBindingLoad_t\n{\n\tvr::PropertyContainerHandle_t ulAppContainer;\n\tuint64_t pathMessage;\n\tuint64_t pathUrl;\n\tuint64_t pathControllerType;\n};\n\nstruct VREvent_InputActionManifestLoad_t\n{\n\tuint64_t pathAppKey;\n\tuint64_t pathMessage;\n\tuint64_t pathMessageParam;\n\tuint64_t pathManifestPath;\n};\n\nstruct VREvent_SpatialAnchor_t\n{\n\tSpatialAnchorHandle_t unHandle;\n};\n\nstruct VREvent_ProgressUpdate_t\n{\n\tuint64_t ulApplicationPropertyContainer;\n\tuint64_t pathDevice;\n\tuint64_t pathInputSource;\n\tuint64_t pathProgressAction;\n\tuint64_t pathIcon;\n\tfloat fProgress;\n};\n\nenum EShowUIType\n{\n\tShowUI_ControllerBinding = 0,\n\tShowUI_ManageTrackers = 1,\n\t// ShowUI_QuickStart = 2, // Deprecated\n\tShowUI_Pairing = 3,\n\tShowUI_Settings = 4,\n\tShowUI_DebugCommands = 5,\n\tShowUI_FullControllerBinding = 6,\n\tShowUI_ManageDrivers = 7,\n};\n\nstruct VREvent_ShowUI_t\n{\n\tEShowUIType eType;\n};\n\nstruct VREvent_ShowDevTools_t\n{\n\tint32_t nBrowserIdentifier;\n};\n\nenum EHDCPError\n{\n\tHDCPError_None = 0,\n\tHDCPError_LinkLost = 1,\n\tHDCPError_Tampered = 2,\n\tHDCPError_DeviceRevoked = 3,\n\tHDCPError_Unknown = 4\n};\n\nstruct VREvent_HDCPError_t\n{\n\tEHDCPError eCode;\n};\n\nstruct VREvent_AudioVolumeControl_t\n{\n\tfloat fVolumeLevel;\n};\n\nstruct VREvent_AudioMuteControl_t\n{\n\tbool bMute;\n};\n\ntypedef union\n{\n\tVREvent_Reserved_t reserved;\n\tVREvent_Controller_t controller;\n\tVREvent_Mouse_t mouse;\n\tVREvent_Scroll_t scroll;\n\tVREvent_Process_t process;\n\tVREvent_Notification_t notification;\n\tVREvent_Overlay_t overlay;\n\tVREvent_Status_t status;\n\tVREvent_Keyboard_t keyboard;\n\tVREvent_Ipd_t ipd;\n\tVREvent_Chaperone_t chaperone;\n\tVREvent_PerformanceTest_t performanceTest;\n\tVREvent_TouchPadMove_t touchPadMove;\n\tVREvent_SeatedZeroPoseReset_t seatedZeroPoseReset;\n\tVREvent_Screenshot_t screenshot;\n\tVREvent_ScreenshotProgress_t screenshotProgress;\n\tVREvent_ApplicationLaunch_t applicationLaunch;\n\tVREvent_EditingCameraSurface_t cameraSurface;\n\tVREvent_MessageOverlay_t messageOverlay;\n\tVREvent_Property_t property;\n\tVREvent_HapticVibration_t hapticVibration;\n\tVREvent_WebConsole_t webConsole;\n\tVREvent_InputBindingLoad_t inputBinding;\n\tVREvent_InputActionManifestLoad_t actionManifest;\n\tVREvent_SpatialAnchor_t spatialAnchor;\n\tVREvent_ProgressUpdate_t progressUpdate;\n\tVREvent_ShowUI_t showUi;\n\tVREvent_ShowDevTools_t showDevTools;\n\tVREvent_HDCPError_t hdcpError;\n\tVREvent_AudioVolumeControl_t audioVolumeControl;\n\tVREvent_AudioMuteControl_t audioMuteControl;\n\t/** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py and openvr_api_flat.h.py */\n} VREvent_Data_t;\n\n\n#if defined(__linux__) || defined(__APPLE__)\n// This structure was originally defined mis-packed on Linux, preserved for\n// compatibility.\n#pragma pack( push, 4 )\n#endif\n\n/** An event posted by the server to all running applications */\nstruct VREvent_t\n{\n\tuint32_t eventType; // EVREventType enum\n\tTrackedDeviceIndex_t trackedDeviceIndex;\n\tfloat eventAgeSeconds;\n\t// event data must be the end of the struct as its size is variable\n\tVREvent_Data_t data;\n};\n\n#if defined(__linux__) || defined(__APPLE__)\n#pragma pack( pop )\n#endif\n\ntypedef uint32_t VRComponentProperties;\n\nenum EVRComponentProperty\n{\n\tVRComponentProperty_IsStatic = (1 << 0),\n\tVRComponentProperty_IsVisible = (1 << 1),\n\tVRComponentProperty_IsTouched = (1 << 2),\n\tVRComponentProperty_IsPressed = (1 << 3),\n\tVRComponentProperty_IsScrolled = (1 << 4),\n\tVRComponentProperty_IsHighlighted = (1 << 5),\n};\n\n\n/** Describes state information about a render-model component, including transforms and other dynamic properties */\nstruct RenderModel_ComponentState_t\n{\n\tHmdMatrix34_t mTrackingToComponentRenderModel;  // Transform required when drawing the component render model\n\tHmdMatrix34_t mTrackingToComponentLocal;        // Transform available for attaching to a local component coordinate system (-Z out from surface )\n\tVRComponentProperties uProperties;\n};\n\n\nenum EVRInputError\n{\n\tVRInputError_None = 0,\n\tVRInputError_NameNotFound = 1,\n\tVRInputError_WrongType = 2,\n\tVRInputError_InvalidHandle = 3,\n\tVRInputError_InvalidParam = 4,\n\tVRInputError_NoSteam = 5,\n\tVRInputError_MaxCapacityReached = 6,\n\tVRInputError_IPCError = 7,\n\tVRInputError_NoActiveActionSet = 8,\n\tVRInputError_InvalidDevice = 9,\n\tVRInputError_InvalidSkeleton = 10,\n\tVRInputError_InvalidBoneCount = 11,\n\tVRInputError_InvalidCompressedData = 12,\n\tVRInputError_NoData = 13,\n\tVRInputError_BufferTooSmall = 14,\n\tVRInputError_MismatchedActionManifest = 15,\n\tVRInputError_MissingSkeletonData = 16,\n\tVRInputError_InvalidBoneIndex = 17,\n\tVRInputError_InvalidPriority = 18,\n\tVRInputError_PermissionDenied = 19,\n\tVRInputError_InvalidRenderModel = 20,\n};\n\nenum EVRSpatialAnchorError\n{\n\tVRSpatialAnchorError_Success = 0,\n\tVRSpatialAnchorError_Internal = 1,\n\tVRSpatialAnchorError_UnknownHandle = 2,\n\tVRSpatialAnchorError_ArrayTooSmall = 3,\n\tVRSpatialAnchorError_InvalidDescriptorChar = 4,\n\tVRSpatialAnchorError_NotYetAvailable = 5,\n\tVRSpatialAnchorError_NotAvailableInThisUniverse = 6,\n\tVRSpatialAnchorError_PermanentlyUnavailable = 7,\n\tVRSpatialAnchorError_WrongDriver = 8,\n\tVRSpatialAnchorError_DescriptorTooLong = 9,\n\tVRSpatialAnchorError_Unknown = 10,\n\tVRSpatialAnchorError_NoRoomCalibration = 11,\n\tVRSpatialAnchorError_InvalidArgument = 12,\n\tVRSpatialAnchorError_UnknownDriver = 13,\n};\n\n/** The mesh to draw into the stencil (or depth) buffer to perform\n* early stencil (or depth) kills of pixels that will never appear on the HMD.\n* This mesh draws on all the pixels that will be hidden after distortion.\n*\n* If the HMD does not provide a visible area mesh pVertexData will be\n* NULL and unTriangleCount will be 0. */\nstruct HiddenAreaMesh_t\n{\n\tconst HmdVector2_t *pVertexData;\n\tuint32_t unTriangleCount;\n};\n\n\nenum EHiddenAreaMeshType\n{\n\tk_eHiddenAreaMesh_Standard = 0,\n\tk_eHiddenAreaMesh_Inverse = 1,\n\tk_eHiddenAreaMesh_LineLoop = 2,\n\n\tk_eHiddenAreaMesh_Max = 3,\n};\n\n\n/** Identifies what kind of axis is on the controller at index n. Read this type\n* with pVRSystem->Get( nControllerDeviceIndex, Prop_Axis0Type_Int32 + n );\n*/\nenum EVRControllerAxisType\n{\n\tk_eControllerAxis_None = 0,\n\tk_eControllerAxis_TrackPad = 1,\n\tk_eControllerAxis_Joystick = 2,\n\tk_eControllerAxis_Trigger = 3, // Analog trigger data is in the X axis\n};\n\n\n/** contains information about one axis on the controller */\nstruct VRControllerAxis_t\n{\n\tfloat x; // Ranges from -1.0 to 1.0 for joysticks and track pads. Ranges from 0.0 to 1.0 for triggers were 0 is fully released.\n\tfloat y; // Ranges from -1.0 to 1.0 for joysticks and track pads. Is always 0.0 for triggers.\n};\n\n\n/** the number of axes in the controller state */\nstatic const uint32_t k_unControllerStateAxisCount = 5;\n\n\n#if defined(__linux__) || defined(__APPLE__)\n// This structure was originally defined mis-packed on Linux, preserved for\n// compatibility.\n#pragma pack( push, 4 )\n#endif\n\n/** Holds all the state of a controller at one moment in time. */\nstruct VRControllerState001_t\n{\n\t// If packet num matches that on your prior call, then the controller state hasn't been changed since\n\t// your last call and there is no need to process it\n\tuint32_t unPacketNum;\n\n\t// bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask\n\tuint64_t ulButtonPressed;\n\tuint64_t ulButtonTouched;\n\n\t// Axis data for the controller's analog inputs\n\tVRControllerAxis_t rAxis[ k_unControllerStateAxisCount ];\n};\n#if defined(__linux__) || defined(__APPLE__)\n#pragma pack( pop )\n#endif\n\n\ntypedef VRControllerState001_t VRControllerState_t;\n\n\n/** determines how to provide output to the application of various event processing functions. */\nenum EVRControllerEventOutputType\n{\n\tControllerEventOutput_OSEvents = 0,\n\tControllerEventOutput_VREvents = 1,\n};\n\n\n\n/** Collision Bounds Style */\nenum ECollisionBoundsStyle\n{\n\tCOLLISION_BOUNDS_STYLE_BEGINNER = 0,\n\tCOLLISION_BOUNDS_STYLE_INTERMEDIATE,\n\tCOLLISION_BOUNDS_STYLE_SQUARES,\n\tCOLLISION_BOUNDS_STYLE_ADVANCED,\n\tCOLLISION_BOUNDS_STYLE_NONE,\n\n\tCOLLISION_BOUNDS_STYLE_COUNT\n};\n\n/** used to refer to a single VR overlay */\ntypedef uint64_t VROverlayHandle_t;\n\nstatic const VROverlayHandle_t k_ulOverlayHandleInvalid = 0;\n\n/** Errors that can occur around VR overlays */\nenum EVROverlayError\n{\n\tVROverlayError_None\t\t\t\t\t\t= 0,\n\n\tVROverlayError_UnknownOverlay\t\t\t= 10,\n\tVROverlayError_InvalidHandle\t\t\t= 11,\n\tVROverlayError_PermissionDenied\t\t\t= 12,\n\tVROverlayError_OverlayLimitExceeded\t\t= 13, // No more overlays could be created because the maximum number already exist\n\tVROverlayError_WrongVisibilityType\t\t= 14,\n\tVROverlayError_KeyTooLong\t\t\t\t= 15,\n\tVROverlayError_NameTooLong\t\t\t\t= 16,\n\tVROverlayError_KeyInUse\t\t\t\t\t= 17,\n\tVROverlayError_WrongTransformType\t\t= 18,\n\tVROverlayError_InvalidTrackedDevice\t\t= 19,\n\tVROverlayError_InvalidParameter\t\t\t= 20,\n\tVROverlayError_ThumbnailCantBeDestroyed\t= 21,\n\tVROverlayError_ArrayTooSmall\t\t\t= 22,\n\tVROverlayError_RequestFailed\t\t\t= 23,\n\tVROverlayError_InvalidTexture\t\t\t= 24,\n\tVROverlayError_UnableToLoadFile\t\t\t= 25,\n\tVROverlayError_KeyboardAlreadyInUse\t\t= 26,\n\tVROverlayError_NoNeighbor\t\t\t\t= 27,\n\tVROverlayError_TooManyMaskPrimitives\t= 29,\n\tVROverlayError_BadMaskPrimitive\t\t\t= 30,\n\tVROverlayError_TextureAlreadyLocked\t\t= 31,\n\tVROverlayError_TextureLockCapacityReached = 32,\n\tVROverlayError_TextureNotLocked\t\t\t= 33,\n\tVROverlayError_TimedOut                 = 34,\n};\n\n/** enum values to pass in to VR_Init to identify whether the application will\n* draw a 3D scene. */\nenum EVRApplicationType\n{\n\tVRApplication_Other = 0,\t\t// Some other kind of application that isn't covered by the other entries\n\tVRApplication_Scene\t= 1,\t\t// Application will submit 3D frames\n\tVRApplication_Overlay = 2,\t\t// Application only interacts with overlays\n\tVRApplication_Background = 3,\t// Application should not start SteamVR if it's not already running, and should not\n\t\t\t\t\t\t\t\t\t// keep it running if everything else quits.\n\tVRApplication_Utility = 4,\t\t// Init should not try to load any drivers. The application needs access to utility\n\t\t\t\t\t\t\t\t\t// interfaces (like IVRSettings and IVRApplications) but not hardware.\n\tVRApplication_VRMonitor = 5,\t// Reserved for vrmonitor\n\tVRApplication_SteamWatchdog = 6,// Reserved for Steam\n\tVRApplication_Bootstrapper = 7, // reserved for vrstartup\n\tVRApplication_WebHelper = 8,\t// reserved for vrwebhelper\n\tVRApplication_OpenXRInstance = 9, // reserved for openxr (created instance, but not session yet)\n\tVRApplication_OpenXRScene = 10,\t  // reserved for openxr (started session)\n\tVRApplication_OpenXROverlay = 11, // reserved for openxr (started overlay session)\n\tVRApplication_Prism = 12,\t\t// reserved for the vrprismhost process\n\tVRApplication_RoomView = 13,\t// reserved for the RoomView process\n\n\tVRApplication_Max\n};\n\n\n/** returns true if the specified application type is one of the\n* OpenXR types */\ninline bool IsOpenXRAppType( EVRApplicationType eType )\n{\n\treturn eType == VRApplication_OpenXRInstance\n\t\t|| eType == VRApplication_OpenXRScene\n\t\t|| eType == VRApplication_OpenXROverlay;\n}\n\n\n/** returns true if the specified application type submits eye buffers */\ninline bool BAppTypeSubmitsEyeBuffers( EVRApplicationType eType )\n{\n\treturn eType == VRApplication_Scene\n\t\t|| eType == VRApplication_OpenXRScene\n\t\t|| eType == VRApplication_RoomView;\n}\n\n\n/** error codes for firmware */\nenum EVRFirmwareError\n{\n\tVRFirmwareError_None = 0,\n\tVRFirmwareError_Success = 1,\n\tVRFirmwareError_Fail = 2,\n};\n\n\n/** error codes for notifications */\nenum EVRNotificationError\n{\n\tVRNotificationError_OK = 0,\n\tVRNotificationError_InvalidNotificationId = 100,\n\tVRNotificationError_NotificationQueueFull = 101,\n\tVRNotificationError_InvalidOverlayHandle = 102,\n\tVRNotificationError_SystemWithUserValueAlreadyExists = 103,\n\tVRNotificationError_ServiceUnavailable = 104,\n};\n\n\nenum EVRSkeletalMotionRange\n{\n\t// The range of motion of the skeleton takes into account any physical limits imposed by\n\t// the controller itself.  This will tend to be the most accurate pose compared to the user's\n\t// actual hand pose, but might not allow a closed fist for example\n\tVRSkeletalMotionRange_WithController = 0,\n\n\t// Retarget the range of motion provided by the input device to make the hand appear to move\n\t// as if it was not holding a controller.  eg: map \"hand grasping controller\" to \"closed fist\"\n\tVRSkeletalMotionRange_WithoutController = 1,\n};\n\nenum EVRSkeletalTrackingLevel\n{\n\t// body part location can't be directly determined by the device. Any skeletal pose provided by\n\t// the device is estimated by assuming the position required to active buttons, triggers, joysticks,\n\t// or other input sensors.\n\t// E.g. Vive Controller, Gamepad\n\tVRSkeletalTracking_Estimated = 0,\n\n\t// body part location can be measured directly but with fewer degrees of freedom than the actual body\n\t// part. Certain body part positions may be unmeasured by the device and estimated from other input data.\n\t// E.g. Index Controllers, gloves that only measure finger curl\n\tVRSkeletalTracking_Partial = 1,\n\n\t// Body part location can be measured directly throughout the entire range of motion of the body part.\n\t// E.g. Mocap suit for the full body, gloves that measure rotation of each finger segment\n\tVRSkeletalTracking_Full = 2,\n\n\tVRSkeletalTrackingLevel_Count,\n\tVRSkeletalTrackingLevel_Max = VRSkeletalTrackingLevel_Count - 1\n};\n\n\n/** Type used for referring to bones by their index */\ntypedef int32_t BoneIndex_t;\nconst BoneIndex_t k_unInvalidBoneIndex = -1;\n\n\n/** error codes returned by Vr_Init */\n\n// Please add adequate error description to https://developer.valvesoftware.com/w/index.php?title=Category:SteamVRHelp\nenum EVRInitError\n{\n\tVRInitError_None\t= 0,\n\tVRInitError_Unknown = 1,\n\n\tVRInitError_Init_InstallationNotFound\t\t\t= 100,\n\tVRInitError_Init_InstallationCorrupt\t\t\t= 101,\n\tVRInitError_Init_VRClientDLLNotFound\t\t\t= 102,\n\tVRInitError_Init_FileNotFound\t\t\t\t\t= 103,\n\tVRInitError_Init_FactoryNotFound\t\t\t\t= 104,\n\tVRInitError_Init_InterfaceNotFound\t\t\t\t= 105,\n\tVRInitError_Init_InvalidInterface\t\t\t\t= 106,\n\tVRInitError_Init_UserConfigDirectoryInvalid\t\t= 107,\n\tVRInitError_Init_HmdNotFound\t\t\t\t\t= 108,\n\tVRInitError_Init_NotInitialized\t\t\t\t\t= 109,\n\tVRInitError_Init_PathRegistryNotFound\t\t\t= 110,\n\tVRInitError_Init_NoConfigPath\t\t\t\t\t= 111,\n\tVRInitError_Init_NoLogPath\t\t\t\t\t\t= 112,\n\tVRInitError_Init_PathRegistryNotWritable\t\t= 113,\n\tVRInitError_Init_AppInfoInitFailed\t\t\t\t= 114,\n\tVRInitError_Init_Retry\t\t\t\t\t\t\t= 115, // Used internally to cause retries to vrserver\n\tVRInitError_Init_InitCanceledByUser\t\t\t\t= 116, // The calling application should silently exit. The user canceled app startup\n\tVRInitError_Init_AnotherAppLaunching\t\t\t= 117,\n\tVRInitError_Init_SettingsInitFailed\t\t\t\t= 118,\n\tVRInitError_Init_ShuttingDown\t\t\t\t\t= 119,\n\tVRInitError_Init_TooManyObjects\t\t\t\t\t= 120,\n\tVRInitError_Init_NoServerForBackgroundApp\t\t= 121,\n\tVRInitError_Init_NotSupportedWithCompositor\t\t= 122,\n\tVRInitError_Init_NotAvailableToUtilityApps\t\t= 123,\n\tVRInitError_Init_Internal\t\t\t\t \t\t= 124,\n\tVRInitError_Init_HmdDriverIdIsNone\t\t \t\t= 125,\n\tVRInitError_Init_HmdNotFoundPresenceFailed \t\t= 126,\n\tVRInitError_Init_VRMonitorNotFound\t\t\t\t= 127,\n\tVRInitError_Init_VRMonitorStartupFailed\t\t\t= 128,\n\tVRInitError_Init_LowPowerWatchdogNotSupported\t= 129,\n\tVRInitError_Init_InvalidApplicationType\t\t\t= 130,\n\tVRInitError_Init_NotAvailableToWatchdogApps\t\t= 131,\n\tVRInitError_Init_WatchdogDisabledInSettings\t\t= 132,\n\tVRInitError_Init_VRDashboardNotFound\t\t\t= 133,\n\tVRInitError_Init_VRDashboardStartupFailed\t\t= 134,\n\tVRInitError_Init_VRHomeNotFound\t\t\t\t\t= 135,\n\tVRInitError_Init_VRHomeStartupFailed\t\t\t= 136,\n\tVRInitError_Init_RebootingBusy\t\t\t\t\t= 137,\n\tVRInitError_Init_FirmwareUpdateBusy\t\t\t\t= 138,\n\tVRInitError_Init_FirmwareRecoveryBusy\t\t\t= 139,\n\tVRInitError_Init_USBServiceBusy\t\t\t\t\t= 140,\n\tVRInitError_Init_VRWebHelperStartupFailed\t\t= 141,\n\tVRInitError_Init_TrackerManagerInitFailed\t\t= 142,\n\tVRInitError_Init_AlreadyRunning\t\t\t\t\t= 143,\n\tVRInitError_Init_FailedForVrMonitor\t\t\t\t= 144,\n\tVRInitError_Init_PropertyManagerInitFailed\t\t= 145,\n\tVRInitError_Init_WebServerFailed\t\t\t\t= 146,\n\tVRInitError_Init_IllegalTypeTransition\t\t\t= 147,\n\tVRInitError_Init_MismatchedRuntimes\t\t\t\t= 148,\n\tVRInitError_Init_InvalidProcessId\t\t\t\t= 149,\n\tVRInitError_Init_VRServiceStartupFailed\t\t\t= 150,\n\tVRInitError_Init_PrismNeedsNewDrivers\t\t\t= 151,\n\tVRInitError_Init_PrismStartupTimedOut\t\t\t= 152,\n\tVRInitError_Init_CouldNotStartPrism\t\t\t\t= 153,\n\tVRInitError_Init_PrismClientInitFailed\t\t\t= 154,\n\tVRInitError_Init_PrismClientStartFailed\t\t\t= 155,\n\tVRInitError_Init_PrismExitedUnexpectedly\t\t= 156,\n\tVRInitError_Init_BadLuid\t\t\t\t\t\t= 157,\n\tVRInitError_Init_NoServerForAppContainer\t\t= 158,\n\tVRInitError_Init_DuplicateBootstrapper\t\t\t= 159,\n\tVRInitError_Init_VRDashboardServicePending\t\t= 160,\n\tVRInitError_Init_VRDashboardServiceTimeout\t\t= 161,\n\tVRInitError_Init_VRDashboardServiceStopped\t\t= 162,\n\tVRInitError_Init_VRDashboardAlreadyStarted\t\t= 163,\n\tVRInitError_Init_VRDashboardCopyFailed\t\t\t= 164,\n\tVRInitError_Init_VRDashboardTokenFailure\t\t= 165,\n\tVRInitError_Init_VRDashboardEnvironmentFailure\t= 166,\n\tVRInitError_Init_VRDashboardPathFailure\t\t\t= 167,\n\n\tVRInitError_Driver_Failed\t\t\t\t\t\t= 200,\n\tVRInitError_Driver_Unknown\t\t\t\t\t\t= 201,\n\tVRInitError_Driver_HmdUnknown\t\t\t\t\t= 202,\n\tVRInitError_Driver_NotLoaded\t\t\t\t\t= 203,\n\tVRInitError_Driver_RuntimeOutOfDate\t\t\t\t= 204,\n\tVRInitError_Driver_HmdInUse\t\t\t\t\t\t= 205,\n\tVRInitError_Driver_NotCalibrated\t\t\t\t= 206,\n\tVRInitError_Driver_CalibrationInvalid\t\t\t= 207,\n\tVRInitError_Driver_HmdDisplayNotFound\t\t\t= 208,\n\tVRInitError_Driver_TrackedDeviceInterfaceUnknown = 209,\n\t// VRInitError_Driver_HmdDisplayNotFoundAfterFix = 210, // not needed: here for historic reasons\n\tVRInitError_Driver_HmdDriverIdOutOfBounds\t\t= 211,\n\tVRInitError_Driver_HmdDisplayMirrored\t\t\t= 212,\n\tVRInitError_Driver_HmdDisplayNotFoundLaptop\t\t= 213,\n\tVRInitError_Driver_PeerDriverNotInstalled\t\t= 214,\n\tVRInitError_Driver_WirelessHmdNotConnected\t\t= 215,\n\n\t// Never make error 259 because we return it from main and it would conflict with STILL_ACTIVE\n\n\tVRInitError_IPC_ServerInitFailed\t\t\t\t= 300,\n\tVRInitError_IPC_ConnectFailed\t\t\t\t\t= 301,\n\tVRInitError_IPC_SharedStateInitFailed\t\t\t= 302,\n\tVRInitError_IPC_CompositorInitFailed\t\t\t= 303,\n\tVRInitError_IPC_MutexInitFailed\t\t\t\t\t= 304,\n\tVRInitError_IPC_Failed\t\t\t\t\t\t\t= 305,\n\tVRInitError_IPC_CompositorConnectFailed\t\t\t= 306,\n\tVRInitError_IPC_CompositorInvalidConnectResponse = 307,\n\tVRInitError_IPC_ConnectFailedAfterMultipleAttempts = 308,\n\tVRInitError_IPC_ConnectFailedAfterTargetExited = 309,\n\tVRInitError_IPC_NamespaceUnavailable\t\t\t = 310,\n\n\tVRInitError_Compositor_Failed\t\t\t\t\t\t\t\t\t\t\t\t= 400,\n\tVRInitError_Compositor_D3D11HardwareRequired\t\t\t\t\t\t\t\t= 401,\n\tVRInitError_Compositor_FirmwareRequiresUpdate\t\t\t\t\t\t\t\t= 402,\n\tVRInitError_Compositor_OverlayInitFailed\t\t\t\t\t\t\t\t\t= 403,\n\tVRInitError_Compositor_ScreenshotsInitFailed\t\t\t\t\t\t\t\t= 404,\n\tVRInitError_Compositor_UnableToCreateDevice\t\t\t\t\t\t\t\t\t= 405,\n\tVRInitError_Compositor_SharedStateIsNull\t\t\t\t\t\t\t\t\t= 406,\n\tVRInitError_Compositor_NotificationManagerIsNull\t\t\t\t\t\t\t= 407,\n\tVRInitError_Compositor_ResourceManagerClientIsNull\t\t\t\t\t\t\t= 408,\n\tVRInitError_Compositor_MessageOverlaySharedStateInitFailure\t\t\t\t\t= 409,\n\tVRInitError_Compositor_PropertiesInterfaceIsNull\t\t\t\t\t\t\t= 410,\n\tVRInitError_Compositor_CreateFullscreenWindowFailed\t\t\t\t\t\t\t= 411,\n\tVRInitError_Compositor_SettingsInterfaceIsNull\t\t\t\t\t\t\t\t= 412,\n\tVRInitError_Compositor_FailedToShowWindow\t\t\t\t\t\t\t\t\t= 413,\n\tVRInitError_Compositor_DistortInterfaceIsNull\t\t\t\t\t\t\t\t= 414,\n\tVRInitError_Compositor_DisplayFrequencyFailure\t\t\t\t\t\t\t\t= 415,\n\tVRInitError_Compositor_RendererInitializationFailed\t\t\t\t\t\t\t= 416,\n\tVRInitError_Compositor_DXGIFactoryInterfaceIsNull\t\t\t\t\t\t\t= 417,\n\tVRInitError_Compositor_DXGIFactoryCreateFailed\t\t\t\t\t\t\t\t= 418,\n\tVRInitError_Compositor_DXGIFactoryQueryFailed\t\t\t\t\t\t\t\t= 419,\n\tVRInitError_Compositor_InvalidAdapterDesktop\t\t\t\t\t\t\t\t= 420,\n\tVRInitError_Compositor_InvalidHmdAttachment\t\t\t\t\t\t\t\t\t= 421,\n\tVRInitError_Compositor_InvalidOutputDesktop\t\t\t\t\t\t\t\t\t= 422,\n\tVRInitError_Compositor_InvalidDeviceProvided\t\t\t\t\t\t\t\t= 423,\n\tVRInitError_Compositor_D3D11RendererInitializationFailed\t\t\t\t\t= 424,\n\tVRInitError_Compositor_FailedToFindDisplayMode\t\t\t\t\t\t\t\t= 425,\n\tVRInitError_Compositor_FailedToCreateSwapChain\t\t\t\t\t\t\t\t= 426,\n\tVRInitError_Compositor_FailedToGetBackBuffer\t\t\t\t\t\t\t\t= 427,\n\tVRInitError_Compositor_FailedToCreateRenderTarget\t\t\t\t\t\t\t= 428,\n\tVRInitError_Compositor_FailedToCreateDXGI2SwapChain\t\t\t\t\t\t\t= 429,\n\tVRInitError_Compositor_FailedtoGetDXGI2BackBuffer\t\t\t\t\t\t\t= 430,\n\tVRInitError_Compositor_FailedToCreateDXGI2RenderTarget\t\t\t\t\t\t= 431,\n\tVRInitError_Compositor_FailedToGetDXGIDeviceInterface\t\t\t\t\t\t= 432,\n\tVRInitError_Compositor_SelectDisplayMode\t\t\t\t\t\t\t\t\t= 433,\n\tVRInitError_Compositor_FailedToCreateNvAPIRenderTargets\t\t\t\t\t\t= 434,\n\tVRInitError_Compositor_NvAPISetDisplayMode\t\t\t\t\t\t\t\t\t= 435,\n\tVRInitError_Compositor_FailedToCreateDirectModeDisplay\t\t\t\t\t\t= 436,\n\tVRInitError_Compositor_InvalidHmdPropertyContainer\t\t\t\t\t\t\t= 437,\n\tVRInitError_Compositor_UpdateDisplayFrequency\t\t\t\t\t\t\t\t= 438,\n\tVRInitError_Compositor_CreateRasterizerState\t\t\t\t\t\t\t\t= 439,\n\tVRInitError_Compositor_CreateWireframeRasterizerState\t\t\t\t\t\t= 440,\n\tVRInitError_Compositor_CreateSamplerState\t\t\t\t\t\t\t\t\t= 441,\n\tVRInitError_Compositor_CreateClampToBorderSamplerState\t\t\t\t\t\t= 442,\n\tVRInitError_Compositor_CreateAnisoSamplerState\t\t\t\t\t\t\t\t= 443,\n\tVRInitError_Compositor_CreateOverlaySamplerState\t\t\t\t\t\t\t= 444,\n\tVRInitError_Compositor_CreatePanoramaSamplerState\t\t\t\t\t\t\t= 445,\n\tVRInitError_Compositor_CreateFontSamplerState\t\t\t\t\t\t\t\t= 446,\n\tVRInitError_Compositor_CreateNoBlendState\t\t\t\t\t\t\t\t\t= 447,\n\tVRInitError_Compositor_CreateBlendState\t\t\t\t\t\t\t\t\t\t= 448,\n\tVRInitError_Compositor_CreateAlphaBlendState\t\t\t\t\t\t\t\t= 449,\n\tVRInitError_Compositor_CreateBlendStateMaskR\t\t\t\t\t\t\t\t= 450,\n\tVRInitError_Compositor_CreateBlendStateMaskG\t\t\t\t\t\t\t\t= 451,\n\tVRInitError_Compositor_CreateBlendStateMaskB\t\t\t\t\t\t\t\t= 452,\n\tVRInitError_Compositor_CreateDepthStencilState\t\t\t\t\t\t\t\t= 453,\n\tVRInitError_Compositor_CreateDepthStencilStateNoWrite\t\t\t\t\t\t= 454,\n\tVRInitError_Compositor_CreateDepthStencilStateNoDepth\t\t\t\t\t\t= 455,\n\tVRInitError_Compositor_CreateFlushTexture\t\t\t\t\t\t\t\t\t= 456,\n\tVRInitError_Compositor_CreateDistortionSurfaces\t\t\t\t\t\t\t\t= 457,\n\tVRInitError_Compositor_CreateConstantBuffer\t\t\t\t\t\t\t\t\t= 458,\n\tVRInitError_Compositor_CreateHmdPoseConstantBuffer\t\t\t\t\t\t\t= 459,\n\tVRInitError_Compositor_CreateHmdPoseStagingConstantBuffer\t\t\t\t\t= 460,\n\tVRInitError_Compositor_CreateSharedFrameInfoConstantBuffer\t\t\t\t\t= 461,\n\tVRInitError_Compositor_CreateOverlayConstantBuffer\t\t\t\t\t\t\t= 462,\n\tVRInitError_Compositor_CreateSceneTextureIndexConstantBuffer\t\t\t\t= 463,\n\tVRInitError_Compositor_CreateReadableSceneTextureIndexConstantBuffer\t\t= 464,\n\tVRInitError_Compositor_CreateLayerGraphicsTextureIndexConstantBuffer\t\t= 465,\n\tVRInitError_Compositor_CreateLayerComputeTextureIndexConstantBuffer\t\t\t= 466,\n\tVRInitError_Compositor_CreateLayerComputeSceneTextureIndexConstantBuffer\t= 467,\n\tVRInitError_Compositor_CreateComputeHmdPoseConstantBuffer\t\t\t\t\t= 468,\n\tVRInitError_Compositor_CreateGeomConstantBuffer\t\t\t\t\t\t\t\t= 469,\n\tVRInitError_Compositor_CreatePanelMaskConstantBuffer\t\t\t\t\t\t= 470,\n\tVRInitError_Compositor_CreatePixelSimUBO\t\t\t\t\t\t\t\t\t= 471,\n\tVRInitError_Compositor_CreateMSAARenderTextures\t\t\t\t\t\t\t\t= 472,\n\tVRInitError_Compositor_CreateResolveRenderTextures\t\t\t\t\t\t\t= 473,\n\tVRInitError_Compositor_CreateComputeResolveRenderTextures\t\t\t\t\t= 474,\n\tVRInitError_Compositor_CreateDriverDirectModeResolveTextures\t\t\t\t= 475,\n\tVRInitError_Compositor_OpenDriverDirectModeResolveTextures\t\t\t\t\t= 476,\n\tVRInitError_Compositor_CreateFallbackSyncTexture\t\t\t\t\t\t\t= 477,\n\tVRInitError_Compositor_ShareFallbackSyncTexture\t\t\t\t\t\t\t\t= 478,\n\tVRInitError_Compositor_CreateOverlayIndexBuffer\t\t\t\t\t\t\t\t= 479,\n\tVRInitError_Compositor_CreateOverlayVertexBuffer\t\t\t\t\t\t\t= 480,\n\tVRInitError_Compositor_CreateTextVertexBuffer\t\t\t\t\t\t\t\t= 481,\n\tVRInitError_Compositor_CreateTextIndexBuffer\t\t\t\t\t\t\t\t= 482,\n\tVRInitError_Compositor_CreateMirrorTextures\t\t\t\t\t\t\t\t\t= 483,\n\tVRInitError_Compositor_CreateLastFrameRenderTexture\t\t\t\t\t\t\t= 484,\n\tVRInitError_Compositor_CreateMirrorOverlay\t\t\t\t\t\t\t\t\t= 485,\n\tVRInitError_Compositor_FailedToCreateVirtualDisplayBackbuffer\t\t\t\t= 486,\n\tVRInitError_Compositor_DisplayModeNotSupported\t\t\t\t\t\t\t\t= 487,\n\tVRInitError_Compositor_CreateOverlayInvalidCall\t\t\t\t\t\t\t\t= 488,\n\tVRInitError_Compositor_CreateOverlayAlreadyInitialized\t\t\t\t\t\t= 489,\n\tVRInitError_Compositor_FailedToCreateMailbox\t\t\t\t\t\t\t\t= 490,\n\tVRInitError_Compositor_WindowInterfaceIsNull\t\t\t\t\t\t\t\t= 491,\n\tVRInitError_Compositor_SystemLayerCreateInstance\t\t\t\t\t\t\t= 492,\n\tVRInitError_Compositor_SystemLayerCreateSession\t\t\t\t\t\t\t\t= 493,\n\tVRInitError_Compositor_CreateInverseDistortUVs\t\t\t\t\t\t\t\t= 494,\n\tVRInitError_Compositor_CreateBackbufferDepth\t\t\t\t\t\t\t\t= 495,\n\tVRInitError_Compositor_CannotDRMLeaseDisplay\t\t\t\t\t\t\t\t= 496,\n\tVRInitError_Compositor_CannotConnectToDisplayServer\t\t\t\t\t\t\t= 497,\n\tVRInitError_Compositor_GnomeNoDRMLeasing\t\t\t\t\t\t\t\t\t= 498,\n\tVRInitError_Compositor_FailedToInitializeEncoder\t\t\t\t\t\t\t= 499,\n\tVRInitError_Compositor_CreateBlurTexture\t\t\t\t\t\t\t\t\t= 500,\n\n\tVRInitError_VendorSpecific_UnableToConnectToOculusRuntime\t\t= 1000,\n\tVRInitError_VendorSpecific_WindowsNotInDevMode\t\t\t\t\t= 1001,\n\tVRInitError_VendorSpecific_OculusLinkNotEnabled\t\t\t\t\t= 1002,\n\n\tVRInitError_VendorSpecific_HmdFound_CantOpenDevice \t\t\t\t= 1101,\n\tVRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart\t= 1102,\n\tVRInitError_VendorSpecific_HmdFound_NoStoredConfig \t\t\t\t= 1103,\n\tVRInitError_VendorSpecific_HmdFound_ConfigTooBig \t\t\t\t= 1104,\n\tVRInitError_VendorSpecific_HmdFound_ConfigTooSmall \t\t\t\t= 1105,\n\tVRInitError_VendorSpecific_HmdFound_UnableToInitZLib \t\t\t= 1106,\n\tVRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion \t= 1107,\n\tVRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart\t= 1108,\n\tVRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart\t= 1109,\n\tVRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext\t\t= 1110,\n\tVRInitError_VendorSpecific_HmdFound_UserDataAddressRange\t\t= 1111,\n\tVRInitError_VendorSpecific_HmdFound_UserDataError\t\t\t\t= 1112,\n\tVRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck\t\t= 1113,\n\tVRInitError_VendorSpecific_OculusRuntimeBadInstall\t\t\t\t= 1114,\n\tVRInitError_VendorSpecific_HmdFound_UnexpectedConfiguration_1\t= 1115,\n\n\tVRInitError_Steam_SteamInstallationNotFound = 2000,\n\n\t// Strictly a placeholder\n\tVRInitError_LastError\n};\n\nenum EVRScreenshotType\n{\n\tVRScreenshotType_None = 0,\n\tVRScreenshotType_Mono = 1, // left eye only\n\tVRScreenshotType_Stereo = 2,\n\tVRScreenshotType_Cubemap = 3,\n\tVRScreenshotType_MonoPanorama = 4,\n\tVRScreenshotType_StereoPanorama = 5\n};\n\nenum EVRScreenshotPropertyFilenames\n{\n\tVRScreenshotPropertyFilenames_Preview = 0,\n\tVRScreenshotPropertyFilenames_VR = 1,\n};\n\nenum EVRTrackedCameraError\n{\n\tVRTrackedCameraError_None                       = 0,\n\tVRTrackedCameraError_OperationFailed            = 100,\n\tVRTrackedCameraError_InvalidHandle              = 101,\n\tVRTrackedCameraError_InvalidFrameHeaderVersion  = 102,\n\tVRTrackedCameraError_OutOfHandles               = 103,\n\tVRTrackedCameraError_IPCFailure                 = 104,\n\tVRTrackedCameraError_NotSupportedForThisDevice  = 105,\n\tVRTrackedCameraError_SharedMemoryFailure        = 106,\n\tVRTrackedCameraError_FrameBufferingFailure      = 107,\n\tVRTrackedCameraError_StreamSetupFailure         = 108,\n\tVRTrackedCameraError_InvalidGLTextureId         = 109,\n\tVRTrackedCameraError_InvalidSharedTextureHandle = 110,\n\tVRTrackedCameraError_FailedToGetGLTextureId     = 111,\n\tVRTrackedCameraError_SharedTextureFailure       = 112,\n\tVRTrackedCameraError_NoFrameAvailable           = 113,\n\tVRTrackedCameraError_InvalidArgument            = 114,\n\tVRTrackedCameraError_InvalidFrameBufferSize     = 115,\n};\n\nenum EVRTrackedCameraFrameLayout\n{\n\tEVRTrackedCameraFrameLayout_Mono\t\t\t\t= 0x0001,\n\tEVRTrackedCameraFrameLayout_Stereo\t\t\t\t= 0x0002,\n\tEVRTrackedCameraFrameLayout_VerticalLayout\t\t= 0x0010,\t// Stereo frames are Top/Bottom (left/right)\n\tEVRTrackedCameraFrameLayout_HorizontalLayout\t= 0x0020,\t// Stereo frames are Left/Right\n};\n\nenum EVRTrackedCameraFrameType\n{\n\tVRTrackedCameraFrameType_Distorted = 0,\t\t\t// This is the camera video frame size in pixels, still distorted.\n\tVRTrackedCameraFrameType_Undistorted,\t\t\t// In pixels, an undistorted inscribed rectangle region without invalid regions. This size is subject to changes shortly.\n\tVRTrackedCameraFrameType_MaximumUndistorted,\t// In pixels, maximum undistorted with invalid regions. Non zero alpha component identifies valid regions.\n\tMAX_CAMERA_FRAME_TYPES\n};\n\nenum EVRDistortionFunctionType\n{\n\tVRDistortionFunctionType_None,\n\tVRDistortionFunctionType_FTheta,\n\tVRDistortionFunctionType_Extended_FTheta,\n\tMAX_DISTORTION_FUNCTION_TYPES,\n};\n\nstatic const uint32_t k_unMaxDistortionFunctionParameters = 8;\n\ntypedef uint64_t TrackedCameraHandle_t;\n#define INVALID_TRACKED_CAMERA_HANDLE\t((vr::TrackedCameraHandle_t)0)\n\nstruct CameraVideoStreamFrameHeader_t\n{\n\tEVRTrackedCameraFrameType eFrameType;\n\n\tuint32_t nWidth;\n\tuint32_t nHeight;\n\tuint32_t nBytesPerPixel;\n\n\tuint32_t nFrameSequence;\n\n\tTrackedDevicePose_t trackedDevicePose;\n\n\tuint64_t ulFrameExposureTime;\t\t\t\t\t\t// mid-point of the exposure of the image in host system ticks\n};\n\n// Screenshot types\ntypedef uint32_t ScreenshotHandle_t;\n\nstatic const uint32_t k_unScreenshotHandleInvalid = 0;\n\n/** Compositor frame timing reprojection flags. */\nconst uint32_t VRCompositor_ReprojectionReason_Cpu = 0x01;\nconst uint32_t VRCompositor_ReprojectionReason_Gpu = 0x02;\nconst uint32_t VRCompositor_ReprojectionAsync = 0x04;\t\t// This flag indicates the async reprojection mode is active,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// but does not indicate if reprojection actually happened or not.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Use the ReprojectionReason flags above to check if reprojection\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// was actually applied (i.e. scene texture was reused).\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NumFramePresents > 1 also indicates the scene texture was reused,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and also the number of times that it was presented in total.\n\nconst uint32_t VRCompositor_ReprojectionMotion = 0x08;\t\t// This flag indicates whether or not motion smoothing was triggered for this frame\n\nconst uint32_t VRCompositor_PredictionMask = 0xF0;\t\t\t// The runtime may predict more than one frame ahead if\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// it detects the application is taking too long to render. These\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bits will contain the count of additional frames (normally zero).\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Use the VR_COMPOSITOR_ADDITIONAL_PREDICTED_FRAMES macro to read from\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the latest frame timing entry.\n\nconst uint32_t VRCompositor_ThrottleMask = 0xF00;\t\t\t// Number of frames the compositor is throttling the application.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Use the VR_COMPOSITOR_NUMBER_OF_THROTTLED_FRAMES macro to read from\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the latest frame timing entry.\n\n#define VR_COMPOSITOR_ADDITIONAL_PREDICTED_FRAMES( timing ) ( ( ( timing ).m_nReprojectionFlags & vr::VRCompositor_PredictionMask ) >> 4 )\n#define VR_COMPOSITOR_NUMBER_OF_THROTTLED_FRAMES( timing ) ( ( ( timing ).m_nReprojectionFlags & vr::VRCompositor_ThrottleMask ) >> 8 )\n\n#if defined(__linux__) || defined(__APPLE__)\n#pragma pack( push, 4 )\n#endif\n/** Provides a single frame's timing information to the app */\nstruct Compositor_FrameTiming\n{\n\tuint32_t m_nSize; // Set to sizeof( Compositor_FrameTiming )\n\tuint32_t m_nFrameIndex;\n\tuint32_t m_nNumFramePresents; // number of times this frame was presented\n\tuint32_t m_nNumMisPresented; // number of times this frame was presented on a vsync other than it was originally predicted to\n\tuint32_t m_nNumDroppedFrames; // number of additional times previous frame was scanned out\n\tuint32_t m_nReprojectionFlags;\n\n\t/** Absolute time reference for comparing frames.  This aligns with the vsync that running start is relative to. */\n\tdouble m_flSystemTimeInSeconds;\n\n\t/** These times may include work from other processes due to OS scheduling.\n\t* The fewer packets of work these are broken up into, the less likely this will happen.\n\t* GPU work can be broken up by calling Flush.  This can sometimes be useful to get the GPU started\n\t* processing that work earlier in the frame. */\n\tfloat m_flPreSubmitGpuMs; // time spent rendering the scene (gpu work submitted between WaitGetPoses and second Submit)\n\tfloat m_flPostSubmitGpuMs; // additional time spent rendering by application (e.g. companion window)\n\tfloat m_flTotalRenderGpuMs; // time between work submitted immediately after present (ideally vsync) until the end of compositor submitted work\n\tfloat m_flCompositorRenderGpuMs; // time spend performing distortion correction, rendering chaperone, overlays, etc.\n\tfloat m_flCompositorRenderCpuMs; // time spent on cpu submitting the above work for this frame\n\tfloat m_flCompositorIdleCpuMs; // time spent waiting for running start (application could have used this much more time)\n\n\t/** Miscellaneous measured intervals. */\n\tfloat m_flClientFrameIntervalMs; // time between calls to WaitGetPoses\n\tfloat m_flPresentCallCpuMs; // time blocked on call to present (usually 0.0, but can go long)\n\tfloat m_flWaitForPresentCpuMs; // time spent spin-waiting for frame index to change (not near-zero indicates wait object failure)\n\tfloat m_flSubmitFrameMs; // time spent in IVRCompositor::Submit (not near-zero indicates driver issue)\n\n\t/** The following are all relative to this frame's SystemTimeInSeconds */\n\tfloat m_flWaitGetPosesCalledMs;\n\tfloat m_flNewPosesReadyMs;\n\tfloat m_flNewFrameReadyMs; // second call to IVRCompositor::Submit\n\tfloat m_flCompositorUpdateStartMs;\n\tfloat m_flCompositorUpdateEndMs;\n\tfloat m_flCompositorRenderStartMs;\n\n\tvr::TrackedDevicePose_t m_HmdPose; // pose used by app to render this frame\n\n\tuint32_t m_nNumVSyncsReadyForUse;\n\tuint32_t m_nNumVSyncsToFirstView;\n\n\tfloat m_flTransferLatencyMs;\n};\n#if defined(__linux__) || defined(__APPLE__)\n#pragma pack( pop )\n#endif\n\n/** Provides compositor benchmark results to the app */\nstruct Compositor_BenchmarkResults\n{\n\tfloat m_flMegaPixelsPerSecond; // Measurement of GPU MP/s performed by compositor benchmark\n\tfloat m_flHmdRecommendedMegaPixelsPerSecond; // Recommended default MP/s given the HMD resolution, refresh, and panel mask.\n};\n\n/** Frame timing data provided by direct mode drivers. */\nstruct DriverDirectMode_FrameTiming\n{\n\tuint32_t m_nSize; // Set to sizeof( DriverDirectMode_FrameTiming )\n\tuint32_t m_nNumFramePresents; // number of times frame was presented\n\tuint32_t m_nNumMisPresented; // number of times frame was presented on a vsync other than it was originally predicted to\n\tuint32_t m_nNumDroppedFrames; // number of additional times previous frame was scanned out (i.e. compositor missed vsync)\n\tuint32_t m_nReprojectionFlags;\n};\n\n/** These flags will be set on DriverDirectMode_FrameTiming::m_nReprojectionFlags when IVRDriverDirectModeComponent::GetFrameTiming is called for drivers to optionally respond to. */\nconst uint32_t VRCompositor_ReprojectionMotion_Enabled = 0x100; // Motion Smoothing is enabled in the UI for the currently running application\nconst uint32_t VRCompositor_ReprojectionMotion_ForcedOn = 0x200; // Motion Smoothing is forced on in the UI for the currently running application\nconst uint32_t VRCompositor_ReprojectionMotion_AppThrottled = 0x400; // Application is requesting throttling via ForceInterleavedReprojectionOn\n\n\nenum EVSync\n{\n\tVSync_None,\n\tVSync_WaitRender,\t// block following render work until vsync\n\tVSync_NoWaitRender,\t// do not block following render work (allow to get started early)\n};\n\nenum EVRMuraCorrectionMode\n{\n\tEVRMuraCorrectionMode_Default = 0,\n\tEVRMuraCorrectionMode_NoCorrection\n};\n\n/** raw IMU data provided by IVRIOBuffer from paths to tracked devices with IMUs */\nenum Imu_OffScaleFlags\n{\n\tOffScale_AccelX\t= 0x01,\n\tOffScale_AccelY\t= 0x02,\n\tOffScale_AccelZ\t= 0x04,\n\tOffScale_GyroX\t= 0x08,\n\tOffScale_GyroY\t= 0x10,\n\tOffScale_GyroZ\t= 0x20,\n};\n\nstruct ImuSample_t\n{\n\tdouble fSampleTime;\n\tHmdVector3d_t vAccel;\n\tHmdVector3d_t vGyro;\n\tuint32_t unOffScaleFlags;\n};\n\n#pragma pack( pop )\n\n// figure out how to import from the VR API dll\n#if defined(_WIN32)\n\n  #if !defined(OPENVR_BUILD_STATIC)\n    #ifdef VR_API_EXPORT\n      #define VR_INTERFACE extern \"C\" __declspec( dllexport )\n    #else\n      #define VR_INTERFACE extern \"C\" __declspec( dllimport )\n    #endif\n  #else\n    #define VR_INTERFACE extern \"C\"\n  #endif\n\n#elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)\n\n#ifdef VR_API_EXPORT\n  #define VR_INTERFACE extern \"C\" __attribute__((visibility(\"default\")))\n#else\n  #define VR_INTERFACE extern \"C\"\n#endif\n\n#else\n  #error \"Unsupported Platform.\"\n#endif\n\n\n#if defined( _WIN32 )\n  #define VR_CALLTYPE __cdecl\n#else\n  #define VR_CALLTYPE\n#endif\n\n} // namespace vr\n#endif // _INCLUDE_VRTYPES_H\n\n// vrannotation.h\n\n#ifdef API_GEN\n# define VR_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR )))\n#else\n# define VR_CLANG_ATTR(ATTR)\n#endif\n\n#define VR_METHOD_DESC(DESC) VR_CLANG_ATTR( \"desc:\" #DESC \";\" )\n#define VR_IGNOREATTR() VR_CLANG_ATTR( \"ignore\" )\n#define VR_OUT_STRUCT() VR_CLANG_ATTR( \"out_struct: ;\" )\n#define VR_OUT_STRING() VR_CLANG_ATTR( \"out_string: ;\" )\n#define VR_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) VR_CLANG_ATTR( \"out_array_call:\" #COUNTER \",\" #FUNCTION \",\" #PARAMS \";\" )\n#define VR_OUT_ARRAY_COUNT(COUNTER) VR_CLANG_ATTR( \"out_array_count:\" #COUNTER \";\" )\n#define VR_ARRAY_COUNT(COUNTER) VR_CLANG_ATTR( \"array_count:\" #COUNTER \";\" )\n#define VR_ARRAY_COUNT_D(COUNTER, DESC) VR_CLANG_ATTR( \"array_count:\" #COUNTER \";desc:\" #DESC )\n#define VR_BUFFER_COUNT(COUNTER) VR_CLANG_ATTR( \"buffer_count:\" #COUNTER \";\" )\n#define VR_OUT_BUFFER_COUNT(COUNTER) VR_CLANG_ATTR( \"out_buffer_count:\" #COUNTER \";\" )\n#define VR_OUT_STRING_COUNT(COUNTER) VR_CLANG_ATTR( \"out_string_count:\" #COUNTER \";\" )\n\n// vrtrackedcameratypes.h\n\n#ifndef _VRTRACKEDCAMERATYPES_H\n#define _VRTRACKEDCAMERATYPES_H\n\nnamespace vr\n{\n\n#pragma pack( push, 8 )\n\nenum ECameraVideoStreamFormat\n{\n\tCVS_FORMAT_UNKNOWN = 0,\n\tCVS_FORMAT_RAW10 = 1,\t\t// 10 bits per pixel\n\tCVS_FORMAT_NV12 = 2,\t\t// 12 bits per pixel\n\tCVS_FORMAT_RGB24 = 3,\t\t// 24 bits per pixel\n\tCVS_FORMAT_NV12_2 = 4,\t\t// 12 bits per pixel, 2x height\n\tCVS_FORMAT_YUYV16 = 5,\t\t// 16 bits per pixel\n\tCVS_FORMAT_BAYER16BG = 6,   // 16 bits per pixel, 10-bit BG-format Bayer, see https://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html\n\tCVS_FORMAT_MJPEG = 7,       // variable-sized MJPEG Open DML format, see https://www.loc.gov/preservation/digital/formats/fdd/fdd000063.shtml\n\tCVS_FORMAT_RGBX32 = 8,      // Full-sized pixels, 4BPP, LSB = RED\n\tCVS_MAX_FORMATS\n};\n\nenum ECameraCompatibilityMode\n{\n\tCAMERA_COMPAT_MODE_BULK_DEFAULT = 0,\n\tCAMERA_COMPAT_MODE_BULK_64K_DMA = 1,\n\tCAMERA_COMPAT_MODE_BULK_16K_DMA = 2,\n\tCAMERA_COMPAT_MODE_BULK_8K_DMA = 3,\n\tCAMERA_COMPAT_MODE_ISO_52FPS = 4,\n\tCAMERA_COMPAT_MODE_ISO_50FPS = 5,\n\tCAMERA_COMPAT_MODE_ISO_48FPS = 6,\n\tCAMERA_COMPAT_MODE_ISO_46FPS = 7,\n\tCAMERA_COMPAT_MODE_ISO_44FPS = 8,\n\tCAMERA_COMPAT_MODE_ISO_42FPS = 9,\n\tCAMERA_COMPAT_MODE_ISO_40FPS = 10,\n\tCAMERA_COMPAT_MODE_ISO_35FPS = 11,\n\tCAMERA_COMPAT_MODE_ISO_30FPS = 12,\n\tCAMERA_COMPAT_MODE_ISO_15FPS = 13,\n\tMAX_CAMERA_COMPAT_MODES\n};\n\nenum ECameraRoomViewStyle\n{\n\tCAMERA_ROOMVIEW_STYLE_DEFAULT = 0,\n\tCAMERA_ROOMVIEW_STYLE_EDGE_A = 1,\n\tCAMERA_ROOMVIEW_STYLE_EDGE_B = 2,\n\tCAMERA_ROOMVIEW_STYLE_VIDEO_TRANSLUSCENT = 3,\n\tCAMERA_ROOMVIEW_STYLE_VIDEO_OPAQUE = 4,\n\tCAMERA_ROOMVIEW_STYLE_COUNT = 5,\n};\n\n#ifdef _MSC_VER\n#define VR_CAMERA_DECL_ALIGN( x ) __declspec( align( x ) )\n#else\n#define VR_CAMERA_DECL_ALIGN( x ) //\n#endif\n\nstatic const uint32_t k_unMaxCameras = 4;\nstatic const uint32_t k_unMaxCameraFrameSharedHandles = 4;\n\nVR_CAMERA_DECL_ALIGN( 8 ) struct CameraVideoStreamFrame_t\n{\n\tECameraVideoStreamFormat m_nStreamFormat;\n\n\tuint32_t m_nWidth;\n\tuint32_t m_nHeight;\n\n\tuint32_t m_nImageDataSize;\t\t\t\t\t\t// Based on stream format, width, height\n\n\tuint32_t m_nFrameSequence;\t\t\t\t\t\t// Starts from 0 when stream starts.\n\n\tuint32_t m_nBufferIndex;\t\t\t\t\t\t// Identifies which buffer the image data is hosted\n\tuint32_t m_nBufferCount;\t\t\t\t\t\t// Total number of configured buffers\n\n\tuint32_t m_nExposureTime;\n\n\tuint32_t m_nISPFrameTimeStamp;\t\t\t\t\t// Driver provided time stamp per driver centric time base\n\tuint32_t m_nISPReferenceTimeStamp;\n\tuint32_t m_nSyncCounter;\n\n\tuint32_t m_nCamSyncEvents;\n\tuint32_t m_nISPSyncEvents;\n\n\tdouble m_flReferenceCamSyncTime;\n\n\tdouble m_flFrameElapsedTime;\t\t\t\t\t// Starts from 0 when stream starts. In seconds.\n\tdouble m_flFrameDeliveryRate;\n\n\tdouble m_flFrameCaptureTime_DriverAbsolute;\t\t// In USB time, via AuxEvent\n\tdouble m_flFrameCaptureTime_ServerRelative;\t\t// In System time within the server\n\tuint64_t m_nFrameCaptureTicks_ServerAbsolute;\t// In system ticks within the server\n\tdouble m_flFrameCaptureTime_ClientRelative;\t\t// At the client, relative to when the frame was exposed/captured.\n\n\tdouble m_flSyncMarkerError;\n\n\tTrackedDevicePose_t m_RawTrackedDevicePose;\t// Raw-and-uncalibrated pose, supplied by HMD layer when used as a tracked camera\n\n\tuint64_t m_pImageData;\n};\n\n#pragma pack( pop )\n\n}\n\n#endif // _VRTRACKEDCAMERATYPES_H\n\n// ivrsettings.h\n\n#ifndef OPENVR_NO_STL\n#include <string>\n#endif\n\nnamespace vr\n{\n\tenum EVRSettingsError\n\t{\n\t\tVRSettingsError_None = 0,\n\t\tVRSettingsError_IPCFailed = 1,\n\t\tVRSettingsError_WriteFailed = 2,\n\t\tVRSettingsError_ReadFailed = 3,\n\t\tVRSettingsError_JsonParseFailed = 4,\n\t\tVRSettingsError_UnsetSettingHasNoDefault = 5, // This will be returned if the setting does not appear in the appropriate default file and has not been set\n\t\tVRSettingsError_AccessDenied = 6,\n\t};\n\n\t// The maximum length of a settings key\n\tstatic const uint32_t k_unMaxSettingsKeyLength = 128;\n\n\tclass IVRSettings\n\t{\n\tpublic:\n\t\tvirtual const char *GetSettingsErrorNameFromEnum( EVRSettingsError eError ) = 0;\n\n\t\tvirtual void SetBool( const char *pchSection, const char *pchSettingsKey, bool bValue, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual void SetInt32( const char *pchSection, const char *pchSettingsKey, int32_t nValue, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual void SetFloat( const char *pchSection, const char *pchSettingsKey, float flValue, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual void SetString( const char *pchSection, const char *pchSettingsKey, const char *pchValue, EVRSettingsError *peError = nullptr ) = 0;\n\n\t\t// Users of the system need to provide a proper default in default.vrsettings in the resources/settings/ directory\n\t\t// of either the runtime or the driver_xxx directory. Otherwise the default will be false, 0, 0.0 or \"\"\n\t\tvirtual bool GetBool( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual int32_t GetInt32( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual float GetFloat( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual void GetString( const char *pchSection, const char *pchSettingsKey, VR_OUT_STRING() char *pchValue, uint32_t unValueLen, EVRSettingsError *peError = nullptr ) = 0;\n\n\t\tvirtual void RemoveSection( const char *pchSection, EVRSettingsError *peError = nullptr ) = 0;\n\t\tvirtual void RemoveKeyInSection( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr ) = 0;\n\t};\n\n\t//-----------------------------------------------------------------------------\n\tstatic const char * const IVRSettings_Version = \"IVRSettings_003\";\n\n\tclass CVRSettingHelper\n\t{\n\t\tIVRSettings *m_pSettings;\n\tpublic:\n\t\tCVRSettingHelper( IVRSettings *pSettings )\n\t\t{\n\t\t\tm_pSettings = pSettings;\n\t\t}\n\n\t\tconst char *GetSettingsErrorNameFromEnum( EVRSettingsError eError )\n\t\t{\n\t\t\treturn m_pSettings->GetSettingsErrorNameFromEnum( eError );\n\t\t}\n\n\t\tvoid SetBool( const char *pchSection, const char *pchSettingsKey, bool bValue, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->SetBool( pchSection, pchSettingsKey, bValue, peError );\n\t\t}\n\n\t\tvoid SetInt32( const char *pchSection, const char *pchSettingsKey, int32_t nValue, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->SetInt32( pchSection, pchSettingsKey, nValue, peError );\n\t\t}\n\t\tvoid SetFloat( const char *pchSection, const char *pchSettingsKey, float flValue, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->SetFloat( pchSection, pchSettingsKey, flValue, peError );\n\t\t}\n\t\tvoid SetString( const char *pchSection, const char *pchSettingsKey, const char *pchValue, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->SetString( pchSection, pchSettingsKey, pchValue, peError );\n\t\t}\n#ifndef OPENVR_NO_STL\n\t\tvoid SetString( const std::string & sSection, const std::string &  sSettingsKey, const std::string & sValue, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->SetString( sSection.c_str(), sSettingsKey.c_str(), sValue.c_str(), peError );\n\t\t}\n#endif\n\n\t\tbool GetBool( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\treturn m_pSettings->GetBool( pchSection, pchSettingsKey, peError );\n\t\t}\n\t\tint32_t GetInt32( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\treturn m_pSettings->GetInt32( pchSection, pchSettingsKey, peError );\n\t\t}\n\t\tfloat GetFloat( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\treturn m_pSettings->GetFloat( pchSection, pchSettingsKey, peError );\n\t\t}\n\t\tvoid GetString( const char *pchSection, const char *pchSettingsKey, VR_OUT_STRING() char *pchValue, uint32_t unValueLen, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->GetString( pchSection, pchSettingsKey, pchValue, unValueLen, peError );\n\t\t}\n#ifndef OPENVR_NO_STL\n\t\tstd::string GetString( const std::string & sSection, const std::string & sSettingsKey, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tchar buf[4096];\n\t\t\tvr::EVRSettingsError eError;\n\t\t\tm_pSettings->GetString( sSection.c_str(), sSettingsKey.c_str(), buf, sizeof( buf ), &eError );\n\t\t\tif ( peError )\n\t\t\t\t*peError = eError;\n\t\t\tif ( eError == vr::VRSettingsError_None )\n\t\t\t\treturn buf;\n\t\t\telse\n\t\t\t\treturn \"\";\n\t\t}\n#endif\n\n\t\tvoid RemoveSection( const char *pchSection, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->RemoveSection( pchSection, peError );\n\t\t}\n\t\tvoid RemoveKeyInSection( const char *pchSection, const char *pchSettingsKey, EVRSettingsError *peError = nullptr )\n\t\t{\n\t\t\tm_pSettings->RemoveKeyInSection( pchSection, pchSettingsKey, peError );\n\t\t}\n\t};\n\n\n\t//-----------------------------------------------------------------------------\n\t// steamvr keys\n\tstatic const char * const k_pch_SteamVR_Section = \"steamvr\";\n\tstatic const char * const k_pch_SteamVR_RequireHmd_String = \"requireHmd\";\n\tstatic const char * const k_pch_SteamVR_ForcedDriverKey_String = \"forcedDriver\";\n\tstatic const char * const k_pch_SteamVR_ForcedHmdKey_String = \"forcedHmd\";\n\tstatic const char * const k_pch_SteamVR_DisplayDebug_Bool = \"displayDebug\";\n\tstatic const char * const k_pch_SteamVR_DebugProcessPipe_String = \"debugProcessPipe\";\n\tstatic const char * const k_pch_SteamVR_DisplayDebugX_Int32 = \"displayDebugX\";\n\tstatic const char * const k_pch_SteamVR_DisplayDebugY_Int32 = \"displayDebugY\";\n\tstatic const char * const k_pch_SteamVR_SendSystemButtonToAllApps_Bool= \"sendSystemButtonToAllApps\";\n\tstatic const char * const k_pch_SteamVR_LogLevel_Int32 = \"loglevel\";\n\tstatic const char * const k_pch_SteamVR_IPD_Float = \"ipd\";\n\tstatic const char * const k_pch_SteamVR_Background_String = \"background\";\n\tstatic const char * const k_pch_SteamVR_BackgroundUseDomeProjection_Bool = \"backgroundUseDomeProjection\";\n\tstatic const char * const k_pch_SteamVR_BackgroundCameraHeight_Float = \"backgroundCameraHeight\";\n\tstatic const char * const k_pch_SteamVR_BackgroundDomeRadius_Float = \"backgroundDomeRadius\";\n\tstatic const char * const k_pch_SteamVR_GridColor_String = \"gridColor\";\n\tstatic const char * const k_pch_SteamVR_PlayAreaColor_String = \"playAreaColor\";\n\tstatic const char * const k_pch_SteamVR_TrackingLossColor_String = \"trackingLossColor\";\n\tstatic const char * const k_pch_SteamVR_ShowStage_Bool = \"showStage\";\n\tstatic const char * const k_pch_SteamVR_DrawTrackingReferences_Bool = \"drawTrackingReferences\";\n\tstatic const char * const k_pch_SteamVR_ActivateMultipleDrivers_Bool = \"activateMultipleDrivers\";\n\tstatic const char * const k_pch_SteamVR_UsingSpeakers_Bool = \"usingSpeakers\";\n\tstatic const char * const k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = \"speakersForwardYawOffsetDegrees\";\n\tstatic const char * const k_pch_SteamVR_BaseStationPowerManagement_Int32 = \"basestationPowerManagement\";\n\tstatic const char * const k_pch_SteamVR_ShowBaseStationPowerManagementTip_Int32 = \"ShowBaseStationPowerManagementTip\";\n\tstatic const char * const k_pch_SteamVR_NeverKillProcesses_Bool = \"neverKillProcesses\";\n\tstatic const char * const k_pch_SteamVR_SupersampleScale_Float = \"supersampleScale\";\n\tstatic const char * const k_pch_SteamVR_MaxRecommendedResolution_Int32 = \"maxRecommendedResolution\";\n\tstatic const char * const k_pch_SteamVR_MotionSmoothing_Bool = \"motionSmoothing\";\n\tstatic const char * const k_pch_SteamVR_MotionSmoothingOverride_Int32 = \"motionSmoothingOverride\";\n\tstatic const char * const k_pch_SteamVR_FramesToThrottle_Int32 = \"framesToThrottle\";\n\tstatic const char * const k_pch_SteamVR_AdditionalFramesToPredict_Int32 = \"additionalFramesToPredict\";\n\tstatic const char * const k_pch_SteamVR_WorldScale_Float = \"worldScale\";\n\tstatic const char * const k_pch_SteamVR_FovScale_Int32 = \"fovScale\";\n\tstatic const char * const k_pch_SteamVR_FovScaleInner_Int32 = \"fovScaleInner\";\n\tstatic const char * const k_pch_SteamVR_FovScaleUpper_Int32 = \"fovScaleUpper\";\n\tstatic const char * const k_pch_SteamVR_FovScaleLower_Int32 = \"fovScaleLower\";\n\tstatic const char * const k_pch_SteamVR_FovScaleFormat_Int32 = \"fovScaleFormat\";\n\tstatic const char * const k_pch_SteamVR_FovScaleLetterboxed_Bool = \"fovScaleLetterboxed\";\n\tstatic const char * const k_pch_SteamVR_DisableAsyncReprojection_Bool = \"disableAsync\";\n\tstatic const char * const k_pch_SteamVR_ForceFadeOnBadTracking_Bool = \"forceFadeOnBadTracking\";\n\tstatic const char * const k_pch_SteamVR_DefaultMirrorView_Int32 = \"mirrorView\";\n\tstatic const char * const k_pch_SteamVR_ShowLegacyMirrorView_Bool = \"showLegacyMirrorView\";\n\tstatic const char * const k_pch_SteamVR_MirrorViewVisibility_Bool = \"showMirrorView\";\n\tstatic const char * const k_pch_SteamVR_MirrorViewDisplayMode_Int32 = \"mirrorViewDisplayMode\";\n\tstatic const char * const k_pch_SteamVR_MirrorViewEye_Int32 = \"mirrorViewEye\";\n\tstatic const char * const k_pch_SteamVR_MirrorViewGeometry_String = \"mirrorViewGeometry\";\n\tstatic const char * const k_pch_SteamVR_MirrorViewGeometryMaximized_String = \"mirrorViewGeometryMaximized\";\n\tstatic const char * const k_pch_SteamVR_PerfGraphVisibility_Bool = \"showPerfGraph\";\n\tstatic const char * const k_pch_SteamVR_StartMonitorFromAppLaunch = \"startMonitorFromAppLaunch\";\n\tstatic const char * const k_pch_SteamVR_StartCompositorFromAppLaunch_Bool = \"startCompositorFromAppLaunch\";\n\tstatic const char * const k_pch_SteamVR_StartDashboardFromAppLaunch_Bool = \"startDashboardFromAppLaunch\";\n\tstatic const char * const k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool = \"startOverlayAppsFromDashboard\";\n\tstatic const char * const k_pch_SteamVR_EnableHomeApp = \"enableHomeApp\";\n\tstatic const char * const k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = \"CycleBackgroundImageTimeSec\";\n\tstatic const char * const k_pch_SteamVR_RetailDemo_Bool = \"retailDemo\";\n\tstatic const char * const k_pch_SteamVR_IpdOffset_Float = \"ipdOffset\";\n\tstatic const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = \"allowSupersampleFiltering\";\n\tstatic const char * const k_pch_SteamVR_SupersampleManualOverride_Bool = \"supersampleManualOverride\";\n\tstatic const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = \"enableLinuxVulkanAsync\";\n\tstatic const char * const k_pch_SteamVR_AllowDisplayLockedMode_Bool = \"allowDisplayLockedMode\";\n\tstatic const char * const k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = \"haveStartedTutorialForNativeChaperoneDriver\";\n\tstatic const char * const k_pch_SteamVR_DebugInputBinding = \"debugInputBinding\";\n\tstatic const char * const k_pch_SteamVR_DoNotFadeToGrid = \"doNotFadeToGrid\";\n\tstatic const char * const k_pch_SteamVR_EnableSharedResourceJournaling = \"enableSharedResourceJournaling\";\n\tstatic const char * const k_pch_SteamVR_EnableSafeMode = \"enableSafeMode\";\n\tstatic const char * const k_pch_SteamVR_PreferredRefreshRate = \"preferredRefreshRate\";\n\tstatic const char * const k_pch_SteamVR_LastVersionNotice = \"lastVersionNotice\";\n\tstatic const char * const k_pch_SteamVR_LastVersionNoticeDate = \"lastVersionNoticeDate\";\n\tstatic const char * const k_pch_SteamVR_HmdDisplayColorGainR_Float = \"hmdDisplayColorGainR\";\n\tstatic const char * const k_pch_SteamVR_HmdDisplayColorGainG_Float = \"hmdDisplayColorGainG\";\n\tstatic const char * const k_pch_SteamVR_HmdDisplayColorGainB_Float = \"hmdDisplayColorGainB\";\n\tstatic const char * const k_pch_SteamVR_CustomIconStyle_String = \"customIconStyle\";\n\tstatic const char * const k_pch_SteamVR_CustomOffIconStyle_String = \"customOffIconStyle\";\n\tstatic const char * const k_pch_SteamVR_CustomIconForceUpdate_String = \"customIconForceUpdate\";\n\tstatic const char * const k_pch_SteamVR_AllowGlobalActionSetPriority = \"globalActionSetPriority\";\n\tstatic const char * const k_pch_SteamVR_OverlayRenderQuality = \"overlayRenderQuality_2\";\n\tstatic const char * const k_pch_SteamVR_BlockOculusSDKOnOpenVRLaunchOption_Bool = \"blockOculusSDKOnOpenVRLaunchOption\";\n\tstatic const char * const k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool = \"blockOculusSDKOnAllLaunches\";\n\tstatic const char * const k_pch_SteamVR_HDCPLegacyCompatibility_Bool = \"hdcp14legacyCompatibility\";\n\tstatic const char * const k_pch_SteamVR_DisplayPortTrainingMode_Int = \"displayPortTrainingMode\";\n\tstatic const char * const k_pch_SteamVR_UsePrism_Bool = \"usePrism\";\n\tstatic const char * const k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = \"allowFallbackMirrorWindowLinux\";\n\tstatic const char * const k_pch_SteamVR_DisableKeyboardPrivacy_Bool = \"disableKeyboardPrivacy\";\n\n\t//-----------------------------------------------------------------------------\n\t// openxr keys\n\tstatic const char * const k_pch_OpenXR_Section = \"openxr\";\n\tstatic const char * const k_pch_OpenXR_MetaUnityPluginCompatibility_Int32 = \"metaUnityPluginCompatibility\";\n\n\t//-----------------------------------------------------------------------------\n\t// direct mode keys\n\tstatic const char * const k_pch_DirectMode_Section = \"direct_mode\";\n\tstatic const char * const k_pch_DirectMode_Enable_Bool = \"enable\";\n\tstatic const char * const k_pch_DirectMode_Count_Int32 = \"count\";\n\tstatic const char * const k_pch_DirectMode_EdidVid_Int32 = \"edidVid\";\n\tstatic const char * const k_pch_DirectMode_EdidPid_Int32 = \"edidPid\";\n\n\t//-----------------------------------------------------------------------------\n\t// lighthouse keys\n\tstatic const char * const k_pch_Lighthouse_Section = \"driver_lighthouse\";\n\tstatic const char * const k_pch_Lighthouse_DisableIMU_Bool = \"disableimu\";\n\tstatic const char * const k_pch_Lighthouse_DisableIMUExceptHMD_Bool = \"disableimuexcepthmd\";\n\tstatic const char * const k_pch_Lighthouse_UseDisambiguation_String = \"usedisambiguation\";\n\tstatic const char * const k_pch_Lighthouse_DisambiguationDebug_Int32 = \"disambiguationdebug\";\n\tstatic const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = \"primarybasestation\";\n\tstatic const char * const k_pch_Lighthouse_DBHistory_Bool = \"dbhistory\";\n\tstatic const char * const k_pch_Lighthouse_EnableBluetooth_Bool = \"enableBluetooth\";\n\tstatic const char * const k_pch_Lighthouse_PowerManagedBaseStations_String = \"PowerManagedBaseStations\";\n\tstatic const char * const k_pch_Lighthouse_PowerManagedBaseStations2_String = \"PowerManagedBaseStations2\";\n\tstatic const char * const k_pch_Lighthouse_InactivityTimeoutForBaseStations_Int32 = \"InactivityTimeoutForBaseStations\";\n\tstatic const char * const k_pch_Lighthouse_EnableImuFallback_Bool = \"enableImuFallback\";\n\n\t//-----------------------------------------------------------------------------\n\t// null keys\n\tstatic const char * const k_pch_Null_Section = \"driver_null\";\n\tstatic const char * const k_pch_Null_SerialNumber_String = \"serialNumber\";\n\tstatic const char * const k_pch_Null_ModelNumber_String = \"modelNumber\";\n\tstatic const char * const k_pch_Null_WindowX_Int32 = \"windowX\";\n\tstatic const char * const k_pch_Null_WindowY_Int32 = \"windowY\";\n\tstatic const char * const k_pch_Null_WindowWidth_Int32 = \"windowWidth\";\n\tstatic const char * const k_pch_Null_WindowHeight_Int32 = \"windowHeight\";\n\tstatic const char * const k_pch_Null_RenderWidth_Int32 = \"renderWidth\";\n\tstatic const char * const k_pch_Null_RenderHeight_Int32 = \"renderHeight\";\n\tstatic const char * const k_pch_Null_SecondsFromVsyncToPhotons_Float = \"secondsFromVsyncToPhotons\";\n\tstatic const char * const k_pch_Null_DisplayFrequency_Float = \"displayFrequency\";\n\n\t//-----------------------------------------------------------------------------\n\t// Windows MR keys\n\tstatic const char * const k_pch_WindowsMR_Section = \"driver_holographic\";\n\n\t//-----------------------------------------------------------------------------\n\t// user interface keys\n\tstatic const char * const k_pch_UserInterface_Section = \"userinterface\";\n\tstatic const char * const k_pch_UserInterface_StatusAlwaysOnTop_Bool = \"StatusAlwaysOnTop\";\n\tstatic const char * const k_pch_UserInterface_MinimizeToTray_Bool = \"MinimizeToTray\";\n\tstatic const char * const k_pch_UserInterface_HidePopupsWhenStatusMinimized_Bool = \"HidePopupsWhenStatusMinimized\";\n\tstatic const char * const k_pch_UserInterface_Screenshots_Bool = \"screenshots\";\n\tstatic const char * const k_pch_UserInterface_ScreenshotType_Int = \"screenshotType\";\n\tstatic const char * const k_pch_UserInterface_CheckStatusInterval_Int = \"vrmStatusCheckInterval\";\n\tstatic const char * const k_pch_UserInterface_CheckForSteam_Bool = \"vrmCheckForSteam\";\n\n\t//-----------------------------------------------------------------------------\n\t// notification keys\n\tstatic const char * const k_pch_Notifications_Section = \"notifications\";\n\tstatic const char * const k_pch_Notifications_DoNotDisturb_Bool = \"DoNotDisturb\";\n\n\t//-----------------------------------------------------------------------------\n\t// keyboard keys\n\tstatic const char * const k_pch_Keyboard_Section = \"keyboard\";\n\tstatic const char * const k_pch_Keyboard_TutorialCompletions = \"TutorialCompletions\";\n\tstatic const char * const k_pch_Keyboard_ScaleX = \"ScaleX\";\n\tstatic const char * const k_pch_Keyboard_ScaleY = \"ScaleY\";\n\tstatic const char * const k_pch_Keyboard_OffsetLeftX = \"OffsetLeftX\";\n\tstatic const char * const k_pch_Keyboard_OffsetRightX = \"OffsetRightX\";\n\tstatic const char * const k_pch_Keyboard_OffsetY = \"OffsetY\";\n\tstatic const char * const k_pch_Keyboard_Smoothing = \"Smoothing\";\n\n\t//-----------------------------------------------------------------------------\n\t// perf keys\n\tstatic const char * const k_pch_Perf_Section = \"perfcheck\";\n\tstatic const char * const k_pch_Perf_PerfGraphInHMD_Bool = \"perfGraphInHMD\";\n\tstatic const char * const k_pch_Perf_AllowTimingStore_Bool = \"allowTimingStore\";\n\tstatic const char * const k_pch_Perf_SaveTimingsOnExit_Bool = \"saveTimingsOnExit\";\n\tstatic const char * const k_pch_Perf_TestData_Float = \"perfTestData\";\n\tstatic const char * const k_pch_Perf_GPUProfiling_Bool = \"GPUProfiling\";\n\tstatic const char * const k_pch_Perf_GpuBusMonitoring_Bool = \"gpuBusMonitoring\";\n\n\t//-----------------------------------------------------------------------------\n\t// collision bounds keys\n\tstatic const char * const k_pch_CollisionBounds_Section = \"collisionBounds\";\n\tstatic const char * const k_pch_CollisionBounds_Style_Int32 = \"CollisionBoundsStyle\";\n\tstatic const char * const k_pch_CollisionBounds_GroundPerimeterOn_Bool = \"CollisionBoundsGroundPerimeterOn\";\n\tstatic const char * const k_pch_CollisionBounds_CenterMarkerOn_Bool = \"CollisionBoundsCenterMarkerOn\";\n\tstatic const char * const k_pch_CollisionBounds_PlaySpaceOn_Bool = \"CollisionBoundsPlaySpaceOn\";\n\tstatic const char * const k_pch_CollisionBounds_FadeDistance_Float = \"CollisionBoundsFadeDistance\";\n\tstatic const char * const k_pch_CollisionBounds_WallHeight_Float = \"CollisionBoundsWallHeight\";\n\tstatic const char * const k_pch_CollisionBounds_ColorGammaR_Int32 = \"CollisionBoundsColorGammaR\";\n\tstatic const char * const k_pch_CollisionBounds_ColorGammaG_Int32 = \"CollisionBoundsColorGammaG\";\n\tstatic const char * const k_pch_CollisionBounds_ColorGammaB_Int32 = \"CollisionBoundsColorGammaB\";\n\tstatic const char * const k_pch_CollisionBounds_ColorGammaA_Int32 = \"CollisionBoundsColorGammaA\";\n\tstatic const char * const k_pch_CollisionBounds_EnableDriverImport = \"enableDriverBoundsImport\";\n\n\t//-----------------------------------------------------------------------------\n\t// camera keys\n\tstatic const char * const k_pch_Camera_Section = \"camera\";\n\tstatic const char * const k_pch_Camera_EnableCamera_Bool = \"enableCamera\";\n\tstatic const char * const k_pch_Camera_ShowOnController_Bool = \"showOnController\";\n\tstatic const char * const k_pch_Camera_EnableCameraForCollisionBounds_Bool = \"enableCameraForCollisionBounds\";\n\tstatic const char * const k_pch_Camera_RoomView_Int32 = \"roomView\";\n\tstatic const char * const k_pch_Camera_BoundsColorGammaR_Int32 = \"cameraBoundsColorGammaR\";\n\tstatic const char * const k_pch_Camera_BoundsColorGammaG_Int32 = \"cameraBoundsColorGammaG\";\n\tstatic const char * const k_pch_Camera_BoundsColorGammaB_Int32 = \"cameraBoundsColorGammaB\";\n\tstatic const char * const k_pch_Camera_BoundsColorGammaA_Int32 = \"cameraBoundsColorGammaA\";\n\tstatic const char * const k_pch_Camera_BoundsStrength_Int32 = \"cameraBoundsStrength\";\n\tstatic const char * const k_pch_Camera_RoomViewStyle_Int32 = \"roomViewStyle\";\n\n\t//-----------------------------------------------------------------------------\n\t// audio keys\n\tstatic const char * const k_pch_audio_Section = \"audio\";\n\tstatic const char * const k_pch_audio_SetOsDefaultPlaybackDevice_Bool = \"setOsDefaultPlaybackDevice\";\n\tstatic const char * const k_pch_audio_EnablePlaybackDeviceOverride_Bool = \"enablePlaybackDeviceOverride\";\n\tstatic const char * const k_pch_audio_PlaybackDeviceOverride_String = \"playbackDeviceOverride\";\n\tstatic const char * const k_pch_audio_PlaybackDeviceOverrideName_String = \"playbackDeviceOverrideName\";\n\tstatic const char * const k_pch_audio_SetOsDefaultRecordingDevice_Bool = \"setOsDefaultRecordingDevice\";\n\tstatic const char * const k_pch_audio_EnableRecordingDeviceOverride_Bool = \"enableRecordingDeviceOverride\";\n\tstatic const char * const k_pch_audio_RecordingDeviceOverride_String = \"recordingDeviceOverride\";\n\tstatic const char * const k_pch_audio_RecordingDeviceOverrideName_String = \"recordingDeviceOverrideName\";\n\tstatic const char * const k_pch_audio_EnablePlaybackMirror_Bool = \"enablePlaybackMirror\";\n\tstatic const char * const k_pch_audio_PlaybackMirrorDevice_String = \"playbackMirrorDevice\";\n\tstatic const char * const k_pch_audio_PlaybackMirrorDeviceName_String = \"playbackMirrorDeviceName\";\n\tstatic const char * const k_pch_audio_OldPlaybackMirrorDevice_String = \"onPlaybackMirrorDevice\";\n\tstatic const char * const k_pch_audio_ActiveMirrorDevice_String = \"activePlaybackMirrorDevice\";\n\tstatic const char * const k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = \"enablePlaybackMirrorIndependentVolume\";\n\tstatic const char * const k_pch_audio_LastHmdPlaybackDeviceId_String = \"lastHmdPlaybackDeviceId\";\n\tstatic const char * const k_pch_audio_VIVEHDMIGain = \"viveHDMIGain\";\n\tstatic const char * const k_pch_audio_DualSpeakerAndJackOutput_Bool = \"dualSpeakerAndJackOutput\";\n\tstatic const char * const k_pch_audio_MuteMicMonitor_Bool = \"muteMicMonitor\";\n\n\t//-----------------------------------------------------------------------------\n\t// power management keys\n\tstatic const char * const k_pch_Power_Section = \"power\";\n\tstatic const char * const k_pch_Power_PowerOffOnExit_Bool = \"powerOffOnExit\";\n\tstatic const char * const k_pch_Power_TurnOffScreensTimeout_Float = \"turnOffScreensTimeout\";\n\tstatic const char * const k_pch_Power_TurnOffControllersTimeout_Float = \"turnOffControllersTimeout\";\n\tstatic const char * const k_pch_Power_ReturnToWatchdogTimeout_Float = \"returnToWatchdogTimeout\";\n\tstatic const char * const k_pch_Power_AutoLaunchSteamVROnButtonPress = \"autoLaunchSteamVROnButtonPress\";\n\tstatic const char * const k_pch_Power_PauseCompositorOnStandby_Bool = \"pauseCompositorOnStandby\";\n\n\t//-----------------------------------------------------------------------------\n\t// dashboard keys\n\tstatic const char * const k_pch_Dashboard_Section = \"dashboard\";\n\tstatic const char * const k_pch_Dashboard_EnableDashboard_Bool = \"enableDashboard\";\n\tstatic const char * const k_pch_Dashboard_ArcadeMode_Bool = \"arcadeMode\";\n\tstatic const char * const k_pch_Dashboard_Position = \"position\";\n\tstatic const char * const k_pch_Dashboard_DesktopScale = \"desktopScale\";\n\tstatic const char * const k_pch_Dashboard_DashboardScale = \"dashboardScale\";\n\tstatic const char * const k_pch_Dashboard_UseStandaloneSystemLayer = \"standaloneSystemLayer\";\n\tstatic const char * const k_pch_Dashboard_AllowSteamOverlays_Bool = \"allowSteamOverlays\";\n\tstatic const char * const k_pch_Dashboard_AllowVRGamepadUI_Bool = \"allowVRGamepadUI\";\n\tstatic const char * const k_pch_Dashboard_AllowVRGamepadUIViaGamescope_Bool = \"allowVRGamepadUIViaGamescope\";\n\tstatic const char * const k_pch_Dashboard_SteamMatchesHMDFramerate = \"steamMatchesHMDFramerate\";\n\tstatic const char * const k_pch_Dashboard_GrabHandleAcceleration = \"grabHandleAcceleration\";\n\n\t//-----------------------------------------------------------------------------\n\t// model skin keys\n\tstatic const char * const k_pch_modelskin_Section = \"modelskins\";\n\n\t//-----------------------------------------------------------------------------\n\t// driver keys - These could be checked in any driver_<name> section\n\tstatic const char * const k_pch_Driver_Enable_Bool = \"enable\";\n\tstatic const char * const k_pch_Driver_BlockedBySafemode_Bool = \"blocked_by_safe_mode\";\n\tstatic const char * const k_pch_Driver_LoadPriority_Int32 = \"loadPriority\";\n\tstatic const char * const k_pch_Driver_Hmd_AllowsClientToControlTextureIndex_Bool = \"hmdAllowsClientToControlTextureIndex\";\n\tstatic const char * const k_pch_Driver_ForceSystemLayerUseAppPoses_Bool = \"forceSystemLayerUseAppPoses\";\n\n\t//-----------------------------------------------------------------------------\n\t// web interface keys\n\tstatic const char* const k_pch_WebInterface_Section = \"WebInterface\";\n\n\t//-----------------------------------------------------------------------------\n\t// vrwebhelper keys\n\tstatic const char* const k_pch_VRWebHelper_Section = \"VRWebHelper\";\n\tstatic const char* const k_pch_VRWebHelper_DebuggerEnabled_Bool = \"DebuggerEnabled\";\n\tstatic const char* const k_pch_VRWebHelper_DebuggerPort_Int32 = \"DebuggerPort\";\n\n\t//-----------------------------------------------------------------------------\n\t// tracking overrides - keys are device paths, values are the device paths their\n\t//  tracking/pose information overrides\n\tstatic const char* const k_pch_TrackingOverride_Section = \"TrackingOverrides\";\n\n\t//-----------------------------------------------------------------------------\n\t// per-app keys - the section name for these is the app key itself. Some of these are prefixed by the controller type\n\tstatic const char* const k_pch_App_BindingAutosaveURLSuffix_String = \"AutosaveURL\";\n\tstatic const char* const k_pch_App_BindingLegacyAPISuffix_String = \"_legacy\";\n\tstatic const char *const k_pch_App_BindingSteamVRInputAPISuffix_String = \"_steamvrinput\";\n\tstatic const char *const k_pch_App_BindingOpenXRAPISuffix_String = \"_openxr\";\n\tstatic const char* const k_pch_App_BindingCurrentURLSuffix_String = \"CurrentURL\";\n\tstatic const char* const k_pch_App_BindingPreviousURLSuffix_String = \"PreviousURL\";\n\tstatic const char* const k_pch_App_NeedToUpdateAutosaveSuffix_Bool = \"NeedToUpdateAutosave\";\n\tstatic const char* const k_pch_App_DominantHand_Int32 = \"DominantHand\";\n\tstatic const char* const k_pch_App_BlockOculusSDK_Bool = \"blockOculusSDK\";\n\n\t//-----------------------------------------------------------------------------\n\t// configuration for trackers\n\tstatic const char * const k_pch_Trackers_Section = \"trackers\";\n\n\t//-----------------------------------------------------------------------------\n\t// configuration for desktop UI windows\n\tstatic const char * const k_pch_DesktopUI_Section = \"DesktopUI\";\n\n\t//-----------------------------------------------------------------------------\n\t// Last known keys for righting recovery\n\tstatic const char * const k_pch_LastKnown_Section = \"LastKnown\";\n\tstatic const char* const k_pch_LastKnown_HMDManufacturer_String = \"HMDManufacturer\";\n\tstatic const char *const k_pch_LastKnown_HMDModel_String = \"HMDModel\";\n\tstatic const char* const k_pch_LastKnown_ActualHMDDriver_String = \"ActualHMDDriver\";\n\tstatic const char* const k_pch_LastKnown_HMDSerialNumber_String = \"HMDSerialNumber\";\n\tstatic const char* const k_pch_LastKnown_HMDRemoteClientID_String = \"RemoteClientID\"; // uint64 in string\n\n\t//-----------------------------------------------------------------------------\n\t// Dismissed warnings\n\tstatic const char * const k_pch_DismissedWarnings_Section = \"DismissedWarnings\";\n\n\t//-----------------------------------------------------------------------------\n\t// Input Settings\n\tstatic const char * const k_pch_Input_Section = \"input\";\n\tstatic const char* const k_pch_Input_LeftThumbstickRotation_Float = \"leftThumbstickRotation\";\n\tstatic const char* const k_pch_Input_RightThumbstickRotation_Float = \"rightThumbstickRotation\";\n\tstatic const char* const k_pch_Input_ThumbstickDeadzone_Float = \"thumbstickDeadzone\";\n\n\t//-----------------------------------------------------------------------------\n\t// Log of GPU performance\n\tstatic const char * const k_pch_GpuSpeed_Section = \"GpuSpeed\";\n\n\t//-----------------------------------------------------------------------------\n\t// OpenXR Render Model Extension keys\n\tstatic const char *const k_pch_XRRenderModelCache_Section = \"XRRenderModelUuidCache\";\n\n} // namespace vr\n\n// iservertrackeddevicedriver.h\n\nnamespace vr\n{\n\n\nstruct DriverPoseQuaternion_t\n{\n\tdouble w, x, y, z;\n};\n\nstruct DriverPose_t\n{\n\t/* Time offset of this pose, in seconds from the actual time of the pose,\n\t * relative to the time of the PoseUpdated() call made by the driver.\n\t */\n\tdouble poseTimeOffset;\n\n\t/* Generally, the pose maintained by a driver\n\t * is in an inertial coordinate system different\n\t * from the world system of x+ right, y+ up, z+ back.\n\t * Also, the driver is not usually tracking the \"head\" position,\n\t * but instead an internal IMU or another reference point in the HMD.\n\t * The following two transforms transform positions and orientations\n\t * to app world space from driver world space,\n\t * and to HMD head space from driver local body space.\n\t *\n\t * We maintain the driver pose state in its internal coordinate system,\n\t * so we can do the pose prediction math without having to\n\t * use angular acceleration.  A driver's angular acceleration is generally not measured,\n\t * and is instead calculated from successive samples of angular velocity.\n\t * This leads to a noisy angular acceleration values, which are also\n\t * lagged due to the filtering required to reduce noise to an acceptable level.\n\t */\n\tvr::HmdQuaternion_t qWorldFromDriverRotation;\n\tdouble vecWorldFromDriverTranslation[ 3 ];\n\n\tvr::HmdQuaternion_t qDriverFromHeadRotation;\n\tdouble vecDriverFromHeadTranslation[ 3 ];\n\n\t/* State of driver pose, in meters and radians. */\n\t/* Position of the driver tracking reference in driver world space\n\t* +[0] (x) is right\n\t* +[1] (y) is up\n\t* -[2] (z) is forward\n\t*/\n\tdouble vecPosition[ 3 ];\n\n\t/* Velocity of the pose in meters/second */\n\tdouble vecVelocity[ 3 ];\n\n\t/* Acceleration of the pose in meters/second */\n\tdouble vecAcceleration[ 3 ];\n\n\t/* Orientation of the tracker, represented as a quaternion */\n\tvr::HmdQuaternion_t qRotation;\n\n\t/* Angular velocity of the pose in axis-angle\n\t* representation. The direction is the angle of\n\t* rotation and the magnitude is the angle around\n\t* that axis in radians/second. */\n\tdouble vecAngularVelocity[ 3 ];\n\n\t/* Angular acceleration of the pose in axis-angle\n\t* representation. The direction is the angle of\n\t* rotation and the magnitude is the angle around\n\t* that axis in radians/second^2. */\n\tdouble vecAngularAcceleration[ 3 ];\n\n\tETrackingResult result;\n\n\tbool poseIsValid;\n\tbool willDriftInYaw;\n\tbool shouldApplyHeadModel;\n\tbool deviceIsConnected;\n};\n\n\n// ----------------------------------------------------------------------------------------------\n// Purpose: Represents a single tracked device in a driver\n// ----------------------------------------------------------------------------------------------\nclass ITrackedDeviceServerDriver\n{\npublic:\n\n\t// ------------------------------------\n\t// Management Methods\n\t// ------------------------------------\n\t/** This is called before an HMD is returned to the application. It will always be\n\t* called before any display or tracking methods. Memory and processor use by the\n\t* ITrackedDeviceServerDriver object should be kept to a minimum until it is activated.\n\t* The pose listener is guaranteed to be valid until Deactivate is called, but\n\t* should not be used after that point. */\n\tvirtual EVRInitError Activate( uint32_t unObjectId ) = 0;\n\n\t/** This is called when The VR system is switching from this Hmd being the active display\n\t* to another Hmd being the active display. The driver should clean whatever memory\n\t* and thread use it can when it is deactivated */\n\tvirtual void Deactivate() = 0;\n\n\t/** Handles a request from the system to put this device into standby mode. What that means is defined per-device. */\n\tvirtual void EnterStandby() = 0;\n\n\t/** Requests a component interface of the driver for device-specific functionality. The driver should return NULL\n\t* if the requested interface or version is not supported. */\n\tvirtual void *GetComponent( const char *pchComponentNameAndVersion ) = 0;\n\n\t/** A VR Client has made this debug request of the driver. The set of valid requests is entirely\n\t* up to the driver and the client to figure out, as is the format of the response. Responses that\n\t* exceed the length of the supplied buffer should be truncated and null terminated */\n\tvirtual void DebugRequest( const char *pchRequest, char *pchResponseBuffer, uint32_t unResponseBufferSize ) = 0;\n\n\t/** This interface is unused, and will never be called. */\n\tvirtual DriverPose_t GetPose() = 0;\n};\n\n\n\nstatic const char *ITrackedDeviceServerDriver_Version = \"ITrackedDeviceServerDriver_005\";\n\n}\n\n// ivrdisplaycomponent.h\n\nnamespace vr\n{\n\n\n\t// ----------------------------------------------------------------------------------------------\n\t// Purpose: The display component on a single tracked device\n\t// ----------------------------------------------------------------------------------------------\n\tclass IVRDisplayComponent\n\t{\n\tpublic:\n\n\t\t// ------------------------------------\n\t\t// Display Methods\n\t\t// ------------------------------------\n\n\t\t/** Size and position that the window needs to be on the VR display. */\n\t\tvirtual void GetWindowBounds( int32_t *pnX, int32_t *pnY, uint32_t *pnWidth, uint32_t *pnHeight ) = 0;\n\n\t\t/** Returns true if the display is extending the desktop. */\n\t\tvirtual bool IsDisplayOnDesktop( ) = 0;\n\n\t\t/** Returns true if the display is real and not a fictional display. */\n\t\tvirtual bool IsDisplayRealDisplay( ) = 0;\n\n\t\t/** Suggested size for the intermediate render target that the distortion pulls from. */\n\t\tvirtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight ) = 0;\n\n\t\t/** Gets the viewport in the frame buffer to draw the output of the distortion into */\n\t\tvirtual void GetEyeOutputViewport( EVREye eEye, uint32_t *pnX, uint32_t *pnY, uint32_t *pnWidth, uint32_t *pnHeight ) = 0;\n\n\t\t/** The components necessary to build your own projection matrix in case your\n\t\t* application is doing something fancy like infinite Z */\n\t\tvirtual void GetProjectionRaw( EVREye eEye, float *pfLeft, float *pfRight, float *pfTop, float *pfBottom ) = 0;\n\n\t\t/** Returns the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in\n\t\t* the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. */\n\t\tvirtual DistortionCoordinates_t ComputeDistortion( EVREye eEye, float fU, float fV ) = 0;\n\n\t\t/** Computes the result of the inverse distortion function for the specified eye, channel, and input UV.\n\t\t* Operation can fail, returns success/failure, on success result is stored in *pResult */\n\t\tvirtual bool ComputeInverseDistortion( HmdVector2_t *pResult, EVREye eEye, uint32_t unChannel, float fU, float fV ) = 0;\n\t};\n\n\tstatic const char *IVRDisplayComponent_Version = \"IVRDisplayComponent_003\";\n\n}\n\n// ivrdriverdirectmodecomponent.h\n\nnamespace vr\n{\n\tenum VRSwapTextureFlag\n\t{\n\t\t// Specify that the shared texture resource was created with the SHARED_NTHANDLE option (Windows)\n\t\tVRSwapTextureFlag_Shared_NTHandle = 1 << 0,\n\t};\n\n\t// ----------------------------------------------------------------------------------------------\n\t// Purpose: This component is used for drivers that implement direct mode entirely on their own\n\t//\t\t\twithout allowing the VR Compositor to own the window/device.\n\t// ----------------------------------------------------------------------------------------------\n\tclass IVRDriverDirectModeComponent\n\t{\n\tpublic:\n\n\t\t// -----------------------------------\n\t\t// Direct mode methods\n\t\t// -----------------------------------\n\n\t\tstruct SwapTextureSetDesc_t\n\t\t{\n\t\t\tuint32_t nWidth;\n\t\t\tuint32_t nHeight;\n\t\t\tuint32_t nFormat;\n\t\t\tuint32_t nSampleCount;\n\t\t};\n\n\t\tstruct SwapTextureSet_t\n\t\t{\n\t\t\tvr::SharedTextureHandle_t rSharedTextureHandles[ 3 ];\n\t\t\tuint32_t unTextureFlags;\n\t\t};\n\n\t\t/** Called to allocate textures for applications to render into.  One of these per eye will be passed back to SubmitLayer each frame. */\n\t\tvirtual void CreateSwapTextureSet( uint32_t unPid, const SwapTextureSetDesc_t *pSwapTextureSetDesc, SwapTextureSet_t *pOutSwapTextureSet ) {}\n\n\t\t/** Used to textures created using CreateSwapTextureSet.  Only one of the set's handles needs to be used to destroy the entire set. */\n\t\tvirtual void DestroySwapTextureSet( vr::SharedTextureHandle_t sharedTextureHandle ) {}\n\n\t\t/** Used to purge all texture sets for a given process. */\n\t\tvirtual void DestroyAllSwapTextureSets( uint32_t unPid ) {}\n\n\t\t/** After Present returns, calls this to get the next index to use for rendering. */\n\t\tvirtual void GetNextSwapTextureSetIndex( vr::SharedTextureHandle_t sharedTextureHandles[ 2 ], uint32_t( *pIndices )[ 2 ] ) {}\n\n\t\t/** Call once per layer to draw for this frame.  One shared texture handle per eye.  Textures must be created\n\t\t* using CreateSwapTextureSet and should be alternated per frame.  Call Present once all layers have been submitted. */\n\t\tstruct SubmitLayerPerEye_t\n\t\t{\n\t\t\t// Shared texture handles (depth not always provided).\n\t\t\tvr::SharedTextureHandle_t hTexture, hDepthTexture;\n\n\t\t\t// Valid region of provided texture (and depth).\n\t\t\tvr::VRTextureBounds_t bounds;\n\n\t\t\t// Projection matrix used to render the depth buffer.\n\t\t\tvr::HmdMatrix44_t mProjection;\n\n\t\t\t// Hmd pose used to render this layer.\n\t\t\tvr::HmdMatrix34_t mHmdPose;\n\n\t\t\t// Time in seconds from now that mHmdPose was predicted to.\n\t\t\tfloat flHmdPosePredictionTimeInSecondsFromNow;\n\t\t};\n\t\tvirtual void SubmitLayer( const SubmitLayerPerEye_t( &perEye )[ 2 ] ) {}\n\n\t\t/** Submits queued layers for display. */\n\t\tvirtual void Present( vr::SharedTextureHandle_t syncTexture ) {}\n\n\t\t/** Called after Present to allow driver to take more time until vsync after they've successfully acquired the sync texture in Present.\n\t\t* Set Prop_Hmd_SupportsAppThrottling_Bool to enable throttling / prediction UI in per-app video settings. */\n\t\tstruct Throttling_t\n\t\t{\n\t\t\tuint32_t nFramesToThrottle;\n\t\t\tuint32_t nAdditionalFramesToPredict;\n\t\t};\n\t\tvirtual void PostPresent( const Throttling_t *pThrottling ) {}\n\n\t\t/** Called to get additional frame timing stats from driver.  Check m_nSize for versioning (new members will be added to end only). */\n\t\tvirtual void GetFrameTiming( DriverDirectMode_FrameTiming *pFrameTiming )\n\t\t{\n\t\t\t/** VRCompositor_ReprojectionMotion_XXX flags get passed in, and since these overlap with VRCompositor_ThrottleMask, they need\n\t\t\t* to be cleared out if this function isn't implemented; otherwise, those settings will get interpreted as throttling. */\n\t\t\tpFrameTiming->m_nReprojectionFlags = 0;\n\t\t}\n\t};\n\n\tstatic const char *IVRDriverDirectModeComponent_Version = \"IVRDriverDirectModeComponent_009\";\n\n}\n\n// ivrcameracomponent.h\n\nnamespace vr\n{\n\t//-----------------------------------------------------------------------------\n\t//-----------------------------------------------------------------------------\n\tclass ICameraVideoSinkCallback\n\t{\n\tpublic:\n\t\tvirtual void OnCameraVideoSinkCallback() = 0;\n\t};\n\n\t// ----------------------------------------------------------------------------------------------\n\t// Purpose: The camera on a single tracked device\n\t// ----------------------------------------------------------------------------------------------\n\tclass IVRCameraComponent\n\t{\n\tpublic:\n\t\t// ------------------------------------\n\t\t// Camera Methods\n\t\t// ------------------------------------\n\t\tvirtual bool GetCameraFrameDimensions( vr::ECameraVideoStreamFormat nVideoStreamFormat, uint32_t *pWidth, uint32_t *pHeight ) = 0;\n\t\tvirtual bool GetCameraFrameBufferingRequirements( int *pDefaultFrameQueueSize, uint32_t *pFrameBufferDataSize ) = 0;\n\t\tvirtual bool SetCameraFrameBuffering( int nFrameBufferCount, void **ppFrameBuffers, uint32_t nFrameBufferDataSize ) = 0;\n\t\tvirtual bool SetCameraVideoStreamFormat( vr::ECameraVideoStreamFormat nVideoStreamFormat ) = 0;\n\t\tvirtual vr::ECameraVideoStreamFormat GetCameraVideoStreamFormat() = 0;\n\t\tvirtual bool StartVideoStream() = 0;\n\t\tvirtual void StopVideoStream() = 0;\n\t\tvirtual bool IsVideoStreamActive( bool *pbPaused, float *pflElapsedTime ) = 0;\n\t\tvirtual const vr::CameraVideoStreamFrame_t *GetVideoStreamFrame() = 0;\n\t\tvirtual void ReleaseVideoStreamFrame( const vr::CameraVideoStreamFrame_t *pFrameImage ) = 0;\n\t\tvirtual bool SetAutoExposure( bool bEnable ) = 0;\n\t\tvirtual bool PauseVideoStream() = 0;\n\t\tvirtual bool ResumeVideoStream() = 0;\n\t\tvirtual bool GetCameraDistortion( uint32_t nCameraIndex, float flInputU, float flInputV, float *pflOutputU, float *pflOutputV ) = 0;\n\t\tvirtual bool GetCameraProjection( uint32_t nCameraIndex, vr::EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, vr::HmdMatrix44_t *pProjection ) = 0;\n\t\tvirtual bool SetFrameRate( int nISPFrameRate, int nSensorFrameRate ) = 0;\n\t\tvirtual bool SetCameraVideoSinkCallback( vr::ICameraVideoSinkCallback *pCameraVideoSinkCallback ) = 0;\n\t\tvirtual bool GetCameraCompatibilityMode( vr::ECameraCompatibilityMode *pCameraCompatibilityMode ) = 0;\n\t\tvirtual bool SetCameraCompatibilityMode( vr::ECameraCompatibilityMode nCameraCompatibilityMode ) = 0;\n\t\tvirtual bool GetCameraFrameBounds( vr::EVRTrackedCameraFrameType eFrameType, uint32_t *pLeft, uint32_t *pTop, uint32_t *pWidth, uint32_t *pHeight ) = 0;\n\t\tvirtual bool GetCameraIntrinsics( uint32_t nCameraIndex, vr::EVRTrackedCameraFrameType eFrameType, HmdVector2_t *pFocalLength, HmdVector2_t *pCenter, vr::EVRDistortionFunctionType *peDistortionType, double rCoefficients[ k_unMaxDistortionFunctionParameters ] ) = 0;\n\t};\n\n\tstatic const char *IVRCameraComponent_Version = \"IVRCameraComponent_003\";\n}\n\n// itrackeddevicedriverprovider.h\n\nnamespace vr\n{\n\nclass ITrackedDeviceServerDriver;\nstruct TrackedDeviceDriverInfo_t;\nstruct DriverPose_t;\n\n/** This interface is provided by vrserver to allow the driver to notify\n* the system when something changes about a device. These changes must\n* not change the serial number or class of the device because those values\n* are permanently associated with the device's index. */\nclass IVRDriverContext\n{\npublic:\n\t/** Returns the requested interface. If the interface was not available it will return NULL and fill\n\t* out the error. */\n\tvirtual void *GetGenericInterface( const char *pchInterfaceVersion, EVRInitError *peError = nullptr ) = 0;\n\n\t/** Returns the property container handle for this driver */\n\tvirtual DriverHandle_t GetDriverHandle() = 0;\n};\n\n\n/** This interface must be implemented in each driver. It will be loaded in vrserver.exe */\nclass IServerTrackedDeviceProvider\n{\npublic:\n\t/** initializes the driver. This will be called before any other methods are called.\n\t* If Init returns anything other than VRInitError_None the driver DLL will be unloaded.\n\t*\n\t* pDriverHost will never be NULL, and will always be a pointer to a IServerDriverHost interface\n\t*\n\t* pchUserDriverConfigDir - The absolute path of the directory where the driver should store user\n\t*\tconfig files.\n\t* pchDriverInstallDir - The absolute path of the root directory for the driver.\n\t*/\n\tvirtual EVRInitError Init( IVRDriverContext *pDriverContext ) = 0;\n\n\t/** cleans up the driver right before it is unloaded */\n\tvirtual void Cleanup() = 0;\n\n\t/** Returns the version of the ITrackedDeviceServerDriver interface used by this driver */\n\tvirtual const char * const *GetInterfaceVersions() = 0;\n\n\t/** Allows the driver do to some work in the main loop of the server. */\n\tvirtual void RunFrame() = 0;\n\n\n\t// ------------  Power State Functions ----------------------- //\n\n\t/** Returns true if the driver wants to block Standby mode. */\n\tvirtual bool ShouldBlockStandbyMode() = 0;\n\n\t/** Called when the system is entering Standby mode. The driver should switch itself into whatever sort of low-power\n\t* state it has. */\n\tvirtual void EnterStandby() = 0;\n\n\t/** Called when the system is leaving Standby mode. The driver should switch itself back to\n\tfull operation. */\n\tvirtual void LeaveStandby() = 0;\n\n};\n\n\nstatic const char *IServerTrackedDeviceProvider_Version = \"IServerTrackedDeviceProvider_004\";\n\n\n\n\n/** This interface must be implemented in each driver. It will be loaded in vrclient.dll */\nclass IVRWatchdogProvider\n{\npublic:\n\t/** initializes the driver in watchdog mode. */\n\tvirtual EVRInitError Init( IVRDriverContext *pDriverContext ) = 0;\n\n\t/** cleans up the driver right before it is unloaded */\n\tvirtual void Cleanup() = 0;\n};\n\nstatic const char *IVRWatchdogProvider_Version = \"IVRWatchdogProvider_001\";\n\n\n\n\n/** This is an optional interface drivers may implement. It will be loaded in vrcompositor.exe */\nclass IVRCompositorPluginProvider\n{\npublic:\n\t/** initializes the driver when used to load compositor plugins */\n\tvirtual EVRInitError Init( IVRDriverContext *pDriverContext ) = 0;\n\n\t/** cleans up the driver right before it is unloaded */\n\tvirtual void Cleanup() = 0;\n\n\t/** Returns the versions of interfaces used by this driver */\n\tvirtual const char * const *GetInterfaceVersions() = 0;\n\n\t/** Requests a component interface of the driver for specific functionality. The driver should return NULL\n\t* if the requested interface or version is not supported. */\n\tvirtual void *GetComponent( const char *pchComponentNameAndVersion ) = 0;\n};\n\nstatic const char *IVRCompositorPluginProvider_Version = \"IVRCompositorPluginProvider_001\";\n\n}\n\n// ivrproperties.h\n\n#include <string>\n#include <vector>\n\nnamespace vr\n{\n\n\t/** This container is automatically created before a display redirect device is activated.\n\t* Any properties in this container will be returned when that property is read from the HMD's\n\t* property container. */\n\tstatic const PropertyContainerHandle_t k_ulDisplayRedirectContainer = 0x600000003;\n\n\tenum EPropertyWriteType\n\t{\n\t\tPropertyWrite_Set = 0,\n\t\tPropertyWrite_Erase = 1,\n\t\tPropertyWrite_SetError = 2\n\t};\n\n\tstruct PropertyWrite_t\n\t{\n\t\tETrackedDeviceProperty prop;\n\t\tEPropertyWriteType writeType;\n\t\tETrackedPropertyError eSetError;\n\t\tvoid *pvBuffer;\n\t\tuint32_t unBufferSize;\n\t\tPropertyTypeTag_t unTag;\n\t\tETrackedPropertyError eError;\n\t};\n\n\tstruct PropertyRead_t\n\t{\n\t\tETrackedDeviceProperty prop;\n\t\tvoid *pvBuffer;\n\t\tuint32_t unBufferSize;\n\t\tPropertyTypeTag_t unTag;\n\t\tuint32_t unRequiredBufferSize;\n\t\tETrackedPropertyError eError;\n\t};\n\n\nclass IVRProperties\n{\npublic:\n\n\t/** Reads a set of properties atomically. See the PropertyReadBatch_t struct for more information. */\n\tvirtual ETrackedPropertyError ReadPropertyBatch( PropertyContainerHandle_t ulContainerHandle, PropertyRead_t *pBatch, uint32_t unBatchEntryCount ) = 0;\n\n\t/** Writes a set of properties atomically. See the PropertyWriteBatch_t struct for more information. */\n\tvirtual ETrackedPropertyError WritePropertyBatch( PropertyContainerHandle_t ulContainerHandle, PropertyWrite_t *pBatch, uint32_t unBatchEntryCount ) = 0;\n\n\t/** returns a string that corresponds with the specified property error. The string will be the name\n\t* of the error enum value for all valid error codes */\n\tvirtual const char *GetPropErrorNameFromEnum( ETrackedPropertyError error ) = 0;\n\n\t/** Returns a container handle given a tracked device index */\n\tvirtual PropertyContainerHandle_t TrackedDeviceToPropertyContainer( TrackedDeviceIndex_t nDevice ) = 0;\n};\n\nstatic const char * const IVRProperties_Version = \"IVRProperties_001\";\n\nclass CVRPropertyHelpers\n{\npublic:\n\tCVRPropertyHelpers( IVRProperties * pProperties ) : m_pProperties( pProperties ) {}\n\n\t/** Gets the typed property according to the caller's expected return type. */\n\ttemplate <typename T>\n\tT GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError );\n\n\t/** Returns a scaler property. If the device index is not valid or the property value type does not match,\n\t* this function will return false. */\n\tbool GetBoolProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tfloat GetFloatProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tint32_t GetInt32Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tuint64_t GetUint64Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tHmdVector2_t GetVec2Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tHmdVector3_t GetVec3Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tHmdVector4_t GetVec4Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\tdouble GetDoubleProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L );\n\n\t/** Returns a single typed property. If the device index is not valid or the property is not a string type this function will\n\t* return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing\n\t* null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */\n\tuint32_t GetProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, VR_OUT_STRING() void *pvBuffer, uint32_t unBufferSize, PropertyTypeTag_t *punTag, ETrackedPropertyError *pError = 0L );\n\n\t/** Returns a string property. If the device index is not valid or the property is not a string type this function will\n\t* return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing\n\t* null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */\n\tuint32_t GetStringProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L );\n\n\t/** Returns a string property as a std::string. If the device index is not valid or the property is not a string type this function will\n\t* return an empty string. */\n\tstd::string GetStringProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError = nullptr );\n\n\t/** Reads a std::vector of data from a property. */\n\ttemplate< typename T>\n\tETrackedPropertyError GetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector<T> *pvecResults );\n\n\t/** Sets a scaler property. The new value will be returned on any subsequent call to get this property in any process. */\n\tETrackedPropertyError SetBoolProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, bool bNewValue );\n\tETrackedPropertyError SetFloatProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, float fNewValue );\n\tETrackedPropertyError SetInt32Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, int32_t nNewValue );\n\tETrackedPropertyError SetUint64Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, uint64_t ulNewValue );\n\tETrackedPropertyError SetVec2Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector2_t & vNewValue );\n\tETrackedPropertyError SetVec3Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector3_t & vNewValue );\n\tETrackedPropertyError SetVec4Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector4_t & vNewValue );\n\tETrackedPropertyError SetDoubleProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, double vNewValue );\n\n\t/** Sets a string property. The new value will be returned on any subsequent call to get this property in any process. */\n\tETrackedPropertyError SetStringProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const char *pchNewValue );\n\n\t/** Sets a single typed property. The new value will be returned on any subsequent call to get this property in any process. */\n\tETrackedPropertyError SetProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, void *pvNewValue, uint32_t unNewValueSize, PropertyTypeTag_t unTag );\n\n\t/** Sets the error return value for a property. This value will be returned on all subsequent requests to get the property */\n\tETrackedPropertyError SetPropertyError( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError eError );\n\n\t/** Clears any value or error set for the property. */\n\tETrackedPropertyError EraseProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop );\n\n\t/* Turns a device index into a property container handle. */\n\tPropertyContainerHandle_t TrackedDeviceToPropertyContainer( TrackedDeviceIndex_t nDevice ) { return m_pProperties->TrackedDeviceToPropertyContainer( nDevice );  }\n\n\t/** Sets a std::vector of typed data to a property. */\n\ttemplate< typename T>\n\tETrackedPropertyError SetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector<T> *vecProperties );\n\n\t/** Returns true if the specified property is set on the specified container */\n\tbool IsPropertySet( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, ETrackedPropertyError *peError = nullptr );\nprivate:\n\ttemplate<typename T>\n\tT GetPropertyHelper( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError, T bDefault, PropertyTypeTag_t unTypeTag );\n\n\tIVRProperties *m_pProperties;\n};\n\n\n/** Returns a string property as a std::string. If the device index is not valid or the property is not a string type this function will\n* return an empty string. */\ntemplate <>\ninline std::string CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetStringProperty( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline bool CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetBoolProperty( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline float CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetFloatProperty( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline int32_t CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetInt32Property( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline uint64_t CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetUint64Property( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline HmdVector2_t CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetVec2Property( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline HmdVector3_t CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetVec3Property( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline HmdVector4_t CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetVec4Property( ulContainer, prop, peError );\n}\n\n\ntemplate <>\ninline double CVRPropertyHelpers::GetTypedProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\treturn GetDoubleProperty( ulContainer, prop, peError );\n}\n\n\ninline uint32_t CVRPropertyHelpers::GetProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, VR_OUT_STRING() void *pvBuffer, uint32_t unBufferSize, PropertyTypeTag_t *punTag, ETrackedPropertyError *pError )\n{\n\tPropertyRead_t batch;\n\tbatch.prop = prop;\n\tbatch.pvBuffer = pvBuffer;\n\tbatch.unBufferSize = unBufferSize;\n\n\tm_pProperties->ReadPropertyBatch( ulContainerHandle, &batch, 1 );\n\n\tif ( pError )\n\t{\n\t\t*pError = batch.eError;\n\t}\n\n\tif ( punTag )\n\t{\n\t\t*punTag = batch.unTag;\n\t}\n\n\treturn batch.unRequiredBufferSize;\n}\n\n\n/** Sets a single typed property. The new value will be returned on any subsequent call to get this property in any process. */\ninline ETrackedPropertyError CVRPropertyHelpers::SetProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, void *pvNewValue, uint32_t unNewValueSize, PropertyTypeTag_t unTag )\n{\n\tPropertyWrite_t batch;\n\tbatch.writeType = PropertyWrite_Set;\n\tbatch.prop = prop;\n\tbatch.pvBuffer = pvNewValue;\n\tbatch.unBufferSize = unNewValueSize;\n\tbatch.unTag = unTag;\n\n\tm_pProperties->WritePropertyBatch( ulContainerHandle, &batch, 1 );\n\n\treturn batch.eError;\n}\n\n\n/** Returns a string property. If the device index is not valid or the property is not a string type this function will\n* return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing\n* null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */\ninline uint32_t CVRPropertyHelpers::GetStringProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, ETrackedPropertyError *pError )\n{\n\tPropertyTypeTag_t unTag;\n\tETrackedPropertyError error;\n\tuint32_t unRequiredSize = GetProperty( ulContainerHandle, prop, pchValue, unBufferSize, &unTag, &error );\n\tif ( unTag != k_unStringPropertyTag && error == TrackedProp_Success )\n\t{\n\t\terror = TrackedProp_WrongDataType;\n\t}\n\n\tif ( pError )\n\t{\n\t\t*pError = error;\n\t}\n\n\tif ( error != TrackedProp_Success )\n\t{\n\t\tif ( pchValue && unBufferSize )\n\t\t{\n\t\t\t*pchValue = '\\0';\n\t\t}\n\t}\n\n\treturn unRequiredSize;\n}\n\n\n/** Returns a string property as a std::string. If the device index is not valid or the property is not a string type this function will\n* return an empty string. */\ninline std::string CVRPropertyHelpers::GetStringProperty( vr::PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, vr::ETrackedPropertyError *peError )\n{\n\tchar buf[1024];\n\tvr::ETrackedPropertyError err;\n\tuint32_t unRequiredBufferLen = GetStringProperty( ulContainer, prop, buf, sizeof(buf), &err );\n\n\tstd::string sResult;\n\n\tif ( err == TrackedProp_Success )\n\t{\n\t\tsResult = buf;\n\t}\n\telse if ( err == TrackedProp_BufferTooSmall )\n\t{\n\t\tchar *pchBuffer = new char[unRequiredBufferLen];\n\t\tunRequiredBufferLen = GetStringProperty( ulContainer, prop, pchBuffer, unRequiredBufferLen, &err );\n\t\tsResult = pchBuffer;\n\t\tdelete[] pchBuffer;\n\t}\n\n\tif ( peError )\n\t{\n\t\t*peError = err;\n\t}\n\n\treturn sResult;\n}\n\n\n/** Sets a string property. The new value will be returned on any subsequent call to get this property in any process. */\ninline ETrackedPropertyError CVRPropertyHelpers::SetStringProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const char *pchNewValue )\n{\n\tif ( !pchNewValue )\n\t\treturn TrackedProp_InvalidOperation;\n\n\t// this is strlen without the dependency on string.h\n\tconst char *pchCurr = pchNewValue;\n\twhile ( *pchCurr )\n\t{\n\t\tpchCurr++;\n\t}\n\n\treturn SetProperty( ulContainerHandle, prop, (void *)pchNewValue, (uint32_t)(pchCurr - pchNewValue) + 1, k_unStringPropertyTag );\n}\n\n\ntemplate<typename T>\ninline T CVRPropertyHelpers::GetPropertyHelper( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError, T bDefault, PropertyTypeTag_t unTypeTag )\n{\n\tT bValue;\n\tETrackedPropertyError eError;\n\tPropertyTypeTag_t unReadTag;\n\tGetProperty( ulContainerHandle, prop, &bValue, sizeof( bValue ), &unReadTag, &eError );\n\tif ( unReadTag != unTypeTag && eError == TrackedProp_Success )\n\t{\n\t\teError = TrackedProp_WrongDataType;\n\t};\n\n\tif ( pError )\n\t\t*pError = eError;\n\tif ( eError != TrackedProp_Success )\n\t{\n\t\treturn bDefault;\n\t}\n\telse\n\t{\n\t\treturn bValue;\n\t}\n}\n\n\ninline bool CVRPropertyHelpers::GetBoolProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\treturn GetPropertyHelper<bool>( ulContainerHandle, prop, pError, false, k_unBoolPropertyTag );\n}\n\ninline float CVRPropertyHelpers::GetFloatProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\treturn GetPropertyHelper<float>( ulContainerHandle, prop, pError, 0.f, k_unFloatPropertyTag );\n}\n\ninline double CVRPropertyHelpers::GetDoubleProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\treturn GetPropertyHelper<double>( ulContainerHandle, prop, pError, 0., k_unDoublePropertyTag );\n}\n\ninline int32_t CVRPropertyHelpers::GetInt32Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\treturn GetPropertyHelper<int32_t>( ulContainerHandle, prop, pError, 0, k_unInt32PropertyTag );\n}\n\ninline uint64_t CVRPropertyHelpers::GetUint64Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\treturn GetPropertyHelper<uint64_t>( ulContainerHandle, prop, pError, 0, k_unUint64PropertyTag );\n}\n\ninline HmdVector2_t CVRPropertyHelpers::GetVec2Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\tHmdVector2_t defaultval = { { 0, 0 } };\n\treturn GetPropertyHelper<HmdVector2_t>( ulContainerHandle, prop, pError, defaultval, k_unHmdVector2PropertyTag );\n}\n\ninline HmdVector3_t CVRPropertyHelpers::GetVec3Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\tHmdVector3_t defaultval = { { 0, 0, 0 } };\n\treturn GetPropertyHelper<HmdVector3_t>( ulContainerHandle, prop, pError, defaultval, k_unHmdVector3PropertyTag );\n}\n\ninline HmdVector4_t CVRPropertyHelpers::GetVec4Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError )\n{\n\tHmdVector4_t defaultval = { { 0, 0, 0, 0 } };\n\treturn GetPropertyHelper<HmdVector4_t>( ulContainerHandle, prop, pError, defaultval, k_unHmdVector4PropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetBoolProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, bool bNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, &bNewValue, sizeof( bNewValue ), k_unBoolPropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetFloatProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, float fNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, &fNewValue, sizeof( fNewValue ), k_unFloatPropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetDoubleProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, double fNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, &fNewValue, sizeof( fNewValue ), k_unDoublePropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetInt32Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, int32_t nNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, &nNewValue, sizeof( nNewValue ), k_unInt32PropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetUint64Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, uint64_t ulNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, &ulNewValue, sizeof( ulNewValue ), k_unUint64PropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetVec2Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector2_t & vNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, ( void * ) &vNewValue, sizeof( HmdVector2_t ), k_unHmdVector2PropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetVec3Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector3_t & vNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, ( void * ) &vNewValue, sizeof( HmdVector3_t ), k_unHmdVector3PropertyTag );\n}\n\ninline ETrackedPropertyError CVRPropertyHelpers::SetVec4Property( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, const HmdVector4_t & vNewValue )\n{\n\treturn SetProperty( ulContainerHandle, prop, ( void * ) &vNewValue, sizeof( HmdVector4_t ), k_unHmdVector4PropertyTag );\n}\n\n/** Sets the error return value for a property. This value will be returned on all subsequent requests to get the property */\ninline ETrackedPropertyError CVRPropertyHelpers::SetPropertyError( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError eError )\n{\n\tPropertyWrite_t batch;\n\tbatch.writeType = PropertyWrite_SetError;\n\tbatch.prop = prop;\n\tbatch.eSetError = eError;\n\n\tm_pProperties->WritePropertyBatch( ulContainerHandle, &batch, 1 );\n\n\treturn batch.eError;\n}\n\n/** Clears any value or error set for the property. */\ninline ETrackedPropertyError CVRPropertyHelpers::EraseProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop )\n{\n\tPropertyWrite_t batch;\n\tbatch.writeType = PropertyWrite_Erase;\n\tbatch.prop = prop;\n\n\tm_pProperties->WritePropertyBatch( ulContainerHandle, &batch, 1 );\n\n\treturn batch.eError;\n\n}\n\ntemplate< typename T >\nETrackedPropertyError CVRPropertyHelpers::SetPropertyVector(PropertyContainerHandle_t ulContainer, vr::ETrackedDeviceProperty prop, PropertyTypeTag_t unTag, std::vector<T> *pvecProperties)\n{\n\treturn SetProperty( ulContainer, prop, &(*pvecProperties)[0], (uint32_t)(pvecProperties->size() * sizeof( T )), unTag );\n}\n\ntemplate< typename T >\nETrackedPropertyError CVRPropertyHelpers::GetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector<T> *pvecResults )\n{\n\tETrackedPropertyError err;\n\tPropertyTypeTag_t unTag;\n\tuint32_t unNeeded;\n\tif ( pvecResults->empty() )\n\t\tunNeeded = GetProperty( ulContainer, prop, nullptr, 0, &unTag, &err );\n\telse\n\t\tunNeeded = GetProperty( ulContainer, prop, &(*pvecResults)[0], (uint32_t)(pvecResults->size() * sizeof( T )), &unTag, &err );\n\tuint32_t unFound = unNeeded / sizeof( T );\n\tif ( err == TrackedProp_Success )\n\t{\n\t\tif ( unTag != unExpectedTag && unFound > 0 )\n\t\t{\n\t\t\treturn TrackedProp_WrongDataType;\n\t\t}\n\n\t\tpvecResults->resize( unFound );\n\t\treturn TrackedProp_Success;\n\t}\n\telse if ( err == TrackedProp_BufferTooSmall )\n\t{\n\t\tpvecResults->resize( unFound );\n\t\tunNeeded = GetProperty( ulContainer, prop, &(*pvecResults)[0], (uint32_t)(pvecResults->size() * sizeof( T )), &unTag, &err );\n\t\tunFound = unNeeded / sizeof( T );\n\n\t\tif ( err == TrackedProp_Success )\n\t\t{\n\t\t\tif ( unTag != unExpectedTag )\n\t\t\t{\n\t\t\t\treturn TrackedProp_WrongDataType;\n\t\t\t}\n\n\t\t\tpvecResults->resize( unFound );\n\t\t\treturn TrackedProp_Success;\n\t\t}\n\t}\n\treturn err;\n}\n\ninline bool CVRPropertyHelpers::IsPropertySet( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, ETrackedPropertyError *peError )\n{\n\tETrackedPropertyError error;\n\tGetProperty( ulContainer, prop, nullptr, 0, nullptr, &error );\n\tif ( peError )\n\t\t*peError = error;\n\treturn error == TrackedProp_Success || error == TrackedProp_BufferTooSmall;\n}\n\n}\n\n\n\n// ivrdriverinput.h\n\nnamespace vr\n{\n\tenum EVRScalarType\n\t{\n\t\tVRScalarType_Absolute = 0,\n\t\tVRScalarType_Relative = 1,\n\t};\n\n\n\tenum EVRScalarUnits\n\t{\n\t\tVRScalarUnits_NormalizedOneSided = 0, // Value ranges from 0 to 1\n\t\tVRScalarUnits_NormalizedTwoSided = 1, // Value ranges from -1 to 1\n\t};\n\n\tclass IVRDriverInput\n\t{\n\tpublic:\n\n\t\t/** Creates a boolean input component for the device */\n\t\tvirtual EVRInputError CreateBooleanComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0;\n\n\t\t/** Updates a boolean component */\n\t\tvirtual EVRInputError UpdateBooleanComponent( VRInputComponentHandle_t ulComponent, bool bNewValue, double fTimeOffset ) = 0;\n\n\t\t/** Creates a scalar input component for the device */\n\t\tvirtual EVRInputError CreateScalarComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle, EVRScalarType eType, EVRScalarUnits eUnits ) = 0;\n\n\t\t/** Updates a boolean component */\n\t\tvirtual EVRInputError UpdateScalarComponent( VRInputComponentHandle_t ulComponent, float fNewValue, double fTimeOffset ) = 0;\n\n\t\t/** Creates a haptic component for the device */\n\t\tvirtual EVRInputError CreateHapticComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0;\n\n\t\t/** Creates a skeleton component. */\n\t\tvirtual EVRInputError CreateSkeletonComponent( PropertyContainerHandle_t ulContainer, const char *pchName, const char *pchSkeletonPath, const char *pchBasePosePath, EVRSkeletalTrackingLevel eSkeletalTrackingLevel, const VRBoneTransform_t *pGripLimitTransforms, uint32_t unGripLimitTransformCount, VRInputComponentHandle_t *pHandle ) = 0;\n\n\t\t/** Updates a skeleton component. */\n\t\tvirtual EVRInputError UpdateSkeletonComponent( VRInputComponentHandle_t ulComponent, EVRSkeletalMotionRange eMotionRange, const VRBoneTransform_t *pTransforms, uint32_t unTransformCount ) = 0;\n\n\t\t/** Creates a pose component */\n\t\tvirtual EVRInputError CreatePoseComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0;\n\n\t\t/** Updates a pose component. */\n\t\tvirtual EVRInputError UpdatePoseComponent( VRInputComponentHandle_t ulComponent, const HmdMatrix34_t *pMatPoseOffset, double fTimeOffset ) = 0;\n\n\t\t/** Creates an eye tracking component **/\n\t\tvirtual EVRInputError CreateEyeTrackingComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0;\n\n\t\t/** Updates an eye tracking component. */\n\t\tvirtual EVRInputError UpdateEyeTrackingComponent( VRInputComponentHandle_t ulComponent, const VREyeTrackingData_t *pEyeTrackingData, double fTimeOffset ) = 0;\n\t};\n\n\tstatic const char * const IVRDriverInput_Version = \"IVRDriverInput_004\";\n\n} // namespace vr\n\n// ivrdriverlog.h\n\nnamespace vr\n{\n\nclass IVRDriverLog\n{\npublic:\n\t/** Writes a log message to the log file prefixed with the driver name */\n\tvirtual void Log( const char *pchLogMessage ) = 0;\n};\n\n\nstatic const char *IVRDriverLog_Version = \"IVRDriverLog_001\";\n\n}\n\n// ivrserverdriverhost.h\n\nnamespace vr\n{\n\nclass ITrackedDeviceServerDriver;\nstruct TrackedDeviceDriverInfo_t;\nstruct DriverPose_t;\n\n/** This interface is provided by vrserver to allow the driver to notify\n* the system when something changes about a device. These changes must\n* not change the serial number or class of the device because those values\n* are permanently associated with the device's index. */\nclass IVRServerDriverHost\n{\npublic:\n\t/** Notifies the server that a tracked device has been added. If this function returns true\n\t* the server will call Activate on the device. If it returns false some kind of error\n\t* has occurred and the device will not be activated. */\n\tvirtual bool TrackedDeviceAdded( const char *pchDeviceSerialNumber, ETrackedDeviceClass eDeviceClass, ITrackedDeviceServerDriver *pDriver ) = 0;\n\n\t/** Notifies the server that a tracked device's pose has been updated */\n\tvirtual void TrackedDevicePoseUpdated( uint32_t unWhichDevice, const DriverPose_t & newPose, uint32_t unPoseStructSize ) = 0;\n\n\t/** Notifies the server that vsync has occurred on the the display attached to the device. This is\n\t* only permitted on devices of the HMD class. */\n\tvirtual void VsyncEvent( double vsyncTimeOffsetSeconds ) = 0;\n\n\t/** Sends a vendor specific event (VREvent_VendorSpecific_Reserved_Start..VREvent_VendorSpecific_Reserved_End */\n\tvirtual void VendorSpecificEvent( uint32_t unWhichDevice, vr::EVREventType eventType, const VREvent_Data_t & eventData, double eventTimeOffset ) = 0;\n\n\t/** Returns true if SteamVR is exiting */\n\tvirtual bool IsExiting() = 0;\n\n\t/** Returns true and fills the event with the next event on the queue if there is one. If there are no events\n\t* this method returns false. uncbVREvent should be the size in bytes of the VREvent_t struct */\n\tvirtual bool PollNextEvent( VREvent_t *pEvent, uint32_t uncbVREvent ) = 0;\n\n\t/** Provides access to device poses for drivers.  Poses are in their \"raw\" tracking space which is uniquely\n\t* defined by each driver providing poses for its devices.  It is up to clients of this function to correlate\n\t* poses across different drivers.  Poses are indexed by their device id, and their associated driver and\n\t* other properties can be looked up via IVRProperties. */\n\tvirtual void GetRawTrackedDevicePoses( float fPredictedSecondsFromNow, TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount ) = 0;\n\n\t/** Requests that SteamVR be restarted. The provided reason will be displayed to the user and should be in the current locale. */\n\tvirtual void RequestRestart( const char *pchLocalizedReason, const char *pchExecutableToStart, const char *pchArguments, const char *pchWorkingDirectory ) = 0;\n\n\t/** Interface for copying a range of timing data.  Frames are returned in ascending order (oldest to newest) with the last being the most recent frame.\n\t* Only the first entry's m_nSize needs to be set, as the rest will be inferred from that.  Returns total number of entries filled out. */\n\tvirtual uint32_t GetFrameTimings( Compositor_FrameTiming *pTiming, uint32_t nFrames ) = 0;\n\n\t/** Notifies the server that a tracked device's display component transforms have been updated.\n\t* only permitted on devices of the HMD class. */\n\tvirtual void SetDisplayEyeToHead( uint32_t unWhichDevice, const HmdMatrix34_t & eyeToHeadLeft, const HmdMatrix34_t & eyeToHeadRight ) = 0;\n\n\t/** Notifies the server that a tracked device's display projection has changed.\n\t* only permitted on devices of the HMD class. */\n\tvirtual void SetDisplayProjectionRaw( uint32_t unWhichDevice, const HmdRect2_t & eyeLeft, const HmdRect2_t & eyeRight ) = 0;\n\n\t/** Notifies the server that a tracked device's recommended render target resolution has changed.\n\t* only permitted on devices of the HMD class. */\n\tvirtual void SetRecommendedRenderTargetSize( uint32_t unWhichDevice, uint32_t nWidth, uint32_t nHeight ) = 0;\n};\n\nstatic const char *IVRServerDriverHost_Version = \"IVRServerDriverHost_006\";\n\n}\n\n// ivrcompositordriverhost.h\n\nnamespace vr\n{\n\nclass IVRCompositorDriverHost\n{\npublic:\n\t/** Returns true and fills the event with the next event on the queue if there is one. If there are no events\n\t* this method returns false. uncbVREvent should be the size in bytes of the VREvent_t struct */\n\tvirtual bool PollNextEvent( VREvent_t *pEvent, uint32_t uncbVREvent ) = 0;\n};\n\nstatic const char *IVRCompositorDriverHost_Version = \"IVRCompositorDriverHost_001\";\n\n}\n\n// ivrhiddenarea.h\n\nnamespace vr\n{\n\nclass CVRHiddenAreaHelpers\n{\npublic:\n\tCVRHiddenAreaHelpers( IVRProperties *pProperties ) : m_pProperties( pProperties ) {}\n\n\t/** Stores a hidden area mesh in a property */\n\tETrackedPropertyError SetHiddenArea( EVREye eEye, EHiddenAreaMeshType type, HmdVector2_t *pVerts, uint32_t unVertCount );\n\n\t/** retrieves a hidden area mesh from a property. Returns the vert count read out of the property.  */\n\tuint32_t GetHiddenArea( EVREye eEye, EHiddenAreaMeshType type, HmdVector2_t *pVerts, uint32_t unVertCount, ETrackedPropertyError *peError );\n\nprivate:\n\tETrackedDeviceProperty GetPropertyEnum( EVREye eEye, EHiddenAreaMeshType type )\n\t{\n\t\treturn (ETrackedDeviceProperty)(Prop_DisplayHiddenArea_Binary_Start + ((int)type * 2) + (int)eEye);\n\t}\n\n\tIVRProperties *m_pProperties;\n};\n\n\ninline ETrackedPropertyError CVRHiddenAreaHelpers::SetHiddenArea( EVREye eEye, EHiddenAreaMeshType type, HmdVector2_t *pVerts, uint32_t unVertCount )\n{\n\tETrackedDeviceProperty prop = GetPropertyEnum( eEye, type );\n\tCVRPropertyHelpers propHelpers( m_pProperties );\n\treturn propHelpers.SetProperty( propHelpers.TrackedDeviceToPropertyContainer( k_unTrackedDeviceIndex_Hmd ), prop, pVerts, sizeof( HmdVector2_t ) * unVertCount, k_unHiddenAreaPropertyTag );\n}\n\n\ninline uint32_t CVRHiddenAreaHelpers::GetHiddenArea( EVREye eEye, EHiddenAreaMeshType type, HmdVector2_t *pVerts, uint32_t unVertCount, ETrackedPropertyError *peError )\n{\n\tETrackedDeviceProperty prop = GetPropertyEnum( eEye, type );\n\tCVRPropertyHelpers propHelpers( m_pProperties );\n\tETrackedPropertyError propError;\n\tPropertyTypeTag_t unTag;\n\tuint32_t unBytesNeeded = propHelpers.GetProperty( propHelpers.TrackedDeviceToPropertyContainer( k_unTrackedDeviceIndex_Hmd ), prop, pVerts, sizeof( HmdVector2_t )*unVertCount, &unTag, &propError );\n\tif ( propError == TrackedProp_Success && unTag != k_unHiddenAreaPropertyTag )\n\t{\n\t\tpropError = TrackedProp_WrongDataType;\n\t\tunBytesNeeded = 0;\n\t}\n\n\tif ( peError )\n\t{\n\t\t*peError = propError;\n\t}\n\n\treturn unBytesNeeded / sizeof( HmdVector2_t );\n}\n\n}\n\n// ivrwatchdoghost.h\n\nnamespace vr\n{\n\n/** This interface is provided by vrclient to allow the driver to make everything wake up */\nclass IVRWatchdogHost\n{\npublic:\n\t/** Client drivers in watchdog mode should call this when they have received a signal from hardware that should\n\t* cause SteamVR to start */\n\tvirtual void WatchdogWakeUp( vr::ETrackedDeviceClass eDeviceClass ) = 0;\n};\n\nstatic const char *IVRWatchdogHost_Version = \"IVRWatchdogHost_002\";\n\n};\n\n\n\n// ivrvirtualdisplay.h\n\nnamespace vr\n{\n\tstruct PresentInfo_t\n\t{\n\t\tSharedTextureHandle_t backbufferTextureHandle;\n\t\tEVSync vsync;\n\t\tuint64_t nFrameId;\n\t\tdouble flVSyncTimeInSeconds;\n\t};\n\n\t// ----------------------------------------------------------------------------------------------\n\t// Purpose: This component is used for drivers that implement a virtual display (e.g. wireless).\n\t// ----------------------------------------------------------------------------------------------\n\tclass IVRVirtualDisplay\n\t{\n\tpublic:\n\n\t\t/** Submits final backbuffer for display. */\n\t\tvirtual void Present( const PresentInfo_t *pPresentInfo, uint32_t unPresentInfoSize ) = 0;\n\n\t\t/** Block until the last presented buffer start scanning out. */\n\t\tvirtual void WaitForPresent() = 0;\n\n\t\t/** Provides timing data for synchronizing with display. */\n\t\tvirtual bool GetTimeSinceLastVsync( float *pfSecondsSinceLastVsync, uint64_t *pulFrameCounter ) = 0;\n\t};\n\n\tstatic const char *IVRVirtualDisplay_Version = \"IVRVirtualDisplay_002\";\n}\n\n\n// ivrresources.h\n\nnamespace vr\n{\n\nclass IVRResources\n{\npublic:\n\n\t// ------------------------------------\n\t// Shared Resource Methods\n\t// ------------------------------------\n\n\t/** Loads the specified resource into the provided buffer if large enough.\n\t* Returns the size in bytes of the buffer required to hold the specified resource. */\n\tvirtual uint32_t LoadSharedResource( const char *pchResourceName, char *pchBuffer, uint32_t unBufferLen ) = 0;\n\n\t/** Provides the full path to the specified resource. Resource names can include named directories for\n\t* drivers and other things, and this resolves all of those and returns the actual physical path.\n\t* pchResourceTypeDirectory is the subdirectory of resources to look in. */\n\tvirtual uint32_t GetResourceFullPath( const char *pchResourceName, const char *pchResourceTypeDirectory, VR_OUT_STRING() char *pchPathBuffer, uint32_t unBufferLen ) = 0;\n};\n\nstatic const char * const IVRResources_Version = \"IVRResources_001\";\n\n\n}\n\n// ivriobuffer.h\n\nnamespace vr\n{\n\ntypedef uint64_t IOBufferHandle_t;\nstatic const uint64_t k_ulInvalidIOBufferHandle = 0;\n\n\tenum EIOBufferError\n\t{\n\t\tIOBuffer_Success                  = 0,\n\t\tIOBuffer_OperationFailed          = 100,\n\t\tIOBuffer_InvalidHandle            = 101,\n\t\tIOBuffer_InvalidArgument          = 102,\n\t\tIOBuffer_PathExists               = 103,\n\t\tIOBuffer_PathDoesNotExist         = 104,\n\t\tIOBuffer_Permission               = 105,\n\t};\n\n\tenum EIOBufferMode\n\t{\n\t\tIOBufferMode_Read                 = 0x0001,\n\t\tIOBufferMode_Write                = 0x0002,\n\t\tIOBufferMode_Create               = 0x0200,\n\t};\n\n\t// ----------------------------------------------------------------------------------------------\n\t// Purpose:\n\t// ----------------------------------------------------------------------------------------------\n\tclass IVRIOBuffer\n\t{\n\tpublic:\n\t\t/** opens an existing or creates a new IOBuffer of unSize bytes */\n\t\tvirtual vr::EIOBufferError Open( const char *pchPath, vr::EIOBufferMode mode, uint32_t unElementSize, uint32_t unElements, vr::IOBufferHandle_t *pulBuffer ) = 0;\n\n\t\t/** closes a previously opened or created buffer */\n\t\tvirtual vr::EIOBufferError Close( vr::IOBufferHandle_t ulBuffer ) = 0;\n\n\t\t/** reads up to unBytes from buffer into *pDst, returning number of bytes read in *punRead */\n\t\tvirtual vr::EIOBufferError Read( vr::IOBufferHandle_t ulBuffer, void *pDst, uint32_t unBytes, uint32_t *punRead ) = 0;\n\n\t\t/** writes unBytes of data from *pSrc into a buffer. */\n\t\tvirtual vr::EIOBufferError Write( vr::IOBufferHandle_t ulBuffer, void *pSrc, uint32_t unBytes ) = 0;\n\n\t\t/** retrieves the property container of an buffer. */\n\t\tvirtual vr::PropertyContainerHandle_t PropertyContainer( vr::IOBufferHandle_t ulBuffer ) = 0;\n\n\t\t/** inexpensively checks for readers to allow writers to fast-fail potentially expensive copies and writes. */\n\t\tvirtual bool HasReaders( vr::IOBufferHandle_t ulBuffer ) = 0;\n\t};\n\n\tstatic const char * const IVRIOBuffer_Version = \"IVRIOBuffer_002\";\n}\n\n// ivrdrivermanager.h\n\nnamespace vr\n{\n\nclass IVRDriverManager\n{\npublic:\n\tvirtual uint32_t GetDriverCount() const = 0;\n\n\t/** Returns the length of the number of bytes necessary to hold this string including the trailing null. */\n\tvirtual uint32_t GetDriverName( vr::DriverId_t nDriver, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0;\n\n\tvirtual DriverHandle_t GetDriverHandle( const char *pchDriverName ) = 0;\n\n\tvirtual bool IsEnabled( vr::DriverId_t nDriver ) const = 0;\n};\n\nstatic const char * const IVRDriverManager_Version = \"IVRDriverManager_001\";\n\n} // namespace vr\n\n\n\n// ivrdriverspatialanchors.h\n\nnamespace vr\n{\n\tstruct SpatialAnchorDriverPose_t\n\t{\n\t\t/** This position is in the same \"world\" space (+Y up) as provided by DriverPose_t. */\n\t\tvr::HmdQuaternion_t qWorldRotation;\n\t\tvr::HmdVector3d_t vWorldTranslation;\n\n\t\t/** The pose will automatically start returning VRSpatialAnchorError_NotAvailableInThisUniverse\n\t\t* if this is nonzero and does not match the current universe ID. */\n\t\tuint64_t ulRequiredUniverseId;\n\n\t\t/** When this time expires, SteamVR will start generating\n\t\t* VREvent_SpatialAnchors_RequestPoseUpdate when the pose is read by an application\n\t\t* to let the driver know it is still worth updating.\n\t\t* You can use this facility in several ways:\n\t\t*   1. Set to -1 to never receive an update request for this pose.  The driver\n\t\t*      may still update poses at any time.\n\t\t*   2. Set to 0 to always receive an update request *after* each time the pose\n\t\t*      is read.  The rate of requests could be very high if the application gets\n\t\t*      the pose at framerate.\n\t\t*   3. If the driver knows there is no reason to update the pose for some amount of\n\t\t*      time, it can set that time here and receive the update request reminder later.\n\t\t*   4. If the driver plans to automatically update this pose for some amount of time\n\t\t*      (as it gets better information about the virtual location of this anchor) it can\n\t\t*      set that duration here to indicate that no \"update requested\" reminders are needed.\n\t\t*      When that automatic update period expires, any future interest in the pose will\n\t\t*      be indicated by a pose update request.\n\t\t* The driver may always update the pose, including during the valid duration. */\n\t\tdouble fValidDuration;  // seconds\n\t};\n\n\tclass IVRDriverSpatialAnchors\n\t{\n\tpublic:\n\n\t\t/* NOTE: You must declare support for spatial anchors in your driver manifest.  Add\n\t\t* \"spatialAnchorsSupport\": true to your manifest.  Without that setting, SteamVR\n\t\t* will short-circuit anchor requests from applications and provide a generic descriptor\n\t\t* that does not have any of the advantages of true spatial anchors. */\n\n\t\t/* The driver should monitor for events VREvent_SpatialAnchors_RequestPoseUpdate (for new\n\t\t* descriptors from applications that need UpdateSpatialAnchorPose()) and for\n\t\t* VREvent_SpatialAnchors_RequestDescriptorUpdate (for new poses that need UpdateSpatialAnchorDescriptor()).\n\t\t* For automatic pose updates over time, the driver should keep track of the handles it\n\t\t* has seen and provide updates when conditions change.  If the driver uses fValidDuration,\n\t\t* it may wait for VREvent_SpatialAnchors_RequestPoseUpdate instead of keeping track itself. */\n\n\t\t/** Update a pose for a spatial anchor.  Should be called when an event notifies the driver that a\n\t\t* new descriptor has been registered by an application.  May be called for any anchor whenever the\n\t\t* driver has better information about the best virtual coordinate to represent the anchor.  Should\n\t\t* be called on all active handles whenever driver state changes in a way that changes how physical\n\t\t* world locations map to virtual coordinates (e.g. anything that would cause a universe ID change).\n\t\t* This fires an event when it is called for the first time (to alert whoever submitted the descriptor). */\n\t\tvirtual EVRSpatialAnchorError UpdateSpatialAnchorPose( SpatialAnchorHandle_t unHandle, const SpatialAnchorDriverPose_t *pPose ) = 0;\n\n\t\t/** Invalidate any pose associated with the handle and cause future calls to GetSpatialAnchorPose (on\n\t\t* both the client and driver side) to return the specified error.  eError must be one of\n\t\t* VRSpatialAnchorError_NotYetAvailable, VRSpatialAnchorError_NotAvailableInThisUniverse, or\n\t\t* VRSpatialAnchorError_PermanentlyUnavailable */\n\t\tvirtual EVRSpatialAnchorError SetSpatialAnchorPoseError( SpatialAnchorHandle_t unHandle, EVRSpatialAnchorError eError, double fValidDuration ) = 0;\n\n\t\t/** Update the descriptor for a spatial anchor.  Should be called when an event notifies the driver\n\t\t* that a new pose has been registered by an application.  May be called for any anchor whenever the\n\t\t* driver has better or additional information it wants to include in the anchor descriptor.  Note,\n\t\t* however, that the application may never fetch the updated anchor descriptor and may request the\n\t\t* original descriptor in a future session having ignored the update.\n\t\t* The supplied descriptor should be only the driver's opaque internal data, not the decorated form that\n\t\t* is used by clients (wrapped by runtime metadata).  The descriptor must not contain non-ASCII characters or\n\t\t* the two special characters ~ or \"\n\t\t* This fires an event every time it is called. */\n\t\tvirtual EVRSpatialAnchorError UpdateSpatialAnchorDescriptor( SpatialAnchorHandle_t unHandle, const char *pchDescriptor ) = 0;\n\n\t\t/** Get the pose for a given handle. */\n\t\tvirtual EVRSpatialAnchorError GetSpatialAnchorPose( SpatialAnchorHandle_t unHandle, SpatialAnchorDriverPose_t *pDriverPoseOut ) = 0;\n\n\t\t/** Get the descriptor for a given handle.  This will be VRSpatialAnchorError_NotYetAvailable for handles\n\t\t* where the driver has not yet built a descriptor.  It will be the application-supplied descriptor for previously\n\t\t* saved anchors that the application is requesting poses for.  If the driver has called UpdateSpatialAnchorDescriptor()\n\t\t* already in this session, it will be the descriptor provided by the driver.\n\t\t* If bDecorated, returns the descriptor wrapped with runtime metadata suitable for a client to save.  Else returns only\n\t\t* the driver's opaque internal data.\n\t\t*/\n\t\tvirtual EVRSpatialAnchorError GetSpatialAnchorDescriptor( SpatialAnchorHandle_t unHandle, VR_OUT_STRING() char *pchDescriptorOut, uint32_t *punDescriptorBufferLenInOut, bool bDecorated ) = 0;\n\n\t};\n\n\tstatic const char * const IVRDriverSpatialAnchors_Version = \"IVRDriverSpatialAnchors_001\";\n\n} // namespace vr\n\n// ivripcresourcemanagerclient.h\n\nnamespace vr\n{\n\n// -----------------------------------------------------------------------------\n// Purpose: Interact with the IPCResourceManager\n// -----------------------------------------------------------------------------\nclass IVRIPCResourceManagerClient\n{\npublic:\n\t/** Create a new tracked Vulkan Image\n\t *\n\t * nImageFormat: in VkFormat\n\t */\n\tvirtual bool NewSharedVulkanImage( uint32_t nImageFormat, uint32_t nWidth, uint32_t nHeight, bool bRenderable, bool bMappable, bool bComputeAccess, uint32_t unMipLevels, uint32_t unArrayLayerCount, vr::SharedTextureHandle_t *pSharedHandle ) = 0;\n\n\t/** Create a new tracked Vulkan Buffer */\n\tvirtual bool NewSharedVulkanBuffer( uint32_t nSize, uint32_t nUsageFlags, vr::SharedTextureHandle_t *pSharedHandle ) = 0;\n\n\t/** Create a new tracked Vulkan Semaphore */\n\tvirtual bool NewSharedVulkanSemaphore( bool bCounting, vr::SharedTextureHandle_t *pSharedHandle ) = 0;\n\n\t/** Grab a reference to hSharedHandle, and optionally generate a new IPC handle if pNewIpcHandle is not nullptr  */\n\tvirtual bool RefResource( vr::SharedTextureHandle_t hSharedHandle, uint64_t *pNewIpcHandle ) = 0;\n\n\t/** Drop a reference to hSharedHandle */\n\tvirtual bool UnrefResource( vr::SharedTextureHandle_t hSharedHandle ) = 0;\n\n\t/* Get all the DRM formats we support using DMA-BUF images for.\n\t *\n\t * pOutFormatCount and pOutFormats function like Vulkan:\n\t *   - If pOutFormats is NULL, then pOutFormatCount will be overwritten with the format count.\n\t *   - If pOutFormats is not NULL, then pOutFormatCount specifies the size of the pOutFormats array,\n\t *       and will be overwritten with the number of formats written to the array.\n\t *\n\t * If the function fails, false is returned, and pOutFormatCount will be 0.\n\t * Supported on Linux only.\n\t */\n\tvirtual bool GetDmabufFormats( uint32_t *pOutFormatCount, uint32_t *pOutFormats ) = 0;\n\n\t/** Get dmabuf modifiers we are allowed to use.\n\t *\n\t * pOutModifierCount and pOutModifiers function like Vulkan:\n\t *   - If pOutModifiers is NULL, then pOutModifierCount will be overwritten with the modifier count.\n\t *   - If pOutModifiers is not NULL, then pOutModifierCount specifies the size of the pOutModifiers array,\n\t *       and will be overwritten with the number of modifiers written to the array.\n\t *\n\t * If modifiers are not supported, a single DRM_FORMAT_MOD_INVALID entry will be returned.\n\t *\n\t * If the function fails, false is returned, and pOutModifierCount will be 0.\n\t * Supported on Linux only.\n\t */\n\tvirtual bool GetDmabufModifiers( vr::EVRApplicationType eApplicationType, uint32_t unDRMFormat, uint32_t *pOutModifierCount, uint64_t *pOutModifiers ) = 0;\n\n\t/** Import a dmabuf directly.\n\t * Note: the FD you pass in will be dup'ed, so you must close it yourself.\n\t * This function does NOT take ownership of the fd you pass in.\n\t * Supported on Linux only.\n\t */\n\tvirtual bool ImportDmabuf( vr::EVRApplicationType eApplicationType, vr::DmabufAttributes_t *pDmabufAttributes, vr::SharedTextureHandle_t *pSharedHandle ) = 0;\n\n\t/** Consumes an IPC handle (eg. from RefResource) and returns a file-descriptor.\n\t * Caller acquires ownership of fd and is responsible for closing it.\n\t * Supported on Linux only.\n\t */\n\tvirtual bool ReceiveSharedFd( uint64_t ulIpcHandle, int *pOutFd ) = 0;\n\nprotected:\n\t/** Non-deletable */\n\tvirtual ~IVRIPCResourceManagerClient() {};\n};\n\nstatic const char *IVRIPCResourceManagerClient_Version = \"IVRIPCResourceManagerClient_002\";\n\n}\n\n\n\nnamespace vr\n{\n#if !defined( OPENVR_INTERFACE_INTERNAL )\n\tstatic const char * const k_InterfaceVersions[] =\n\t{\n\t\tIVRSettings_Version,\n\t\tITrackedDeviceServerDriver_Version,\n\t\tIVRDisplayComponent_Version,\n\t\tIVRDriverDirectModeComponent_Version,\n\t\tIVRCameraComponent_Version,\n\t\tIServerTrackedDeviceProvider_Version,\n\t\tIVRWatchdogProvider_Version,\n\t\tIVRVirtualDisplay_Version,\n\t\tIVRDriverManager_Version,\n\t\tIVRResources_Version,\n\t\tIVRCompositorPluginProvider_Version,\n\t\tIVRIPCResourceManagerClient_Version,\n\t\tnullptr\n\t};\n\n\tinline IVRDriverContext *&VRDriverContext()\n\t{\n\t\tstatic IVRDriverContext *pHost;\n\t\treturn pHost;\n\t}\n\n\tclass COpenVRDriverContext\n\t{\n\tpublic:\n\t\tCOpenVRDriverContext() : m_propertyHelpers(nullptr), m_hiddenAreaHelpers(nullptr) { Clear(); }\n\t\tvoid Clear();\n\n\t\tEVRInitError InitServer();\n\t\tEVRInitError InitWatchdog();\n\t\tEVRInitError InitCompositor();\n\n\t\tIVRSettings *VRSettings()\n\t\t{\n\t\t\tif ( m_pVRSettings == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRSettings = (IVRSettings *)VRDriverContext()->GetGenericInterface( IVRSettings_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRSettings;\n\t\t}\n\n\t\tIVRProperties *VRPropertiesRaw()\n\t\t{\n\t\t\tif ( m_pVRProperties == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRProperties = (IVRProperties *)VRDriverContext()->GetGenericInterface( IVRProperties_Version, &eError );\n\t\t\t\tm_propertyHelpers = CVRPropertyHelpers( m_pVRProperties );\n\t\t\t\tm_hiddenAreaHelpers = CVRHiddenAreaHelpers( m_pVRProperties );\n\t\t\t}\n\t\t\treturn m_pVRProperties;\n\t\t}\n\n\t\tCVRPropertyHelpers *VRProperties()\n\t\t{\n\t\t\tVRPropertiesRaw();\n\t\t\treturn &m_propertyHelpers;\n\t\t}\n\n\t\tCVRHiddenAreaHelpers *VRHiddenArea()\n\t\t{\n\t\t\tVRPropertiesRaw();\n\t\t\treturn &m_hiddenAreaHelpers;\n\t\t}\n\n\t\tIVRServerDriverHost *VRServerDriverHost()\n\t\t{\n\t\t\tif ( m_pVRServerDriverHost == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRServerDriverHost = (IVRServerDriverHost *)VRDriverContext()->GetGenericInterface( IVRServerDriverHost_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRServerDriverHost;\n\t\t}\n\n\t\tIVRWatchdogHost *VRWatchdogHost()\n\t\t{\n\t\t\tif ( m_pVRWatchdogHost == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRWatchdogHost = (IVRWatchdogHost *)VRDriverContext()->GetGenericInterface( IVRWatchdogHost_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRWatchdogHost;\n\t\t}\n\n\t\tIVRCompositorDriverHost *VRCompositorDriverHost()\n\t\t{\n\t\t\tif ( m_pVRCompositorDriverHost == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRCompositorDriverHost = ( IVRCompositorDriverHost * )VRDriverContext()->GetGenericInterface( IVRCompositorDriverHost_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRCompositorDriverHost;\n\t\t}\n\n\t\tIVRDriverLog *VRDriverLog()\n\t\t{\n\t\t\tif ( m_pVRDriverLog == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRDriverLog = (IVRDriverLog *)VRDriverContext()->GetGenericInterface( IVRDriverLog_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRDriverLog;\n\t\t}\n\n\t\tDriverHandle_t VR_CALLTYPE VRDriverHandle()\n\t\t{\n\t\t\treturn VRDriverContext()->GetDriverHandle();\n\t\t}\n\n\t\tIVRDriverManager *VRDriverManager()\n\t\t{\n\t\t\tif ( !m_pVRDriverManager )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRDriverManager = (IVRDriverManager *)VRDriverContext()->GetGenericInterface( IVRDriverManager_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRDriverManager;\n\t\t}\n\n\t\tIVRResources *VRResources()\n\t\t{\n\t\t\tif ( !m_pVRResources )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRResources = (IVRResources *)VRDriverContext()->GetGenericInterface( IVRResources_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRResources;\n\t\t}\n\n\t\tIVRDriverInput *VRDriverInput()\n\t\t{\n\t\t\tif ( !m_pVRDriverInput )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRDriverInput = (IVRDriverInput *)VRDriverContext()->GetGenericInterface( IVRDriverInput_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRDriverInput;\n\t\t}\n\n\t\tIVRIOBuffer *VRIOBuffer()\n\t\t{\n\t\t\tif ( !m_pVRIOBuffer )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRIOBuffer = (IVRIOBuffer *)VRDriverContext()->GetGenericInterface( IVRIOBuffer_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRIOBuffer;\n\t\t}\n\t\t\n\t\tIVRDriverSpatialAnchors *VRDriverSpatialAnchors()\n\t\t{\n\t\t\tif ( !m_pVRDriverSpatialAnchors )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRDriverSpatialAnchors = (IVRDriverSpatialAnchors *)VRDriverContext()->GetGenericInterface( IVRDriverSpatialAnchors_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRDriverSpatialAnchors;\n\t\t}\n\n\t\tIVRIPCResourceManagerClient *VRIPCResourceManager()\n\t\t{\n\t\t\tif ( m_pVRIPCResourceManager == nullptr )\n\t\t\t{\n\t\t\t\tEVRInitError eError;\n\t\t\t\tm_pVRIPCResourceManager = ( IVRIPCResourceManagerClient * )VRDriverContext()->GetGenericInterface( IVRIPCResourceManagerClient_Version, &eError );\n\t\t\t}\n\t\t\treturn m_pVRIPCResourceManager;\n\t\t}\n\n\tprivate:\n\t\tCVRPropertyHelpers\t\tm_propertyHelpers;\n\t\tCVRHiddenAreaHelpers\tm_hiddenAreaHelpers;\n\n\t\tIVRSettings\t\t\t\t*m_pVRSettings;\n\t\tIVRProperties\t\t\t*m_pVRProperties;\n\t\tIVRServerDriverHost\t\t*m_pVRServerDriverHost;\n\t\tIVRWatchdogHost\t\t\t*m_pVRWatchdogHost;\n\t\tIVRCompositorDriverHost\t*m_pVRCompositorDriverHost;\n\t\tIVRDriverLog\t\t\t*m_pVRDriverLog;\n\t\tIVRDriverManager\t\t*m_pVRDriverManager;\n\t\tIVRResources\t\t\t*m_pVRResources;\n\t\tIVRDriverInput\t\t\t*m_pVRDriverInput;\n\t\tIVRIOBuffer\t\t\t\t*m_pVRIOBuffer;\n\t\tIVRDriverSpatialAnchors *m_pVRDriverSpatialAnchors;\n\t\tIVRIPCResourceManagerClient *m_pVRIPCResourceManager;\n\t};\n\n\tinline COpenVRDriverContext &OpenVRInternal_ModuleServerDriverContext()\n\t{\n\t\tstatic void *ctx[sizeof( COpenVRDriverContext ) / sizeof( void * )];\n\t\treturn *(COpenVRDriverContext *)ctx; // bypass zero-init constructor\n\t}\n\n\tinline IVRSettings *VR_CALLTYPE VRSettings() { return OpenVRInternal_ModuleServerDriverContext().VRSettings(); }\n\tinline IVRProperties *VR_CALLTYPE VRPropertiesRaw() { return OpenVRInternal_ModuleServerDriverContext().VRPropertiesRaw(); }\n\tinline CVRPropertyHelpers *VR_CALLTYPE VRProperties() { return OpenVRInternal_ModuleServerDriverContext().VRProperties(); }\n\tinline CVRHiddenAreaHelpers *VR_CALLTYPE VRHiddenArea() { return OpenVRInternal_ModuleServerDriverContext().VRHiddenArea(); }\n\tinline IVRDriverLog *VR_CALLTYPE VRDriverLog() { return OpenVRInternal_ModuleServerDriverContext().VRDriverLog(); }\n\tinline IVRServerDriverHost *VR_CALLTYPE VRServerDriverHost() { return OpenVRInternal_ModuleServerDriverContext().VRServerDriverHost(); }\n\tinline IVRWatchdogHost *VR_CALLTYPE VRWatchdogHost() { return OpenVRInternal_ModuleServerDriverContext().VRWatchdogHost(); }\n\tinline IVRCompositorDriverHost *VR_CALLTYPE VRCompositorDriverHost() { return OpenVRInternal_ModuleServerDriverContext().VRCompositorDriverHost(); }\n\tinline DriverHandle_t VR_CALLTYPE VRDriverHandle() { return OpenVRInternal_ModuleServerDriverContext().VRDriverHandle(); }\n\tinline IVRDriverManager *VR_CALLTYPE VRDriverManager() { return OpenVRInternal_ModuleServerDriverContext().VRDriverManager(); }\n\tinline IVRResources *VR_CALLTYPE VRResources() { return OpenVRInternal_ModuleServerDriverContext().VRResources(); }\n\tinline IVRDriverInput *VR_CALLTYPE VRDriverInput() { return OpenVRInternal_ModuleServerDriverContext().VRDriverInput(); }\n\tinline IVRIOBuffer *VR_CALLTYPE VRIOBuffer() { return OpenVRInternal_ModuleServerDriverContext().VRIOBuffer(); }\n\tinline IVRDriverSpatialAnchors *VR_CALLTYPE VRDriverSpatialAnchors() { return OpenVRInternal_ModuleServerDriverContext().VRDriverSpatialAnchors(); }\n\tinline IVRIPCResourceManagerClient *VR_CALLTYPE VRIPCResourceManager() { return OpenVRInternal_ModuleServerDriverContext().VRIPCResourceManager(); }\n\n\tinline void COpenVRDriverContext::Clear()\n\t{\n\t\tm_pVRSettings = nullptr;\n\t\tm_pVRProperties = nullptr;\n\t\tm_pVRServerDriverHost = nullptr;\n\t\tm_pVRWatchdogHost = nullptr;\n\t\tm_pVRCompositorDriverHost = nullptr;\n\t\tm_pVRDriverLog = nullptr;\n\t\tm_pVRDriverManager = nullptr;\n\t\tm_pVRResources = nullptr;\n\t\tm_pVRDriverInput = nullptr;\n\t\tm_pVRIOBuffer = nullptr;\n\t\tm_pVRDriverSpatialAnchors = nullptr;\n\t\tm_pVRIPCResourceManager = nullptr;\n\t}\n\n\tinline EVRInitError COpenVRDriverContext::InitServer()\n\t{\n\t\tClear();\n\t\t// VRIPCResourceManager initialized async.\n\t\tif ( !VRServerDriverHost()\n\t\t\t|| !VRSettings()\n\t\t\t|| !VRProperties()\n\t\t\t|| !VRDriverLog() \n\t\t\t|| !VRDriverManager()\n\t\t\t|| !VRResources() )\n\t\t\treturn VRInitError_Init_InterfaceNotFound;\n\t\treturn VRInitError_None;\n\t}\n\n\tinline EVRInitError COpenVRDriverContext::InitWatchdog()\n\t{\n\t\tClear();\n\t\tif ( !VRWatchdogHost()\n\t\t\t|| !VRSettings()\n\t\t\t|| !VRDriverLog() )\n\t\t\treturn VRInitError_Init_InterfaceNotFound;\n\t\treturn VRInitError_None;\n\t}\n\n\tinline EVRInitError COpenVRDriverContext::InitCompositor()\n\t{\n\t\tClear();\n\t\tif ( !VRCompositorDriverHost()\n\t\t\t|| !VRSettings()\n\t\t\t|| !VRProperties()\n\t\t\t|| !VRDriverLog()\n\t\t\t|| !VRDriverManager()\n\t\t\t|| !VRResources() )\n\t\t\treturn VRInitError_Init_InterfaceNotFound;\n\t\treturn VRInitError_None;\n\t}\n\n\tinline EVRInitError InitServerDriverContext( IVRDriverContext *pContext )\n\t{\n\t\tVRDriverContext() = pContext;\n\t\treturn OpenVRInternal_ModuleServerDriverContext().InitServer();\n\t}\n\n\tinline EVRInitError InitWatchdogDriverContext( IVRDriverContext *pContext )\n\t{\n\t\tVRDriverContext() = pContext;\n\t\treturn OpenVRInternal_ModuleServerDriverContext().InitWatchdog();\n\t}\n\n\tinline EVRInitError InitCompositorDriverContext( IVRDriverContext *pContext )\n\t{\n\t\tVRDriverContext() = pContext;\n\t\treturn OpenVRInternal_ModuleServerDriverContext().InitCompositor();\n\t}\n\n\tinline void CleanupDriverContext()\n\t{\n\t\tVRDriverContext() = nullptr;\n\t\tOpenVRInternal_ModuleServerDriverContext().Clear();\n\t}\n\n\t#define VR_INIT_SERVER_DRIVER_CONTEXT( pContext ) \\\n\t\t\t{ \\\n\t\t\tvr::EVRInitError eError = vr::InitServerDriverContext( pContext ); \\\n\t\t\tif( eError != vr::VRInitError_None ) \\\n\t\t\t\treturn eError; \\\n\t\t\t}\n\n\t#define VR_CLEANUP_SERVER_DRIVER_CONTEXT() \\\n\t\tvr::CleanupDriverContext();\n\n\t#define VR_INIT_WATCHDOG_DRIVER_CONTEXT( pContext ) \\\n\t\t\t{ \\\n\t\t\tvr::EVRInitError eError = vr::InitWatchdogDriverContext( pContext ); \\\n\t\t\tif( eError != vr::VRInitError_None ) \\\n\t\t\t\treturn eError; \\\n\t\t\t}\n\n\t#define VR_CLEANUP_WATCHDOG_DRIVER_CONTEXT() \\\n\t\tvr::CleanupDriverContext();\n\n#define VR_INIT_COMPOSITOR_DRIVER_CONTEXT( pContext ) \\\n\t\t\t{ \\\n\t\t\tvr::EVRInitError eError = vr::InitCompositorDriverContext( pContext ); \\\n\t\t\tif( eError != vr::VRInitError_None ) \\\n\t\t\t\treturn eError; \\\n\t\t\t}\n\n#define VR_CLEANUP_COMPOSITOR_DRIVER_CONTEXT() \\\n\t\tvr::CleanupDriverContext();\n\n\n#endif // OPENVR_INTERFACE_INTERNAL\n\n}\n// End\n\n#endif // _OPENVR_DRIVER_API\n\n\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver_ex.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"DebugCI|x64\">\n      <Configuration>DebugCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"ReleaseCI|x64\">\n      <Configuration>ReleaseCI</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{b2a22051-5e4f-4471-a6b6-73dd9be4ac49}</ProjectGuid>\n    <RootNamespace>psvr2_openvr_driver_ex</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v145</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <TargetName>driver_playstation_vr2</TargetName>\n    <IncludePath>.\\minhook\\include;.\\psvr2_openvr_driver\\openvr\\headers;$(IncludePath)</IncludePath>\n    <LibraryPath>.\\minhook\\lib\\Debug;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <TargetName>driver_playstation_vr2</TargetName>\n    <IncludePath>.\\minhook\\include;.\\psvr2_openvr_driver\\openvr\\headers;$(IncludePath)</IncludePath>\n    <LibraryPath>.\\minhook\\lib\\Debug;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <TargetName>driver_playstation_vr2</TargetName>\n    <IncludePath>.\\minhook\\include;.\\psvr2_openvr_driver\\openvr\\headers;$(IncludePath)</IncludePath>\n    <LibraryPath>.\\minhook\\lib\\Release;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <TargetName>driver_playstation_vr2</TargetName>\n    <IncludePath>.\\minhook\\include;.\\psvr2_openvr_driver\\openvr\\headers;$(IncludePath)</IncludePath>\n    <LibraryPath>.\\minhook\\lib\\Release;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;PSVR2_OPENVR_DRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalDependencies>libMinHook.x64.lib;shlwapi.lib;ws2_32.lib;winusb.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='DebugCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;PSVR2_OPENVR_DRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalDependencies>libMinHook.x64.lib;shlwapi.lib;ws2_32.lib;winusb.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;PSVR2_OPENVR_DRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalDependencies>libMinHook.x64.lib;shlwapi.lib;ws2_32.lib;winusb.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleaseCI|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;PSVR2_OPENVR_DRIVER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <LanguageStandard_C>stdc17</LanguageStandard_C>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalDependencies>libMinHook.x64.lib;shlwapi.lib;ws2_32.lib;winusb.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"caesar_manager_hooks.cpp\" />\n    <ClCompile Include=\"device_provider_proxy.cpp\" />\n    <ClCompile Include=\"driver_context_proxy.cpp\" />\n    <ClCompile Include=\"driver_host_proxy.cpp\" />\n    <ClCompile Include=\"eyelid_estimator.cpp\" />\n    <ClCompile Include=\"hmd_device_hooks.cpp\" />\n    <ClCompile Include=\"hmd_driver_factory.cpp\" />\n    <ClCompile Include=\"hmd_driver_loader.cpp\" />\n    <ClCompile Include=\"ipc_server.cpp\" />\n    <ClCompile Include=\"usb_thread_gaze.cpp\" />\n    <ClCompile Include=\"usb_thread_hooks.cpp\" />\n    <ClCompile Include=\"trigger_effect_manager.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"caesar_manager_hooks.h\" />\n    <ClInclude Include=\"config.h\" />\n    <ClInclude Include=\"device_provider_proxy.h\" />\n    <ClInclude Include=\"driver_context_proxy.h\" />\n    <ClInclude Include=\"eyelid_estimator.h\" />\n    <ClInclude Include=\"hmd2_gaze.h\" />\n    <ClInclude Include=\"hook_lib.h\" />\n    <ClInclude Include=\"driver_host_proxy.h\" />\n    <ClInclude Include=\"hmd_device_hooks.h\" />\n    <ClInclude Include=\"hmd_driver_loader.h\" />\n    <ClInclude Include=\"ipc_server.h\" />\n    <ClInclude Include=\"hmd_math.h\" />\n    <ClInclude Include=\"minhook\\include\\MinHook.h\" />\n    <ClInclude Include=\"pad_trigger_effect.h\" />\n    <ClInclude Include=\"psvr2_openvr_driver\\openvr\\headers\\openvr_driver.h\" />\n    <ClInclude Include=\"vr_settings.h\" />\n    <ClInclude Include=\"usb_thread_gaze.h\" />\n    <ClInclude Include=\"usb_thread_hooks.h\" />\n    <ClInclude Include=\"trigger_effect_manager.h\" />\n    <ClInclude Include=\"util.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\libcustomshare\\libcustomshare.vcxproj\">\n      <Project>{eabc1d23-54f9-455f-9fb4-c0a7a01ca592}</Project>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver_ex.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Core\">\n      <UniqueIdentifier>{cd7520d1-28eb-47bc-b115-3fe9e0a91416}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Core\\Loader\">\n      <UniqueIdentifier>{5996bd09-d318-485e-a7f7-1ca60cdc35f9}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Core\\Proxy\">\n      <UniqueIdentifier>{7dd0c1bc-0f75-4845-bd94-0fedcfd78142}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Additions\">\n      <UniqueIdentifier>{4a1ca7bc-0f73-4fb7-ba39-cc57e09280d9}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Additions\\Trigger Effect\">\n      <UniqueIdentifier>{0066da7e-b46e-445f-a6ce-7864d618c2b6}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Additions\\Gaze\">\n      <UniqueIdentifier>{4d5d4ddd-2603-4798-ab26-ab06d40177af}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Additions\\Hooks\">\n      <UniqueIdentifier>{523d7bdc-a142-4bff-82d8-7524395f3401}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Core\\IPC\">\n      <UniqueIdentifier>{ee097f42-b5b4-4acf-8d7e-8cc2ccd8255a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Core\\Factory\">\n      <UniqueIdentifier>{894d9cac-c755-4b87-bdff-958cd39a5f32}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Core\\Utilities\">\n      <UniqueIdentifier>{bcfee68e-1d1e-449f-a864-1ba6d8acd6c3}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Externals\">\n      <UniqueIdentifier>{66caae44-fe91-413a-82a3-22a0fb6deb30}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Externals\\MinHook\">\n      <UniqueIdentifier>{836f4d53-16b4-49c2-b44f-e8f9beff03e3}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Externals\\HMD Driver\">\n      <UniqueIdentifier>{704016a8-434b-4096-abc8-cce43bf0d21d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Externals\\HMD Driver\\OpenVR\">\n      <UniqueIdentifier>{a3caff8b-b7bf-4652-9226-44b8fde614d9}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"usb_thread_hooks.cpp\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClCompile>\n    <ClCompile Include=\"hmd_device_hooks.cpp\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClCompile>\n    <ClCompile Include=\"caesar_manager_hooks.cpp\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClCompile>\n    <ClCompile Include=\"driver_host_proxy.cpp\">\n      <Filter>Core\\Proxy</Filter>\n    </ClCompile>\n    <ClCompile Include=\"driver_context_proxy.cpp\">\n      <Filter>Core\\Proxy</Filter>\n    </ClCompile>\n    <ClCompile Include=\"device_provider_proxy.cpp\">\n      <Filter>Core\\Proxy</Filter>\n    </ClCompile>\n    <ClCompile Include=\"usb_thread_gaze.cpp\">\n      <Filter>Additions\\Gaze</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ipc_server.cpp\">\n      <Filter>Core\\IPC</Filter>\n    </ClCompile>\n    <ClCompile Include=\"trigger_effect_manager.cpp\">\n      <Filter>Additions\\Trigger Effect</Filter>\n    </ClCompile>\n    <ClCompile Include=\"eyelid_estimator.cpp\">\n      <Filter>Additions\\Gaze</Filter>\n    </ClCompile>\n    <ClCompile Include=\"hmd_driver_loader.cpp\">\n      <Filter>Core\\Loader</Filter>\n    </ClCompile>\n    <ClCompile Include=\"hmd_driver_factory.cpp\">\n      <Filter>Core\\Factory</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"caesar_manager_hooks.h\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClInclude>\n    <ClInclude Include=\"usb_thread_hooks.h\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClInclude>\n    <ClInclude Include=\"hmd_device_hooks.h\">\n      <Filter>Additions\\Hooks</Filter>\n    </ClInclude>\n    <ClInclude Include=\"driver_context_proxy.h\">\n      <Filter>Core\\Proxy</Filter>\n    </ClInclude>\n    <ClInclude Include=\"device_provider_proxy.h\">\n      <Filter>Core\\Proxy</Filter>\n    </ClInclude>\n    <ClInclude Include=\"driver_host_proxy.h\">\n      <Filter>Core\\Proxy</Filter>\n    </ClInclude>\n    <ClInclude Include=\"usb_thread_gaze.h\">\n      <Filter>Additions\\Gaze</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ipc_server.h\">\n      <Filter>Core\\IPC</Filter>\n    </ClInclude>\n    <ClInclude Include=\"trigger_effect_manager.h\">\n      <Filter>Additions\\Trigger Effect</Filter>\n    </ClInclude>\n    <ClInclude Include=\"pad_trigger_effect.h\">\n      <Filter>Additions\\Trigger Effect</Filter>\n    </ClInclude>\n    <ClInclude Include=\"hmd_math.h\">\n      <Filter>Core\\Utilities</Filter>\n    </ClInclude>\n    <ClInclude Include=\"vr_settings.h\">\n      <Filter>Core\\Utilities</Filter>\n    </ClInclude>\n    <ClInclude Include=\"util.h\">\n      <Filter>Core\\Utilities</Filter>\n    </ClInclude>\n    <ClInclude Include=\"hook_lib.h\">\n      <Filter>Core\\Utilities</Filter>\n    </ClInclude>\n    <ClInclude Include=\"hmd2_gaze.h\">\n      <Filter>Additions\\Gaze</Filter>\n    </ClInclude>\n    <ClInclude Include=\"eyelid_estimator.h\">\n      <Filter>Additions\\Gaze</Filter>\n    </ClInclude>\n    <ClInclude Include=\"hmd_driver_loader.h\">\n      <Filter>Core\\Loader</Filter>\n    </ClInclude>\n    <ClInclude Include=\"config.h\">\n      <Filter>Core</Filter>\n    </ClInclude>\n    <ClInclude Include=\"minhook\\include\\MinHook.h\">\n      <Filter>Externals\\MinHook</Filter>\n    </ClInclude>\n    <ClInclude Include=\"psvr2_openvr_driver\\openvr\\headers\\openvr_driver.h\">\n      <Filter>Externals\\HMD Driver\\OpenVR</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/trigger_effect_manager.cpp",
    "content": "#include \"trigger_effect_manager.h\"\n#include \"hmd_driver_loader.h\"\n#include \"util.h\"\n\nnamespace psvr2_toolkit {\n\n  struct AstonContext_t {\n    void* vfptr;\n    char unk1[0x28];\n    int handle; // libpad handle\n    char unk3[0xEFE8C];\n  };\n  struct AstonManager_t {\n    void *vfptr;\n    AstonContext_t *contexts[2]; // 0 = Right, 1 = Left\n    char unk2[8];\n  };\n\n  AstonManager_t *(*getAstonManager)();\n  int (*scePadSetTriggerEffect)(int handle, ScePadTriggerEffectParam *param);\n\n  TriggerEffectManager *TriggerEffectManager::m_pInstance = nullptr;\n\n  TriggerEffectManager::TriggerEffectManager()\n    : m_initialized(false)\n  {}\n\n  TriggerEffectManager *TriggerEffectManager::Instance() {\n    if (!m_pInstance) {\n      m_pInstance = new TriggerEffectManager;\n    }\n\n    return m_pInstance;\n  }\n\n  bool TriggerEffectManager::Initialized() {\n    return m_initialized;\n  }\n\n  void TriggerEffectManager::Initialize() {\n    static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n    if (m_initialized) {\n      return;\n    }\n\n    getAstonManager = decltype(getAstonManager)(pHmdDriverLoader->GetBaseAddress() + 0x1189D0);\n    scePadSetTriggerEffect = decltype(scePadSetTriggerEffect)(pHmdDriverLoader->GetBaseAddress() + 0x1BF060);\n\n    m_initialized = true;\n  }\n\n  void TriggerEffectManager::HandleIpcCommand(uint32_t processId, ipc::CommandHeader_t *pHeader, void *pData) {\n    if (!pData || !pHeader)\n      return;\n    ScePadTriggerEffectCommand command = {};\n    switch (pHeader->type) {\n      case ipc::Command_ClientTriggerEffectOff: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectOff_t)) {\n          ipc::CommandDataClientTriggerEffectOff_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectOff_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_OFF;\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectFeedback: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectFeedback_t)) {\n          ipc::CommandDataClientTriggerEffectFeedback_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectFeedback_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK;\n          command.commandData.feedbackParam.position = pRequest->position;\n          command.commandData.feedbackParam.strength = pRequest->strength;\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectWeapon: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectWeapon_t)) {\n          ipc::CommandDataClientTriggerEffectWeapon_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectWeapon_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON;\n          command.commandData.weaponParam.startPosition = pRequest->startPosition;\n          command.commandData.weaponParam.endPosition = pRequest->endPosition;\n          command.commandData.weaponParam.strength = pRequest->strength;\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectVibration: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectVibration_t)) {\n          ipc::CommandDataClientTriggerEffectVibration_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectVibration_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION;\n          command.commandData.vibrationParam.position = pRequest->position;\n          command.commandData.vibrationParam.amplitude = pRequest->amplitude;\n          command.commandData.vibrationParam.frequency = pRequest->frequency;\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectMultiplePositionFeedback: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectMultiplePositionFeedback_t)) {\n          ipc::CommandDataClientTriggerEffectMultiplePositionFeedback_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectMultiplePositionFeedback_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK;\n          for (int i = 0; i < ipc::k_unTriggerEffectControlPoint; i++) {\n            command.commandData.multiplePositionFeedbackParam.strength[i] = pRequest->strength[i];\n          }\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectSlopeFeedback: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectSlopeFeedback_t)) {\n          ipc::CommandDataClientTriggerEffectSlopeFeedback_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectSlopeFeedback_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK;\n          command.commandData.slopeFeedbackParam.startPosition = pRequest->startPosition;\n          command.commandData.slopeFeedbackParam.endPosition = pRequest->endPosition;\n          command.commandData.slopeFeedbackParam.startStrength = pRequest->startStrength;\n          command.commandData.slopeFeedbackParam.endStrength = pRequest->endStrength;\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n      case ipc::Command_ClientTriggerEffectMultiplePositionVibration: {\n        if (pHeader->dataLen == sizeof(ipc::CommandDataClientTriggerEffectMultiplePositionVibration_t)) {\n          ipc::CommandDataClientTriggerEffectMultiplePositionVibration_t *pRequest = reinterpret_cast<ipc::CommandDataClientTriggerEffectMultiplePositionVibration_t *>(pData);\n          command.mode = SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK;\n          command.commandData.multiplePositionVibrationParam.frequency = pRequest->frequency;\n          for (int i = 0; i < ipc::k_unTriggerEffectControlPoint; i++) {\n            command.commandData.multiplePositionVibrationParam.amplitude[i] = pRequest->amplitude[i];\n          }\n          SetTriggerEffectCommand(processId, pRequest->controllerType, command);\n        }\n        break;\n      }\n    }\n  }\n\n  void TriggerEffectManager::SetTriggerEffectCommand(uint32_t processId, ipc::EVRControllerType controllerType, ScePadTriggerEffectCommand command) {\n    static AstonManager_t *pAstonManager = getAstonManager();\n\n    (void)processId;\n\n    ScePadTriggerEffectParam param = {};\n    switch (controllerType) {\n      case ipc::VRController_Left: {\n        param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2;\n        param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] = command;\n        break;\n      }\n      case ipc::VRController_Right: {\n        param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2;\n        param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] = command;\n        break;\n      }\n      case ipc::VRController_Both: {\n        param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 | SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2;\n        param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] = command;\n        param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] = command;\n        break;\n      }\n    }\n\n    if (pAstonManager) {\n      if (controllerType == ipc::VRController_Left || controllerType == ipc::VRController_Both) {\n        int leftPadHandle = pAstonManager->contexts[1]->handle;\n        if (leftPadHandle > -1) {\n          scePadSetTriggerEffect(leftPadHandle, &param);\n        }\n      }\n      if (controllerType == ipc::VRController_Right || controllerType == ipc::VRController_Both) {\n        int rightPadHandle = pAstonManager->contexts[0]->handle;\n        if (rightPadHandle > -1) {\n          scePadSetTriggerEffect(rightPadHandle, &param);\n        }\n      }\n    }\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/trigger_effect_manager.h",
    "content": "#pragma once\n\n#include \"pad_trigger_effect.h\"\n#include \"../shared/ipc_protocol.h\"\n\nnamespace psvr2_toolkit {\n\n  class TriggerEffectManager {\n  public:\n    TriggerEffectManager();\n\n    static TriggerEffectManager *Instance();\n\n    bool Initialized();\n    void Initialize();\n\n    void HandleIpcCommand(uint32_t processId, ipc::CommandHeader_t *pHeader, void *pData);\n\n  private:\n    static psvr2_toolkit::TriggerEffectManager *m_pInstance;\n\n    bool m_initialized;\n\n    void SetTriggerEffectCommand(uint32_t processId, ipc::EVRControllerType controllerType, ScePadTriggerEffectCommand command);\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/usb_thread_gaze.cpp",
    "content": "#include \"usb_thread_gaze.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hmd_device_hooks.h\"\n#include \"eyelid_estimator.h\"\n#include \"hmd2_gaze.h\"\n#include \"ipc_server.h\"\n\n#include <cstdlib>\n\n#include <winusb.h>\n\n#define GAZE_MAGIC_0 0x47\n#define GAZE_MAGIC_1_CAL 0x43\n#define GAZE_MAGIC_1_RAW 0x52\n#define GAZE_MAGIC_1_STATE 0x53\n\nusing namespace psvr2_toolkit;\nusing namespace psvr2_toolkit::ipc;\n\nvoid **ppVTable = nullptr; // We need to keep track of our customized CaesarUsbThread VTable here, so we may restore it.\n\nvoid *(*Framework__Mutex__lock)(void *thisptr, uint32_t timeout) = nullptr;\nvoid *(*Framework__Mutex__unlock)(void *thisptr) = nullptr;\nvoid *(*Framework__Thread__stop)(void *thisptr) = nullptr;\n\nvoid *(*CaesarUsbThread__CaesarUsbThread)(void *thisptr) = nullptr;\nvoid *(*CaesarUsbThread__dtor_CaesarUsbThread)(void *thisptr, char a2) = nullptr;\nint (*CaesarUsbThread__read)(void *thisptr, uint8_t pipeId, char *buffer, size_t length) = nullptr;\n\nCaesarUsbThreadGaze *CaesarUsbThreadGaze::m_pInstance = nullptr;\n\npsvr2_toolkit::EyelidEstimator leftEyelidEstimator;\npsvr2_toolkit::EyelidEstimator rightEyelidEstimator;\n\nvoid *j_CaesarUsbThreadGaze__dtor_CaesarUsbThreadGaze(CaesarUsbThreadGaze *thisptr, char a2) {\n  thisptr->dtor_CaesarUsbThreadGaze();\n  void *result = CaesarUsbThread__dtor_CaesarUsbThread(thisptr, a2);\n  CaesarUsbThreadGaze::Reset();\n  return result;\n}\n\nvoid j_CaesarUsbThreadGaze__close(CaesarUsbThreadGaze *thisptr) {\n  return thisptr->close();\n}\n\nuint8_t j_CaesarUsbThreadGaze__getUsbInf(CaesarUsbThreadGaze *thisptr) {\n  return thisptr->getUsbInf();\n}\n\nuint8_t j_CaesarUsbThreadGaze__getReadPipeId(CaesarUsbThreadGaze *thisptr) {\n  return thisptr->getReadPipeId();\n}\n\nint j_CaesarUsbThreadGaze__poll(CaesarUsbThreadGaze *thisptr) {\n  return thisptr->poll();\n}\n\nvoid CaesarUsbThreadGaze::Reset() {\n  CaesarUsbThreadGaze::m_pInstance = nullptr;\n}\n\nCaesarUsbThreadGaze *CaesarUsbThreadGaze::Instance() {\n  static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n  if (!m_pInstance) {\n    m_pInstance = static_cast<CaesarUsbThreadGaze *>(malloc(sizeof(CaesarUsbThreadGaze)));\n    if (m_pInstance) {\n      Framework__Mutex__lock = decltype(Framework__Mutex__lock)(pHmdDriverLoader->GetBaseAddress() + 0x16B5F0);\n      Framework__Mutex__unlock = decltype(Framework__Mutex__unlock)(pHmdDriverLoader->GetBaseAddress() + 0x16B850);\n      Framework__Thread__stop = decltype(Framework__Thread__stop)(pHmdDriverLoader->GetBaseAddress() + 0x16B540);\n\n      CaesarUsbThread__CaesarUsbThread = decltype(CaesarUsbThread__CaesarUsbThread)(pHmdDriverLoader->GetBaseAddress() + 0x121F30);\n      CaesarUsbThread__read = decltype(CaesarUsbThread__read)(pHmdDriverLoader->GetBaseAddress() + 0x127D60);\n\n      // Initialize base class.\n      CaesarUsbThread__CaesarUsbThread(m_pInstance);\n\n      if (!ppVTable) {\n        // Runtime VTable madness!\n        // We must allocate the total size of the CaesarUsbThread VTable (9 virtual functions, multiplied by 8 to account for function pointer size).\n        // We'll then copy the VTable initialized by calling CaesarUsbThread::CaesarUsbThread into our allocated VTable.\n        // Pretty neat, right?\n        ppVTable = static_cast<void **>(malloc(0x48));\n        if (ppVTable) {\n          memcpy(ppVTable, m_pInstance->m_ppVTable, 0x48);\n\n          CaesarUsbThread__dtor_CaesarUsbThread = decltype(CaesarUsbThread__dtor_CaesarUsbThread)(ppVTable[0]); // Store the original destructor here.\n\n          ppVTable[0] = &j_CaesarUsbThreadGaze__dtor_CaesarUsbThreadGaze;\n          ppVTable[2] = &j_CaesarUsbThreadGaze__close;\n          ppVTable[4] = &j_CaesarUsbThreadGaze__getUsbInf;\n          ppVTable[5] = &j_CaesarUsbThreadGaze__getReadPipeId;\n          ppVTable[8] = &j_CaesarUsbThreadGaze__poll;\n        }\n      }\n\n      m_pInstance->m_ppVTable = ppVTable;\n    }\n  }\n\n  return m_pInstance;\n}\n\nvoid CaesarUsbThreadGaze::dtor_CaesarUsbThreadGaze() {\n  m_ppVTable = ppVTable;\n  close();\n}\n\nvoid CaesarUsbThreadGaze::close() {\n  Framework__Mutex__lock((void *)((__int64)(this) + 0x30), 0xFFFFFFFF);\n  *(char *)((__int64)(this) + 0x1E0) = 1;\n  if (*(int *)((__int64)(this) + 0x28) == 2) {\n    WinUsb_AbortPipe(*(WINUSB_INTERFACE_HANDLE *)((__int64)(this) + 0x48), 0x85);\n  }\n  Framework__Mutex__unlock((void *)((__int64)(this) + 0x30));\n  Framework__Thread__stop(this);\n}\n\nuint8_t CaesarUsbThreadGaze::getUsbInf() {\n  return 5;\n}\n\nuint8_t CaesarUsbThreadGaze::getReadPipeId() {\n  return 0x85;\n}\n\nint CaesarUsbThreadGaze::poll() {\n  static IpcServer *pIpcServer = IpcServer::Instance();\n\n  static char buffer[0x200000];\n  int result = CaesarUsbThread__read(this, 0x85, buffer, sizeof(buffer));\n  if (result < 0) {\n    return -1;\n  }\n\n  if (buffer[0] == GAZE_MAGIC_0 && buffer[1] == GAZE_MAGIC_1_STATE) {\n    Hmd2GazeState *pGazeState = reinterpret_cast<Hmd2GazeState *>(buffer);\n    HmdDeviceHooks::UpdateGaze(pGazeState, sizeof(Hmd2GazeState));\n    float leftEyelidOpenness = leftEyelidEstimator.Estimate(pGazeState->leftEye);\n    float rightEyelidOpenness = rightEyelidEstimator.Estimate(pGazeState->rightEye);\n    pIpcServer->UpdateGazeState(pGazeState, leftEyelidOpenness, rightEyelidOpenness);\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/usb_thread_gaze.h",
    "content": "#pragma once\n\n#include <cstdint>\n\nclass CaesarUsbThreadGaze {\npublic:\n  static void Reset();\n  static CaesarUsbThreadGaze *Instance();\n\n  void dtor_CaesarUsbThreadGaze();\n\n  void close();\n\n  uint8_t getUsbInf();\n  uint8_t getReadPipeId();\n\n  int poll();\n\nprivate:\n  static CaesarUsbThreadGaze *m_pInstance;\n\n  void **m_ppVTable;\n  char m_pBaseData[0x218]; // Total size (excluding VTable pointer) of CaesarUsbThread.\n};\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/usb_thread_hooks.cpp",
    "content": "#include \"usb_thread_hooks.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"vr_settings.h\"\n\nnamespace psvr2_toolkit {\n\n  int (*CaesarUsbThread__report)(void *thisptr, bool bIsSet, uint16_t reportId, void *buffer, uint16_t length, uint16_t value, uint16_t index, uint16_t subcmd);\n\n  int (*CaesarUsbThreadImuStatus__poll)(void *) = nullptr;\n  int CaesarUsbThreadImuStatus__pollHook(void *thisptr) {\n    int result = CaesarUsbThreadImuStatus__poll(thisptr);\n    CaesarUsbThread__report(thisptr, true, 12, nullptr, 0, 0, 0, 1); // Keep gaze enabled\n    return result;\n  }\n\n  void UsbThreadHooks::InstallHooks() {\n    static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();\n\n    CaesarUsbThread__report = decltype(CaesarUsbThread__report)(pHmdDriverLoader->GetBaseAddress() + 0x1283F0);\n\n    if (!VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_GAZE, SETTING_DISABLE_GAZE_DEFAULT_VALUE)) {\n      // CaesarUsbThreadImuStatus::poll\n      HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x1268D0),\n                           reinterpret_cast<void *>(CaesarUsbThreadImuStatus__pollHook),\n                           reinterpret_cast<void **>(&CaesarUsbThreadImuStatus__poll));\n    }\n  }\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/usb_thread_hooks.h",
    "content": "#pragma once\n\nnamespace psvr2_toolkit {\n\n  class UsbThreadHooks {\n  public:\n    static void InstallHooks();\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/util.h",
    "content": "#pragma once\n\n#include \"config.h\"\n\n#include <windows.h>\n#include <tlhelp32.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <openvr_driver.h>\n\n#include <format>\n#include <iostream>\n\nnamespace psvr2_toolkit {\n\n  class Util {\n  public:\n    static bool StartsWith(const char *a, const char *b) {\n      return strncmp(a, b, strlen(b)) == 0;\n    }\n\n    static bool IsRunningOnWine() {\n#if !MOCK_IS_RUNNING_ON_WINE\n      HMODULE hModule = GetModuleHandleW(L\"ntdll.dll\");\n      if (!hModule) {\n        return false;\n      }\n      return GetProcAddress(hModule, \"wine_get_version\") != nullptr;\n#else\n      return true;\n#endif\n    }\n\n    static bool IsProcessRunning(DWORD dwProcessId) {\n      HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\n      if (hSnapshot == INVALID_HANDLE_VALUE) {\n        return false;\n      }\n\n      PROCESSENTRY32W pe;\n      pe.dwSize = sizeof(pe);\n\n      if (Process32FirstW(hSnapshot, &pe)) {\n        do {\n          if (pe.th32ProcessID == dwProcessId) {\n            CloseHandle(hSnapshot);\n            return true;\n          }\n        } while (Process32NextW(hSnapshot, &pe));\n      }\n\n      CloseHandle(hSnapshot);\n      return false;\n    }\n\n    template <typename... Args>\n    static void DriverLog(const char *format, const Args&... args) {\n      std::string message = std::vformat(std::string_view(format), std::make_format_args(args...));\n      vr::VRDriverLog()->Log(message.c_str());\n    }\n\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/psvr2_openvr_driver_ex/vr_settings.h",
    "content": "#pragma once\n\n#include <openvr_driver.h>\n\n#define STEAMVR_SETTINGS_SECTION_PLAYSTATION_VR2_EX \"playstation_vr2_ex\"\n\n#define STEAMVR_SETTINGS_ENABLE_EYELID_ESTIMATION \"enableEyelidEstimation\"\n#define STEAMVR_SETTINGS_DISABLE_CHAPERONE \"disableChaperone\"\n#define STEAMVR_SETTINGS_DISABLE_SENSE \"disableSense\"\n#define STEAMVR_SETTINGS_DISABLE_GAZE \"disableGaze\"\n\n#define SETTING_ENABLE_EYELID_ESTIMATION_DEFAULT_VALUE false\n#define SETTING_DISABLE_CHAPERONE_DEFAULT_VALUE false\n#define SETTING_DISABLE_SENSE_DEFAULT_VALUE false\n#define SETTING_DISABLE_GAZE_DEFAULT_VALUE false\n\nnamespace psvr2_toolkit {\n\n  class VRSettings {\n  public:\n    static bool GetBool(const char *pchSettingsKey, bool defaultValue) {\n      vr::EVRSettingsError error;\n      bool value = vr::VRSettings()->GetBool(STEAMVR_SETTINGS_SECTION_PLAYSTATION_VR2_EX, pchSettingsKey, &error);\n      if (error != vr::EVRSettingsError::VRSettingsError_None) {\n        value = defaultValue;\n      }\n      return value;\n    }\n\n    static int GetInt32(const char *pchSettingsKey, int defaultValue) {\n      vr::EVRSettingsError error;\n      int value = vr::VRSettings()->GetInt32(STEAMVR_SETTINGS_SECTION_PLAYSTATION_VR2_EX, pchSettingsKey, &error);\n      if (error != vr::EVRSettingsError::VRSettingsError_None) {\n        value = defaultValue;\n      }\n      return value;\n    }\n\n  };\n\n} // psvr2_toolkit\n"
  },
  {
    "path": "projects/shared/ipc_protocol.h",
    "content": "#pragma once\n\n#include <cstdint>\n\n#define IPC_SERVER_PORT 3364\n\nnamespace psvr2_toolkit {\n  namespace ipc {\n\n    static constexpr uint16_t k_unIpcVersion = 3;\n    static constexpr uint32_t k_unTriggerEffectControlPoint = 10;\n\n    enum ECommandType : uint16_t {\n      Command_ClientPing, // No command data.\n      Command_ServerPong, // No command data.\n\n      Command_ClientRequestHandshake, // CommandDataClientRequestHandshake_t\n      Command_ServerHandshakeResult, // CommandDataServerHandshakeResult_t\n\n      Command_ClientRequestGazeData, // No command data.\n      Command_ServerGazeDataResult, // CommandDataServerGazeDataResult2_t (or if IPC version is 1, CommandDataServerGazeDataResult_t)\n\n      Command_ClientTriggerEffectOff, // CommandDataClientTriggerEffectOff_t\n      Command_ClientTriggerEffectFeedback, // CommandDataClientTriggerEffectFeedback_t\n      Command_ClientTriggerEffectWeapon, // CommandDataClientTriggerEffectWeapon_t\n      Command_ClientTriggerEffectVibration, // CommandDataClientTriggerEffectVibration_t\n      Command_ClientTriggerEffectMultiplePositionFeedback, // CommandDataClientTriggerEffectMultiplePositionFeedback_t\n      Command_ClientTriggerEffectSlopeFeedback, // CommandDataClientTriggerEffectSlopeFeedback_t\n      Command_ClientTriggerEffectMultiplePositionVibration, // CommandDataClientTriggerEffectMultiplePositionVibration_t\n    };\n\n    enum EHandshakeResultType : uint8_t {\n      HandshakeResult_Failed,\n      HandshakeResult_Success,\n      HandshakeResult_Outdated,\n    };\n\n    enum EVRControllerType : uint8_t {\n      VRController_Left,\n      VRController_Right,\n      VRController_Both,\n    };\n\n    struct CommandDataClientRequestHandshake_t {\n      uint16_t ipcVersion; // The IPC version this client is using.\n      uint32_t processId;\n    };\n\n    struct CommandDataServerHandshakeResult_t {\n      EHandshakeResultType result;\n      uint16_t ipcVersion; // The IPC version the server is using.\n    };\n\n    #pragma pack(push, 1)\n    // for bool marshaling; force 1 byte wide bools\n    struct GazeVector2 {\n      float x, y;\n    };\n\n    struct GazeVector3 {\n      float x, y, z;\n    };\n\n    struct GazeEyeResult {\n      bool isGazeOriginValid;\n      GazeVector3 gazeOriginMm;\n\n      bool isGazeDirValid;\n      GazeVector3 gazeDirNorm;\n\n      bool isPupilDiaValid;\n      float pupilDiaMm;\n\n      bool isBlinkValid;\n      bool blink;\n    };\n\n    struct GazeEyeResult2 {\n      bool isGazeOriginValid;\n      GazeVector3 gazeOriginMm;\n\n      bool isGazeDirValid;\n      GazeVector3 gazeDirNorm;\n\n      bool isPupilDiaValid;\n      float pupilDiaMm;\n\n      bool isBlinkValid;\n      bool blink;\n\n      bool isOpenEnabled;\n      float open;\n    };\n\n    struct GazeEyeResult3 {\n      bool isGazeOriginValid;\n      GazeVector3 gazeOriginMm;\n\n      bool isGazeDirValid;\n      GazeVector3 gazeDirNorm;\n\n      bool isPupilDiaValid;\n      float pupilDiaMm;\n\n      bool isPupilPosInSensorValid;\n      GazeVector2 pupilPosInSensor;\n\n      bool isPosGuideValid;\n      GazeVector2 posGuide;\n\n      bool isBlinkValid;\n      bool blink;\n\n      bool isOpenEnabled;\n      float open;\n    };\n\n    struct CommandDataServerGazeDataResult_t {\n      // TODO: Include timestamp, etc.\n\n      GazeEyeResult leftEye;\n      GazeEyeResult rightEye;\n    };\n\n    struct CommandDataServerGazeDataResult2_t {\n      // TODO: Include timestamp, etc.\n\n      GazeEyeResult2 leftEye;\n      GazeEyeResult2 rightEye;\n    };\n\n    struct CommandDataServerGazeDataResult3_t {\n      // TODO: Include timestamp, etc.\n\n      GazeEyeResult3 leftEye;\n      GazeEyeResult3 rightEye;\n    };\n    #pragma pack(pop)\n\n    struct CommandDataClientTriggerEffectOff_t {\n      EVRControllerType controllerType;\n    };\n\n    struct CommandDataClientTriggerEffectFeedback_t {\n      EVRControllerType controllerType;\n      uint8_t position;\n      uint8_t strength;\n    };\n\n    struct CommandDataClientTriggerEffectWeapon_t {\n      EVRControllerType controllerType;\n      uint8_t startPosition;\n      uint8_t endPosition;\n      uint8_t strength;\n    };\n\n    struct CommandDataClientTriggerEffectVibration_t {\n      EVRControllerType controllerType;\n      uint8_t position;\n      uint8_t amplitude;\n      uint8_t frequency;\n    };\n\n    struct CommandDataClientTriggerEffectMultiplePositionFeedback_t {\n      EVRControllerType controllerType;\n      uint8_t strength[k_unTriggerEffectControlPoint];\n    };\n\n    struct CommandDataClientTriggerEffectSlopeFeedback_t {\n      EVRControllerType controllerType;\n      uint8_t startPosition;\n      uint8_t endPosition;\n      uint8_t startStrength;\n      uint8_t endStrength;\n    };\n\n    struct CommandDataClientTriggerEffectMultiplePositionVibration_t {\n      EVRControllerType controllerType;\n      uint8_t frequency;\n      uint8_t amplitude[k_unTriggerEffectControlPoint];\n    };\n\n    struct CommandHeader_t {\n      ECommandType type;\n      int32_t dataLen;\n    };\n\n  } // ipc\n} // psvr2_toolkit\n"
  }
]