# hochgeschwindigkeitsrennfahrer/black-mesa-vr architecture

> Architecture diagram of the GitHub repository hochgeschwindigkeitsrennfahrer/black-mesa-vr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr
- Repository: https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr

## Overview

Black Mesa VR is a runtime mod for the Steam game, providing OpenXR-based stereo VR, motion controls, and VR-specific interaction and presentation. The player launches Black Mesa; the injected DLL initializes game access and VR, then supplies tracked input, rendering, and gameplay adaptations. Major README capabilities are represented by their owning source areas, although several were not sampled; their relationships are documented at the README level. The OpenXR helper and several feature implementations are unsampled, so no unsupported internal call chain is inferred.

Main entry points: [`src/vr.cpp`](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr.cpp) (VR coordinator), [`src/vr_settings_panel.cpp`](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_settings_panel.cpp) (VR settings panel), [`src/openxr_helper_bridge.cpp`](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/openxr_helper_bridge.cpp) (OpenXR bridge), [`OpenXRHelper64/openxr_helper_main.cpp`](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/OpenXRHelper64/openxr_helper_main.cpp) (OpenXR helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Runtime integration"]
  node_dll["Mod entry<br/>[dllmain.cpp]"]
  node_game["Game access<br/>[game.cpp]"]
  node_engine_sdk["Engine interfaces<br/>[sdk.h]"]
  node_offsets["Game offsets<br/>[offsets.h]"]
  node_config["VR configuration<br/>[bmvr_cvars.cpp]"]
end

subgraph group_vrcore["VR runtime and input"]
  node_vr["VR coordinator<br/>[vr.cpp]"]
  node_openxr["OpenXR bridge"]
  node_helper["OpenXR helper"]
  node_protocol["Bridge protocol"]
  node_controls["Controller bindings<br/>[vr_button_map.cpp]"]
end

subgraph group_gameplay["Gameplay interactions"]
  node_hands_weapons["Hands and weapons<br/>[vr_hands.cpp]"]
  node_bm_hands["Black Mesa hands<br/>[vr_bm_hands.cpp]"]
  node_crowbar["Crowbar swinging<br/>[vr_crowbar.cpp]"]
  node_weapon_menu["Weapon wheel<br/>[vr_weapon_menu.cpp]"]
  node_ladders["Physical ladders"]
end

subgraph group_presentation["VR presentation"]
  node_settings["VR settings panel"]
  node_controller_models["Controller models"]
  node_render_fixes["VR rendering fixes<br/>[vr_godrays.cpp]"]
  node_xen_fog["Xen fog patches"]
end

node_player(("Player"))
node_blackmesa["Black Mesa"]
node_runtime["OpenXR runtime"]

node_player -->|"launches"| node_blackmesa
node_blackmesa -->|"loads mod"| node_dll
node_dll -->|"initializes"| node_game
node_game -->|"uses interfaces"| node_engine_sdk
node_engine_sdk -->|"uses offsets"| node_offsets
node_vr -->|"uses bridge"| node_openxr
node_openxr -.->|"exchanges state"| node_helper
node_openxr -->|"encodes messages"| node_protocol
node_helper -.->|"shares contract"| node_protocol
node_runtime -.->|"provides tracking"| node_helper
node_vr -->|"uses bindings"| node_controls
node_vr -->|"supports interaction"| node_hands_weapons
node_vr -->|"supports hands"| node_bm_hands
node_vr -->|"supports swings"| node_crowbar
node_vr -->|"opens wheel"| node_weapon_menu
node_vr -->|"supports climbing"| node_ladders
node_vr -->|"renders panel"| node_settings
node_settings -->|"requests pictures"| node_controller_models
node_settings -->|"saves preferences"| node_config
node_vr -->|"provides VR effects"| node_render_fixes
node_vr -->|"patches fog"| node_xen_fog
node_controller_models -->|"uses controller data"| node_protocol
node_settings -->|"configures bindings"| node_controls

click node_dll "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/dllmain.cpp"
click node_game "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/game.cpp"
click node_engine_sdk "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/sdk/sdk.h"
click node_offsets "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/offsets.h"
click node_vr "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr.cpp"
click node_openxr "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/openxr_helper_bridge.cpp"
click node_helper "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/OpenXRHelper64/openxr_helper_main.cpp"
click node_protocol "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/openxr_bridge_protocol.h"
click node_controls "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_button_map.cpp"
click node_settings "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_settings_panel.cpp"
click node_controller_models "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_controller_models.cpp"
click node_hands_weapons "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_hands.cpp"
click node_bm_hands "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_bm_hands.cpp"
click node_crowbar "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_crowbar.cpp"
click node_weapon_menu "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_weapon_menu.cpp"
click node_ladders "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_ladder_rungs.cpp"
click node_render_fixes "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_godrays.cpp"
click node_xen_fog "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_xen_fog_patch.cpp"
click node_config "https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/bmvr_cvars.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dll,node_game,node_engine_sdk,node_offsets,node_config toneBlue
class node_vr,node_openxr,node_helper,node_protocol,node_controls toneAmber
class node_hands_weapons,node_bm_hands,node_crowbar,node_weapon_menu,node_ladders toneMint
class node_settings,node_controller_models,node_render_fixes,node_xen_fog toneRose
class node_player,node_blackmesa,node_runtime toneIndigo
```

## Components

### Runtime integration

- [Mod entry](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/dllmain.cpp): `src/dllmain.cpp`
- [Game access](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/game.cpp): `src/game.cpp`
- [Engine interfaces](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/sdk/sdk.h): `src/sdk/sdk.h`
- [Game offsets](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/offsets.h): `src/offsets.h`
- [VR configuration](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/bmvr_cvars.cpp): `src/bmvr_cvars.cpp`

### VR runtime and input

- [VR coordinator](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr.cpp): `src/vr.cpp`
- [OpenXR bridge](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/openxr_helper_bridge.cpp): `src/openxr_helper_bridge.cpp`
- [OpenXR helper](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/OpenXRHelper64/openxr_helper_main.cpp): `OpenXRHelper64/openxr_helper_main.cpp`
- [Bridge protocol](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/openxr_bridge_protocol.h): `src/openxr_bridge_protocol.h`
- [Controller bindings](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_button_map.cpp): `src/vr_button_map.cpp`

### Gameplay interactions

- [Hands and weapons](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_hands.cpp): `src/vr_hands.cpp`
- [Black Mesa hands](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_bm_hands.cpp): `src/vr_bm_hands.cpp`
- [Crowbar swinging](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_crowbar.cpp): `src/vr_crowbar.cpp`
- [Weapon wheel](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_weapon_menu.cpp): `src/vr_weapon_menu.cpp`
- [Physical ladders](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_ladder_rungs.cpp): `src/vr_ladder_rungs.cpp`

### VR presentation

- [VR settings panel](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_settings_panel.cpp): `src/vr_settings_panel.cpp`
- [Controller models](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_controller_models.cpp): `src/vr_controller_models.cpp`
- [VR rendering fixes](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_godrays.cpp): `src/vr_godrays.cpp`
- [Xen fog patches](https://github.com/hochgeschwindigkeitsrennfahrer/black-mesa-vr/blob/main/src/vr_xen_fog_patch.cpp): `src/vr_xen_fog_patch.cpp`

### Other components

- **Player**
- **Black Mesa**
- **OpenXR runtime**

## Connections

- Player → Black Mesa: launches
- Black Mesa → Mod entry: loads mod
- Mod entry → Game access: initializes (evidence: `src/dllmain.cpp`)
- Game access → Engine interfaces: uses interfaces (evidence: `src/sdk/sdk.h`)
- Engine interfaces → Game offsets: uses offsets (evidence: `src/sdk/sdk.h`)
- VR coordinator → OpenXR bridge: uses bridge
- OpenXR bridge → OpenXR helper: exchanges state
- OpenXR bridge → Bridge protocol: encodes messages
- OpenXR helper → Bridge protocol: shares contract
- OpenXR runtime → OpenXR helper: provides tracking
- VR coordinator → Controller bindings: uses bindings
- VR coordinator → Hands and weapons: supports interaction
- VR coordinator → Black Mesa hands: supports hands
- VR coordinator → Crowbar swinging: supports swings
- VR coordinator → Weapon wheel: opens wheel
- VR coordinator → Physical ladders: supports climbing
- VR coordinator → VR settings panel: renders panel (evidence: `src/vr_settings_panel.cpp`)
- VR settings panel → Controller models: requests pictures (evidence: `src/vr_settings_panel.cpp`)
- VR settings panel → VR configuration: saves preferences
- VR coordinator → VR rendering fixes: provides VR effects
- VR coordinator → Xen fog patches: patches fog
- Controller models → Bridge protocol: uses controller data (evidence: `src/vr_controller_models.cpp`)
- VR settings panel → Controller bindings: configures bindings (evidence: `src/vr_settings_panel.cpp`)
