# vn0m/vertex architecture

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

- Interactive diagram: https://gitdiagram.com/vn0m/vertex
- Repository: https://github.com/vn0m/vertex

## Overview

Vertex is a C++17/OpenGL 2D game engine, accompanied by Glade, a top-down RPG. The documented product workflow is a game using engine facilities to present a 2D world; the sampled Glade entry point was not excerpted, so its runtime calls cannot be mapped confidently. The graph preserves the engine’s rendering, tilemap, ECS, input/window, asset, particle, and physics capabilities. Edges are limited to relationships shown by excerpts, indexed references, or the README; several engine subsystems therefore remain unconnected.

Main entry points: [`vertex/src/Renderer.cpp`](https://github.com/vn0m/vertex/blob/main/vertex/src/Renderer.cpp) (Sprite renderer), [`vertex/include/vertex/CollisionMethod.h`](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/CollisionMethod.h) (Collision interface), [`vertex/src/Tilemap.cpp`](https://github.com/vn0m/vertex/blob/main/vertex/src/Tilemap.cpp) (Tilemap), [`vertex/src/physics/GridCollision.cpp`](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/GridCollision.cpp) (Grid collision)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game"]
  node_glade["Glade RPG<br/>[main.cpp]"]
end

subgraph group_runtime["Window and Input"]
  node_window["Window<br/>[Window.cpp]"]
  node_events["Input events<br/>[Events.cpp]"]
  node_keycodes["Key codes<br/>[KeyCodes.h]"]
end

subgraph group_rendering["Rendering and Assets"]
  node_renderer["Sprite renderer<br/>[Renderer.cpp]"]
  node_camera["Camera<br/>[Camera.h]"]
  node_shader["Shader<br/>[Shader.cpp]"]
  node_texture["Texture<br/>[Texture.cpp]"]
  node_assets["Asset store<br/>[AssetStore.cpp]"]
end

subgraph group_world["World and Physics"]
  node_tilemap["Tilemap<br/>[Tilemap.cpp]"]
  node_particles["Particles<br/>[Particle.cpp]"]
  node_physics["Body physics<br/>[Physics.cpp]"]
  node_collision_method["Collision interface<br/>[CollisionMethod.h]"]
  node_brute_collision["Brute-force collision"]
  node_grid_collision["Grid collision<br/>[GridCollision.cpp]"]
  node_spatial_grid["Spatial grid<br/>[SpatialGrid.cpp]"]
  node_quadtree_collision["Quadtree collision"]
  node_quadtree["Quadtree<br/>[QuadTree.cpp]"]
end

subgraph group_ecs["Entity Components"]
  node_registry["Entity registry<br/>[Registry.h]"]
  node_sparse_set["Component storage<br/>[SparseSet.h]"]
  node_components["Components<br/>[Components.h]"]
  node_entity["Entity IDs<br/>[Entity.h]"]
end

node_player(("Game player"))

node_player -->|"plays"| node_glade
node_glade -.->|"uses"| node_renderer
node_renderer -->|"creates and binds"| node_shader
node_renderer -->|"reads projection"| node_camera
node_tilemap -->|"draws sprites"| node_renderer
node_tilemap -->|"reads tileset"| node_texture
node_registry -->|"stores components"| node_sparse_set
node_registry -->|"creates and validates"| node_entity
node_events -->|"uses key codes"| node_keycodes
node_window -->|"uses key codes"| node_keycodes
node_brute_collision -->|"implements"| node_collision_method
node_grid_collision -->|"implements"| node_collision_method
node_grid_collision -->|"uses grid"| node_spatial_grid
node_quadtree_collision -->|"implements"| node_collision_method
node_quadtree_collision -->|"uses index"| node_quadtree

click node_glade "https://github.com/vn0m/vertex/blob/main/glade/src/main.cpp"
click node_window "https://github.com/vn0m/vertex/blob/main/vertex/src/Window.cpp"
click node_events "https://github.com/vn0m/vertex/blob/main/vertex/src/Events.cpp"
click node_keycodes "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/KeyCodes.h"
click node_renderer "https://github.com/vn0m/vertex/blob/main/vertex/src/Renderer.cpp"
click node_camera "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Camera.h"
click node_shader "https://github.com/vn0m/vertex/blob/main/vertex/src/Shader.cpp"
click node_texture "https://github.com/vn0m/vertex/blob/main/vertex/src/Texture.cpp"
click node_assets "https://github.com/vn0m/vertex/blob/main/vertex/src/AssetStore.cpp"
click node_tilemap "https://github.com/vn0m/vertex/blob/main/vertex/src/Tilemap.cpp"
click node_particles "https://github.com/vn0m/vertex/blob/main/vertex/src/Particle.cpp"
click node_physics "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/Physics.cpp"
click node_collision_method "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/CollisionMethod.h"
click node_brute_collision "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/BruteForceCollision.cpp"
click node_grid_collision "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/GridCollision.cpp"
click node_spatial_grid "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/SpatialGrid.cpp"
click node_quadtree_collision "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/QuadTreeCollision.cpp"
click node_quadtree "https://github.com/vn0m/vertex/blob/main/vertex/src/physics/QuadTree.cpp"
click node_registry "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Registry.h"
click node_sparse_set "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/SparseSet.h"
click node_components "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Components.h"
click node_entity "https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Entity.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_glade toneBlue
class node_window,node_events,node_keycodes toneAmber
class node_renderer,node_camera,node_shader,node_texture,node_assets toneMint
class node_tilemap,node_particles,node_physics,node_collision_method,node_brute_collision,node_grid_collision,node_spatial_grid,node_quadtree_collision,node_quadtree toneRose
class node_registry,node_sparse_set,node_components,node_entity,node_player toneIndigo
```

## Components

### Game

- [Glade RPG](https://github.com/vn0m/vertex/blob/main/glade/src/main.cpp): `glade/src/main.cpp`

### Window and Input

- [Window](https://github.com/vn0m/vertex/blob/main/vertex/src/Window.cpp): `vertex/src/Window.cpp`
- [Input events](https://github.com/vn0m/vertex/blob/main/vertex/src/Events.cpp): `vertex/src/Events.cpp`
- [Key codes](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/KeyCodes.h): `vertex/include/vertex/KeyCodes.h`

### Rendering and Assets

- [Sprite renderer](https://github.com/vn0m/vertex/blob/main/vertex/src/Renderer.cpp): `vertex/src/Renderer.cpp`
- [Camera](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Camera.h): `vertex/include/vertex/Camera.h`
- [Shader](https://github.com/vn0m/vertex/blob/main/vertex/src/Shader.cpp): `vertex/src/Shader.cpp`
- [Texture](https://github.com/vn0m/vertex/blob/main/vertex/src/Texture.cpp): `vertex/src/Texture.cpp`
- [Asset store](https://github.com/vn0m/vertex/blob/main/vertex/src/AssetStore.cpp): `vertex/src/AssetStore.cpp`

### World and Physics

- [Tilemap](https://github.com/vn0m/vertex/blob/main/vertex/src/Tilemap.cpp): `vertex/src/Tilemap.cpp`
- [Particles](https://github.com/vn0m/vertex/blob/main/vertex/src/Particle.cpp): `vertex/src/Particle.cpp`
- [Body physics](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/Physics.cpp): `vertex/src/physics/Physics.cpp`
- [Collision interface](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/CollisionMethod.h): `vertex/include/vertex/CollisionMethod.h`
- [Brute-force collision](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/BruteForceCollision.cpp): `vertex/src/physics/BruteForceCollision.cpp`
- [Grid collision](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/GridCollision.cpp): `vertex/src/physics/GridCollision.cpp`
- [Spatial grid](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/SpatialGrid.cpp): `vertex/src/physics/SpatialGrid.cpp`
- [Quadtree collision](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/QuadTreeCollision.cpp): `vertex/src/physics/QuadTreeCollision.cpp`
- [Quadtree](https://github.com/vn0m/vertex/blob/main/vertex/src/physics/QuadTree.cpp): `vertex/src/physics/QuadTree.cpp`

### Entity Components

- [Entity registry](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Registry.h): `vertex/include/vertex/Registry.h`
- [Component storage](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/SparseSet.h): `vertex/include/vertex/SparseSet.h`
- [Components](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Components.h): `vertex/include/vertex/Components.h`
- [Entity IDs](https://github.com/vn0m/vertex/blob/main/vertex/include/vertex/Entity.h): `vertex/include/vertex/Entity.h`

### Other components

- **Game player**

## Connections

- Game player → Glade RPG: plays
- Glade RPG → Sprite renderer: uses
- Sprite renderer → Shader: creates and binds (evidence: `vertex/src/Renderer.cpp`)
- Sprite renderer → Camera: reads projection (evidence: `vertex/src/Renderer.cpp`)
- Tilemap → Sprite renderer: draws sprites (evidence: `vertex/src/Tilemap.cpp`)
- Tilemap → Texture: reads tileset (evidence: `vertex/src/Tilemap.cpp`)
- Entity registry → Component storage: stores components (evidence: `vertex/include/vertex/Registry.h`)
- Entity registry → Entity IDs: creates and validates (evidence: `vertex/include/vertex/Registry.h`)
- Input events → Key codes: uses key codes
- Window → Key codes: uses key codes
- Brute-force collision → Collision interface: implements
- Grid collision → Collision interface: implements
- Grid collision → Spatial grid: uses grid
- Quadtree collision → Collision interface: implements
- Quadtree collision → Quadtree: uses index
