# a7it/einsteinrosen-runner architecture

> Architecture diagram of the GitHub repository a7it/einsteinrosen-runner, 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/a7it/einsteinrosen-runner
- Repository: https://github.com/a7it/einsteinrosen-runner

## Overview

Einstein-Rosen Runner is a single-file C++17 3D space-combat game. The player starts the game, pilots through sectors, engages enemies and bosses, gathers items, and progresses through wormholes; menus and settings provide a parallel configuration workflow. The README documents rendering, input, gameplay, and persistent settings capabilities, but the excerpt does not expose most internal call paths, so those relationships are shown as unverified. The OpenGL and FreeGLUT headers are bundled dependency interfaces, not game subsystems.

Main entry points: [`EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp) (Game entry and loop), [`EinsteinRosen-Runner/include/GL/freeglut_std.h`](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_std.h) (FreeGLUT API), [`EinsteinRosen-Runner/include/GL/freeglut_ext.h`](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ext.h) (FreeGLUT extensions), [`EinsteinRosen-Runner/include/GL/freeglut_ucall.h`](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ucall.h) (FreeGLUT callbacks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_game["Game entry and loop"]
  node_input["Input handling"]
end

subgraph group_gameplay["Gameplay"]
  node_sectors["Sector generation"]
  node_flight["Ship movement"]
  node_combat["Combat and bosses"]
  node_items["Coins and power-ups"]
  node_progress["Beacons and bridges"]
  node_upgrades["Upgrades and energy"]
end

subgraph group_presentation["Presentation"]
  node_render["Scene rendering"]
  node_effects["Shaders and effects"]
  node_menus["Menus and HUD"]
end

subgraph group_configuration["Configuration"]
  node_settings["Settings"]
  node_configfile["Settings file"]
end

subgraph group_framework["Graphics Framework"]
  node_freeglut["FreeGLUT API<br/>[freeglut_std.h]"]
  node_freeglut_ext["FreeGLUT extensions<br/>[freeglut_ext.h]"]
  node_freeglut_ucall["FreeGLUT callbacks<br/>[freeglut_ucall.h]"]
  node_opengl["OpenGL and GLU<br/>[gl.h]"]
end

node_player(("Player"))

node_player -->|"starts"| node_game
node_player -->|"controls"| node_input
node_game -.->|"runs"| node_sectors
node_game -.->|"updates"| node_flight
node_game -.->|"runs"| node_combat
node_game -.->|"runs"| node_items
node_game -.->|"advances"| node_progress
node_game -.->|"runs"| node_upgrades
node_game -.->|"renders"| node_render
node_render -.->|"applies"| node_effects
node_game -.->|"displays"| node_menus
node_player -->|"configures"| node_settings
node_settings -->|"saves"| node_configfile
node_game -.->|"uses"| node_freeglut
node_game -.->|"renders with"| node_opengl
node_freeglut -->|"includes"| node_freeglut_ext
node_freeglut_ext -->|"includes"| node_freeglut_ucall

click node_game "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_input "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_sectors "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_flight "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_combat "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_items "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_progress "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_upgrades "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_render "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_effects "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_menus "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_settings "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp"
click node_freeglut "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_std.h"
click node_freeglut_ext "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ext.h"
click node_freeglut_ucall "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ucall.h"
click node_opengl "https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/gl.h"

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_game,node_input toneBlue
class node_sectors,node_flight,node_combat,node_items,node_progress,node_upgrades toneAmber
class node_render,node_effects,node_menus toneMint
class node_settings,node_configfile toneRose
class node_freeglut,node_freeglut_ext,node_freeglut_ucall,node_opengl,node_player toneIndigo
```

## Components

### Game Runtime

- [Game entry and loop](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Input handling](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`

### Gameplay

- [Sector generation](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Ship movement](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Combat and bosses](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Coins and power-ups](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Beacons and bridges](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Upgrades and energy](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`

### Presentation

- [Scene rendering](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Shaders and effects](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- [Menus and HUD](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`

### Configuration

- [Settings](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/EinsteinRosen_Runner.cpp): `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`
- **Settings file**

### Graphics Framework

- [FreeGLUT API](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_std.h): `EinsteinRosen-Runner/include/GL/freeglut_std.h`
- [FreeGLUT extensions](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ext.h): `EinsteinRosen-Runner/include/GL/freeglut_ext.h`
- [FreeGLUT callbacks](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/freeglut_ucall.h): `EinsteinRosen-Runner/include/GL/freeglut_ucall.h`
- [OpenGL and GLU](https://github.com/a7it/einsteinrosen-runner/blob/main/EinsteinRosen-Runner/include/GL/gl.h): `EinsteinRosen-Runner/include/GL/gl.h`

### Other components

- **Player**

## Connections

- Player → Game entry and loop: starts (evidence: `README.md`)
- Player → Input handling: controls (evidence: `README.md`)
- Game entry and loop → Sector generation: runs (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Ship movement: updates (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Combat and bosses: runs (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Coins and power-ups: runs (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Beacons and bridges: advances (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Upgrades and energy: runs (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Scene rendering: renders (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Scene rendering → Shaders and effects: applies (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Game entry and loop → Menus and HUD: displays (evidence: `EinsteinRosen-Runner/EinsteinRosen_Runner.cpp`)
- Player → Settings: configures (evidence: `README.md`)
- Settings → Settings file: saves (evidence: `README.md`)
- Game entry and loop → FreeGLUT API: uses
- Game entry and loop → OpenGL and GLU: renders with
- FreeGLUT API → FreeGLUT extensions: includes (evidence: `EinsteinRosen-Runner/include/GL/freeglut.h`)
- FreeGLUT extensions → FreeGLUT callbacks: includes (evidence: `EinsteinRosen-Runner/include/GL/freeglut_ext.h`)
