# jj0o0/jotacraftgl architecture

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

- Interactive diagram: https://gitdiagram.com/jj0o0/jotacraftgl
- Repository: https://github.com/jj0o0/jotacraftgl

## Overview

Jotacraft is a C++/OpenGL voxel game. A player uses first-person controls to move through a procedurally generated chunk world and break or place blocks; the engine updates world state and renders the scene and HUD. The application loop and its Window, ImGui, and Game calls are visible in source. README capabilities provide the broader domain map, but most internal wiring was not sampled, so those connections are shown as unverified rather than asserted as source-backed calls.

Main entry points: [`src/game.cpp`](https://github.com/jj0o0/jotacraftgl/blob/main/src/game.cpp) (Game Coordinator), [`src/world/world_renderer.cpp`](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world_renderer.cpp) (World Renderer), [`src/world/world.cpp`](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world.cpp) (World State), [`src/application.cpp`](https://github.com/jj0o0/jotacraftgl/blob/main/src/application.cpp) (Application Loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application Runtime"]
  node_application["Application Loop<br/>[application.cpp]"]
  node_window["Window Input<br/>[window.cpp]"]
  node_game["Game Coordinator<br/>[game.cpp]"]
  node_player["Player Physics<br/>[player.cpp]"]
end

subgraph group_world["Voxel World"]
  node_world["World State<br/>[world.cpp]"]
  node_chunk["Voxel Chunks<br/>[chunk.cpp]"]
  node_block_registry["Block Registry<br/>[block_registry.cpp]"]
  node_terrain["Terrain Noise<br/>[noise.cpp]"]
  node_interaction["Block Interaction"]
  node_lighting["Voxel Lighting<br/>[light_engine.cpp]"]
end

subgraph group_render["Rendering"]
  node_world_renderer["World Renderer<br/>[world_renderer.cpp]"]
  node_mesher["Chunk Meshing<br/>[mesher.cpp]"]
  node_graphics["Graphics Resources<br/>[mesh.cpp]"]
  node_texture["Texture Atlas<br/>[texture.cpp]"]
end

subgraph group_interface["Game Interface"]
  node_hud["Game HUD<br/>[hotbar.cpp]"]
  node_debug["Debug GUI<br/>[imgui_handler.cpp]"]
end

node_player_user(("Player"))

node_application -->|"creates"| node_window
node_application -->|"initializes"| node_debug
node_application -->|"updates and renders"| node_game
node_player_user -.->|"provides controls"| node_window
node_game -.->|"updates"| node_player
node_game -.->|"manages"| node_world
node_world -.->|"stores voxels"| node_chunk
node_chunk -.->|"generates terrain"| node_terrain
node_block_registry -.->|"defines block types"| node_chunk
node_player -.->|"targets blocks"| node_interaction
node_interaction -.->|"changes blocks"| node_world
node_world -.->|"updates lighting"| node_lighting
node_world_renderer -.->|"reads world"| node_world
node_world_renderer -.->|"requests meshes"| node_mesher
node_world_renderer -.->|"draws scene"| node_graphics
node_world_renderer -.->|"uses atlas"| node_texture
node_game -.->|"renders world"| node_world_renderer
node_game -.->|"renders HUD"| node_hud
node_game -.->|"renders diagnostics"| node_debug

click node_application "https://github.com/jj0o0/jotacraftgl/blob/main/src/application.cpp"
click node_window "https://github.com/jj0o0/jotacraftgl/blob/main/src/platform/window.cpp"
click node_game "https://github.com/jj0o0/jotacraftgl/blob/main/src/game.cpp"
click node_player "https://github.com/jj0o0/jotacraftgl/blob/main/src/player.cpp"
click node_world "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world.cpp"
click node_chunk "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/chunk.cpp"
click node_block_registry "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/block_registry.cpp"
click node_terrain "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/noise.cpp"
click node_interaction "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world_interaction.cpp"
click node_lighting "https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/light_engine.cpp"
click node_world_renderer "https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world_renderer.cpp"
click node_mesher "https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/mesher.cpp"
click node_graphics "https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/mesh.cpp"
click node_texture "https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/texture.cpp"
click node_hud "https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/hud/hotbar.cpp"
click node_debug "https://github.com/jj0o0/jotacraftgl/blob/main/src/platform/imgui_handler.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_application,node_window,node_game,node_player toneBlue
class node_world,node_chunk,node_block_registry,node_terrain,node_interaction,node_lighting toneAmber
class node_world_renderer,node_mesher,node_graphics,node_texture toneMint
class node_hud,node_debug toneRose
class node_player_user toneIndigo
```

## Components

### Application Runtime

- [Application Loop](https://github.com/jj0o0/jotacraftgl/blob/main/src/application.cpp): `src/application.cpp`
- [Window Input](https://github.com/jj0o0/jotacraftgl/blob/main/src/platform/window.cpp): `src/platform/window.cpp`
- [Game Coordinator](https://github.com/jj0o0/jotacraftgl/blob/main/src/game.cpp): `src/game.cpp`
- [Player Physics](https://github.com/jj0o0/jotacraftgl/blob/main/src/player.cpp): `src/player.cpp`

### Voxel World

- [World State](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world.cpp): `src/world/world.cpp`
- [Voxel Chunks](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/chunk.cpp): `src/world/chunk.cpp`
- [Block Registry](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/block_registry.cpp): `src/world/block_registry.cpp`
- [Terrain Noise](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/noise.cpp): `src/world/noise.cpp`
- [Block Interaction](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world_interaction.cpp): `src/world/world_interaction.cpp`
- [Voxel Lighting](https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/light_engine.cpp): `src/graphics/light_engine.cpp`

### Rendering

- [World Renderer](https://github.com/jj0o0/jotacraftgl/blob/main/src/world/world_renderer.cpp): `src/world/world_renderer.cpp`
- [Chunk Meshing](https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/mesher.cpp): `src/graphics/mesher.cpp`
- [Graphics Resources](https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/mesh.cpp): `src/graphics/mesh.cpp`
- [Texture Atlas](https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/texture.cpp): `src/graphics/texture.cpp`

### Game Interface

- [Game HUD](https://github.com/jj0o0/jotacraftgl/blob/main/src/graphics/hud/hotbar.cpp): `src/graphics/hud/hotbar.cpp`
- [Debug GUI](https://github.com/jj0o0/jotacraftgl/blob/main/src/platform/imgui_handler.cpp): `src/platform/imgui_handler.cpp`

### Other components

- **Player**

## Connections

- Application Loop → Window Input: creates (evidence: `src/application.cpp`)
- Application Loop → Debug GUI: initializes (evidence: `src/application.cpp`)
- Application Loop → Game Coordinator: updates and renders (evidence: `src/application.cpp`)
- Player → Window Input: provides controls
- Game Coordinator → Player Physics: updates
- Game Coordinator → World State: manages
- World State → Voxel Chunks: stores voxels
- Voxel Chunks → Terrain Noise: generates terrain
- Block Registry → Voxel Chunks: defines block types
- Player Physics → Block Interaction: targets blocks
- Block Interaction → World State: changes blocks
- World State → Voxel Lighting: updates lighting
- World Renderer → World State: reads world
- World Renderer → Chunk Meshing: requests meshes
- World Renderer → Graphics Resources: draws scene
- World Renderer → Texture Atlas: uses atlas
- Game Coordinator → World Renderer: renders world
- Game Coordinator → Game HUD: renders HUD
- Game Coordinator → Debug GUI: renders diagnostics
