# colinindiedev/minecraft-2627 architecture

> Architecture diagram of the GitHub repository colinindiedev/minecraft-2627, 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/colinindiedev/minecraft-2627
- Repository: https://github.com/colinindiedev/minecraft-2627

## Overview

This is an OpenGL voxel-world renderer: the runtime opens a window, configures rendering, generates and meshes chunk terrain, and draws the scene with optional shadows, HDR, and bloom. The visible excerpts establish several setup and rendering calls plus the chunk worker flow; the README is empty, and omitted source leaves some links and detailed frame ordering unverified.

Main entry points: [`src/Chunk.cpp`](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Chunk.cpp) (Terrain and meshes), [`src/main.cpp`](https://github.com/colinindiedev/minecraft-2627/blob/main/src/main.cpp) (Application loop), [`src/Game.hpp`](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Game.hpp) (World coordination), [`src/Window.hpp`](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Window.hpp) (Window and events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and input"]
  node_main["Application loop<br/>[main.cpp]"]
  node_window["Window and events<br/>[Window.hpp]"]
  node_camera["Camera state<br/>[Camera3D.hpp]"]
end

subgraph group_world["Voxel world"]
  node_game["World coordination<br/>[Game.hpp]"]
  node_frustum["View culling<br/>[Frustum.hpp]"]
  node_chunk["Terrain and meshes<br/>[Chunk.cpp]"]
  node_blocktypes["Block definitions<br/>[BlockType.hpp]"]
end

subgraph group_render["Rendering"]
  node_blocktextures["Block materials<br/>[BlockTexture.hpp]"]
  node_cubemap["Sky cubemap<br/>[Cubemap.cpp]"]
  node_sun["Sun rendering<br/>[Sun.hpp]"]
  node_shadows["Directional shadows<br/>[Shadow.hpp]"]
  node_hdr["HDR postprocessing<br/>[HDR.hpp]"]
  node_bloom["Bloom postprocessing<br/>[Bloom.hpp]"]
end

subgraph group_support["Graphics support"]
  node_shader["Shader programs<br/>[Shader.cpp]"]
  node_glutil["GPU utilities<br/>[GLUtil.hpp]"]
  node_heaptrack["Heap tracking<br/>[HeapTrack.hpp]"]
  node_stacktracker["Stack tracking<br/>[StackTracker.hpp]"]
end

node_user(("Player"))
node_glfw["GLFW"]

node_user -->|"provides input"| node_window
node_main -->|"initializes"| node_window
node_window -->|"creates window"| node_glfw
node_game -->|"rebuilds meshes"| node_chunk
node_game -->|"uploads mesh data"| node_chunk
node_game -->|"updates movement"| node_camera
node_chunk -->|"sets block types"| node_blocktypes
node_chunk -->|"selects face textures"| node_blocktextures
node_chunk -->|"manages GPU buffers"| node_glutil
node_cubemap -->|"draws from view"| node_camera
node_main -->|"initializes shadows"| node_shadows
node_main -->|"initializes HDR"| node_hdr
node_main -->|"draws sun"| node_sun
node_bloom -->|"uses shaders"| node_shader
node_hdr -->|"uses GPU utilities"| node_glutil
node_shadows -->|"uses GPU utilities"| node_glutil

click node_main "https://github.com/colinindiedev/minecraft-2627/blob/main/src/main.cpp"
click node_window "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Window.hpp"
click node_game "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Game.hpp"
click node_camera "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Camera3D.hpp"
click node_frustum "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Frustum.hpp"
click node_chunk "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Chunk.cpp"
click node_blocktypes "https://github.com/colinindiedev/minecraft-2627/blob/main/src/BlockType.hpp"
click node_blocktextures "https://github.com/colinindiedev/minecraft-2627/blob/main/src/BlockTexture.hpp"
click node_cubemap "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Cubemap.cpp"
click node_sun "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Sun.hpp"
click node_shadows "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Shadow.hpp"
click node_hdr "https://github.com/colinindiedev/minecraft-2627/blob/main/src/HDR.hpp"
click node_bloom "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Bloom.hpp"
click node_shader "https://github.com/colinindiedev/minecraft-2627/blob/main/src/Shader.cpp"
click node_glutil "https://github.com/colinindiedev/minecraft-2627/blob/main/src/GLUtil.hpp"
click node_heaptrack "https://github.com/colinindiedev/minecraft-2627/blob/main/src/HeapTrack.hpp"
click node_stacktracker "https://github.com/colinindiedev/minecraft-2627/blob/main/src/StackTracker.hpp"

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_main,node_window,node_camera toneBlue
class node_game,node_frustum,node_chunk,node_blocktypes toneAmber
class node_blocktextures,node_cubemap,node_sun,node_shadows,node_hdr,node_bloom toneMint
class node_shader,node_glutil,node_heaptrack,node_stacktracker toneRose
class node_user,node_glfw toneIndigo
```

## Components

### Runtime and input

- [Application loop](https://github.com/colinindiedev/minecraft-2627/blob/main/src/main.cpp): `src/main.cpp`
- [Window and events](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Window.hpp): `src/Window.hpp`
- [Camera state](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Camera3D.hpp): `src/Camera3D.hpp`

### Voxel world

- [World coordination](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Game.hpp): `src/Game.hpp`
- [View culling](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Frustum.hpp): `src/Frustum.hpp`
- [Terrain and meshes](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Chunk.cpp): `src/Chunk.cpp`
- [Block definitions](https://github.com/colinindiedev/minecraft-2627/blob/main/src/BlockType.hpp): `src/BlockType.hpp`

### Rendering

- [Block materials](https://github.com/colinindiedev/minecraft-2627/blob/main/src/BlockTexture.hpp): `src/BlockTexture.hpp`
- [Sky cubemap](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Cubemap.cpp): `src/Cubemap.cpp`
- [Sun rendering](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Sun.hpp): `src/Sun.hpp`
- [Directional shadows](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Shadow.hpp): `src/Shadow.hpp`
- [HDR postprocessing](https://github.com/colinindiedev/minecraft-2627/blob/main/src/HDR.hpp): `src/HDR.hpp`
- [Bloom postprocessing](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Bloom.hpp): `src/Bloom.hpp`

### Graphics support

- [Shader programs](https://github.com/colinindiedev/minecraft-2627/blob/main/src/Shader.cpp): `src/Shader.cpp`
- [GPU utilities](https://github.com/colinindiedev/minecraft-2627/blob/main/src/GLUtil.hpp): `src/GLUtil.hpp`
- [Heap tracking](https://github.com/colinindiedev/minecraft-2627/blob/main/src/HeapTrack.hpp): `src/HeapTrack.hpp`
- [Stack tracking](https://github.com/colinindiedev/minecraft-2627/blob/main/src/StackTracker.hpp): `src/StackTracker.hpp`

### Other components

- **Player**
- **GLFW**

## Connections

- Player → Window and events: provides input (evidence: `src/Window.hpp`)
- Application loop → Window and events: initializes (evidence: `src/main.cpp`)
- Window and events → GLFW: creates window (evidence: `src/Window.hpp`)
- World coordination → Terrain and meshes: rebuilds meshes (evidence: `src/Game.hpp`)
- World coordination → Terrain and meshes: uploads mesh data (evidence: `src/Game.hpp`)
- World coordination → Camera state: updates movement (evidence: `src/Game.hpp`)
- Terrain and meshes → Block definitions: sets block types (evidence: `src/Chunk.cpp`)
- Terrain and meshes → Block materials: selects face textures (evidence: `src/Chunk.cpp`)
- Terrain and meshes → GPU utilities: manages GPU buffers (evidence: `src/Chunk.cpp`)
- Sky cubemap → Camera state: draws from view (evidence: `src/Cubemap.cpp`)
- Application loop → Directional shadows: initializes shadows (evidence: `src/main.cpp`)
- Application loop → HDR postprocessing: initializes HDR (evidence: `src/main.cpp`)
- Application loop → Sun rendering: draws sun (evidence: `src/main.cpp`)
- Bloom postprocessing → Shader programs: uses shaders (evidence: `src/Bloom.hpp`)
- HDR postprocessing → GPU utilities: uses GPU utilities (evidence: `src/HDR.hpp`)
- Directional shadows → GPU utilities: uses GPU utilities (evidence: `src/Shadow.hpp`)
