# dhewm/dhewm3 architecture

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

- Interactive diagram: https://gitdiagram.com/dhewm/dhewm3
- Repository: https://github.com/dhewm/dhewm3

## Overview

dhewm3 is a cross-platform Doom 3 source port. Its principal workflow is launching the engine, running game frames and game logic, and producing rendered and audio output; it also supports multiplayer, game-data declarations, and in-engine editing tools. The README documents SDL-based platform support, OpenGL, OpenAL, gamepad and widescreen support, and a settings menu. Edges are limited to relationships visible in excerpts or the source index; several runtime connections are therefore omitted rather than inferred.

Main entry points: [`neo/d3xp/Game_local.h`](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/Game_local.h) (Game runtime), [`neo/framework/DeclManager.cpp`](https://github.com/dhewm/dhewm3/blob/master/neo/framework/DeclManager.cpp) (Game declarations), [`neo/renderer/RenderWorld.h`](https://github.com/dhewm/dhewm3/blob/master/neo/renderer/RenderWorld.h) (Render world), [`neo/sound/sound.h`](https://github.com/dhewm/dhewm3/blob/master/neo/sound/sound.h) (Sound system)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform and framework"]
  node_linux["Platform entry<br/>[main.cpp]"]
  node_sys["System services<br/>[sys_local.h]"]
  node_common["Engine common<br/>[Common.h]"]
  node_cvars["Settings and CVars<br/>[CVarSystem.h]"]
  node_filesystem["File system<br/>[FileSystem.h]"]
  node_session["Session<br/>[Session.h]"]
  node_network["Network client<br/>[AsyncClient.cpp]"]
end

subgraph group_game["Game runtime"]
  node_gamecore["Game runtime<br/>[Game_local.h]"]
  node_entities["Entities and player<br/>[Entity.cpp]"]
  node_ai["AI navigation<br/>[AAS_routing.cpp]"]
  node_physics["Physics<br/>[Physics.h]"]
  node_scripts["Game scripting"]
end

subgraph group_render["Rendering and audio"]
  node_renderworld["Render world<br/>[RenderWorld.h]"]
  node_models["Model manager<br/>[ModelManager.cpp]"]
  node_materials["Materials<br/>[Material.h]"]
  node_sound["Sound system<br/>[sound.h]"]
end

subgraph group_content["Content and tools"]
  node_declarations["Game declarations<br/>[DeclManager.cpp]"]
  node_editor["Material editor"]
  node_aascompiler["Navigation compiler<br/>[AASFileManager.cpp]"]
end

node_player(("Player"))

node_player -.->|"launches"| node_linux
node_linux -->|"runs frames"| node_common
node_sys -->|"exposes service"| node_sound
node_sys -.->|"exposes service"| node_renderworld
node_common -->|"uses settings"| node_cvars
node_declarations -->|"loads content"| node_filesystem
node_declarations -->|"reads settings"| node_cvars
node_declarations -->|"registers type"| node_materials
node_declarations -->|"registers type"| node_sound
node_network -->|"changes map"| node_session
node_gamecore -->|"game interface"| node_session
node_gamecore -.->|"manages entities"| node_entities
node_gamecore -->|"uses navigation"| node_ai
node_gamecore -->|"uses physics"| node_physics
node_gamecore -->|"uses scripts"| node_scripts
node_models -->|"registers models"| node_renderworld
node_editor -.->|"edits materials"| node_materials
node_aascompiler -.->|"builds navigation data"| node_ai
node_gamecore -.->|"submits scene"| node_renderworld
node_gamecore -.->|"emits audio"| node_sound

click node_linux "https://github.com/dhewm/dhewm3/blob/master/neo/sys/linux/main.cpp"
click node_sys "https://github.com/dhewm/dhewm3/blob/master/neo/sys/sys_local.h"
click node_common "https://github.com/dhewm/dhewm3/blob/master/neo/framework/Common.h"
click node_cvars "https://github.com/dhewm/dhewm3/blob/master/neo/framework/CVarSystem.h"
click node_filesystem "https://github.com/dhewm/dhewm3/blob/master/neo/framework/FileSystem.h"
click node_session "https://github.com/dhewm/dhewm3/blob/master/neo/framework/Session.h"
click node_network "https://github.com/dhewm/dhewm3/blob/master/neo/framework/async/AsyncClient.cpp"
click node_gamecore "https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/Game_local.h"
click node_entities "https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/Entity.cpp"
click node_ai "https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/ai/AAS_routing.cpp"
click node_physics "https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/physics/Physics.h"
click node_scripts "https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/script/Script_Interpreter.cpp"
click node_declarations "https://github.com/dhewm/dhewm3/blob/master/neo/framework/DeclManager.cpp"
click node_renderworld "https://github.com/dhewm/dhewm3/blob/master/neo/renderer/RenderWorld.h"
click node_models "https://github.com/dhewm/dhewm3/blob/master/neo/renderer/ModelManager.cpp"
click node_materials "https://github.com/dhewm/dhewm3/blob/master/neo/renderer/Material.h"
click node_sound "https://github.com/dhewm/dhewm3/blob/master/neo/sound/sound.h"
click node_editor "https://github.com/dhewm/dhewm3/blob/master/neo/tools/materialeditor/MaterialDocManager.cpp"
click node_aascompiler "https://github.com/dhewm/dhewm3/blob/master/neo/tools/compilers/aas/AASFileManager.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_linux,node_sys,node_common,node_cvars,node_filesystem,node_session,node_network toneBlue
class node_gamecore,node_entities,node_ai,node_physics,node_scripts toneAmber
class node_renderworld,node_models,node_materials,node_sound toneMint
class node_declarations,node_editor,node_aascompiler toneRose
class node_player toneIndigo
```

## Components

### Platform and framework

- [Platform entry](https://github.com/dhewm/dhewm3/blob/master/neo/sys/linux/main.cpp): `neo/sys/linux/main.cpp`
- [System services](https://github.com/dhewm/dhewm3/blob/master/neo/sys/sys_local.h): `neo/sys/sys_local.h`
- [Engine common](https://github.com/dhewm/dhewm3/blob/master/neo/framework/Common.h): `neo/framework/Common.h`
- [Settings and CVars](https://github.com/dhewm/dhewm3/blob/master/neo/framework/CVarSystem.h): `neo/framework/CVarSystem.h`
- [File system](https://github.com/dhewm/dhewm3/blob/master/neo/framework/FileSystem.h): `neo/framework/FileSystem.h`
- [Session](https://github.com/dhewm/dhewm3/blob/master/neo/framework/Session.h): `neo/framework/Session.h`
- [Network client](https://github.com/dhewm/dhewm3/blob/master/neo/framework/async/AsyncClient.cpp): `neo/framework/async/AsyncClient.cpp`

### Game runtime

- [Game runtime](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/Game_local.h): `neo/d3xp/Game_local.h`
- [Entities and player](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/Entity.cpp): `neo/d3xp/Entity.cpp`
- [AI navigation](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/ai/AAS_routing.cpp): `neo/d3xp/ai/AAS_routing.cpp`
- [Physics](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/physics/Physics.h): `neo/d3xp/physics/Physics.h`
- [Game scripting](https://github.com/dhewm/dhewm3/blob/master/neo/d3xp/script/Script_Interpreter.cpp): `neo/d3xp/script/Script_Interpreter.cpp`

### Rendering and audio

- [Render world](https://github.com/dhewm/dhewm3/blob/master/neo/renderer/RenderWorld.h): `neo/renderer/RenderWorld.h`
- [Model manager](https://github.com/dhewm/dhewm3/blob/master/neo/renderer/ModelManager.cpp): `neo/renderer/ModelManager.cpp`
- [Materials](https://github.com/dhewm/dhewm3/blob/master/neo/renderer/Material.h): `neo/renderer/Material.h`
- [Sound system](https://github.com/dhewm/dhewm3/blob/master/neo/sound/sound.h): `neo/sound/sound.h`

### Content and tools

- [Game declarations](https://github.com/dhewm/dhewm3/blob/master/neo/framework/DeclManager.cpp): `neo/framework/DeclManager.cpp`
- [Material editor](https://github.com/dhewm/dhewm3/blob/master/neo/tools/materialeditor/MaterialDocManager.cpp): `neo/tools/materialeditor/MaterialDocManager.cpp`
- [Navigation compiler](https://github.com/dhewm/dhewm3/blob/master/neo/tools/compilers/aas/AASFileManager.cpp): `neo/tools/compilers/aas/AASFileManager.cpp`

### Other components

- **Player**

## Connections

- Player → Platform entry: launches
- Platform entry → Engine common: runs frames (evidence: `neo/sys/linux/main.cpp`)
- System services → Sound system: exposes service (evidence: `neo/sys/sys_local.h`)
- System services → Render world: exposes service
- Engine common → Settings and CVars: uses settings (evidence: `neo/framework/Common.h`)
- Game declarations → File system: loads content (evidence: `neo/framework/DeclManager.cpp`)
- Game declarations → Settings and CVars: reads settings (evidence: `neo/framework/DeclManager.cpp`)
- Game declarations → Materials: registers type (evidence: `neo/framework/DeclManager.cpp`)
- Game declarations → Sound system: registers type (evidence: `neo/framework/DeclManager.cpp`)
- Network client → Session: changes map (evidence: `neo/framework/async/AsyncClient.cpp`)
- Game runtime → Session: game interface (evidence: `neo/d3xp/Game_local.h`)
- Game runtime → Entities and player: manages entities
- Game runtime → AI navigation: uses navigation (evidence: `neo/d3xp/Game_local.h`)
- Game runtime → Physics: uses physics (evidence: `neo/d3xp/Game_local.h`)
- Game runtime → Game scripting: uses scripts (evidence: `neo/d3xp/Game_local.h`)
- Model manager → Render world: registers models (evidence: `neo/renderer/ModelManager.cpp`)
- Material editor → Materials: edits materials
- Navigation compiler → AI navigation: builds navigation data
- Game runtime → Render world: submits scene
- Game runtime → Sound system: emits audio
