# namgyaaal/avoxelgame architecture

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

- Interactive diagram: https://gitdiagram.com/namgyaaal/avoxelgame
- Repository: https://github.com/namgyaaal/avoxelgame

## Overview

A Voxel Game is an experimental APL voxel game with a small C/SDL extension. Its documented user flow is launching the APL entry point, starting the game, then moving and interacting in a voxel world. The tree indicates distinct player, world, menu, UI, text, and shader responsibilities; their internal call relationships cannot be verified from the supplied excerpts. README documents shader sources and bundled platform variants. The C extension excerpts show SDL event and GPU helpers; other APL and C implementation details were not sampled.

Main entry points: [`main.apls`](https://github.com/namgyaaal/avoxelgame/blob/main/main.apls) (APL Entry), [`avg/Run.aplf`](https://github.com/namgyaaal/avoxelgame/blob/main/avg/Run.aplf) (Game Runner), [`avg/player.apln`](https://github.com/namgyaaal/avoxelgame/blob/main/avg/player.apln) (Player Logic), [`avg/Create_shaders.aplf`](https://github.com/namgyaaal/avoxelgame/blob/main/avg/Create_shaders.aplf) (Shader Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["APL Entry<br/>[main.apls]"]
  node_run["Game Runner<br/>[Run.aplf]"]
end

subgraph group_game["Game State"]
  node_state["Game State<br/>[state.apln]"]
  node_player["Player Logic<br/>[player.apln]"]
  node_world["Voxel World<br/>[world.apln]"]
  node_blockdata["Block Data<br/>[block_data.apln]"]
  node_worldstate["World State<br/>[world_state.apln]"]
  node_menu["Menu State<br/>[menu_state.apln]"]
  node_worldui["World UI<br/>[world_ui.apln]"]
  node_text["Text<br/>[text.apln]"]
end

subgraph group_render["Rendering"]
  node_shadercreate["Shader Setup"]
  node_shaderassets["Shader Assets"]
end

subgraph group_extension["SDL Extension"]
  node_sdlbinding["SDL Bindings<br/>[sdl3.apln]"]
  node_events["Event Helpers<br/>[events.c]"]
  node_gpu["GPU Helpers<br/>[gpu.c]"]
  node_pipeline["Pipeline Helpers<br/>[pipeline.c]"]
  node_utils["Render Utilities<br/>[utils.c]"]
end

node_user(("Player"))
node_sdl["SDL3"]

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_run
node_run -->|"starts play"| node_state
node_user -.->|"controls"| node_player
node_player -.->|"interacts"| node_world
node_shadercreate -.->|"loads"| node_shaderassets
node_events -->|"polls events"| node_sdl
node_gpu -->|"creates GPU objects"| node_sdl
node_pipeline -->|"creates pipeline"| node_sdl
node_utils -->|"draws GPU primitives"| node_sdl

click node_entry "https://github.com/namgyaaal/avoxelgame/blob/main/main.apls"
click node_run "https://github.com/namgyaaal/avoxelgame/blob/main/avg/Run.aplf"
click node_state "https://github.com/namgyaaal/avoxelgame/blob/main/avg/state.apln"
click node_player "https://github.com/namgyaaal/avoxelgame/blob/main/avg/player.apln"
click node_world "https://github.com/namgyaaal/avoxelgame/blob/main/avg/world.apln"
click node_blockdata "https://github.com/namgyaaal/avoxelgame/blob/main/avg/block_data.apln"
click node_worldstate "https://github.com/namgyaaal/avoxelgame/blob/main/avg/world_state.apln"
click node_menu "https://github.com/namgyaaal/avoxelgame/blob/main/avg/menu_state.apln"
click node_worldui "https://github.com/namgyaaal/avoxelgame/blob/main/avg/world_ui.apln"
click node_text "https://github.com/namgyaaal/avoxelgame/blob/main/avg/text.apln"
click node_shadercreate "https://github.com/namgyaaal/avoxelgame/blob/main/avg/Create_shaders.aplf"
click node_shaderassets "https://github.com/namgyaaal/avoxelgame/tree/main/shaders/glsl"
click node_sdlbinding "https://github.com/namgyaaal/avoxelgame/blob/main/avg/sdl3.apln"
click node_events "https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/events.c"
click node_gpu "https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/gpu.c"
click node_pipeline "https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/pipeline.c"
click node_utils "https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/utils.c"

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_entry,node_run toneBlue
class node_state,node_player,node_world,node_blockdata,node_worldstate,node_menu,node_worldui,node_text toneAmber
class node_shadercreate,node_shaderassets toneMint
class node_sdlbinding,node_events,node_gpu,node_pipeline,node_utils toneRose
class node_user,node_sdl toneIndigo
```

## Components

### Application

- [APL Entry](https://github.com/namgyaaal/avoxelgame/blob/main/main.apls): `main.apls`
- [Game Runner](https://github.com/namgyaaal/avoxelgame/blob/main/avg/Run.aplf): `avg/Run.aplf`

### Game State

- [Game State](https://github.com/namgyaaal/avoxelgame/blob/main/avg/state.apln): `avg/state.apln`
- [Player Logic](https://github.com/namgyaaal/avoxelgame/blob/main/avg/player.apln): `avg/player.apln`
- [Voxel World](https://github.com/namgyaaal/avoxelgame/blob/main/avg/world.apln): `avg/world.apln`
- [Block Data](https://github.com/namgyaaal/avoxelgame/blob/main/avg/block_data.apln): `avg/block_data.apln`
- [World State](https://github.com/namgyaaal/avoxelgame/blob/main/avg/world_state.apln): `avg/world_state.apln`
- [Menu State](https://github.com/namgyaaal/avoxelgame/blob/main/avg/menu_state.apln): `avg/menu_state.apln`
- [World UI](https://github.com/namgyaaal/avoxelgame/blob/main/avg/world_ui.apln): `avg/world_ui.apln`
- [Text](https://github.com/namgyaaal/avoxelgame/blob/main/avg/text.apln): `avg/text.apln`

### Rendering

- [Shader Setup](https://github.com/namgyaaal/avoxelgame/blob/main/avg/Create_shaders.aplf): `avg/Create_shaders.aplf`
- [Shader Assets](https://github.com/namgyaaal/avoxelgame/tree/main/shaders/glsl): `shaders/glsl`

### SDL Extension

- [SDL Bindings](https://github.com/namgyaaal/avoxelgame/blob/main/avg/sdl3.apln): `avg/sdl3.apln`
- [Event Helpers](https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/events.c): `lse/src/events.c`
- [GPU Helpers](https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/gpu.c): `lse/src/gpu.c`
- [Pipeline Helpers](https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/pipeline.c): `lse/src/pipeline.c`
- [Render Utilities](https://github.com/namgyaaal/avoxelgame/blob/main/lse/src/utils.c): `lse/src/utils.c`

### Other components

- **Player**
- **SDL3**

## Connections

- Player → APL Entry: launches (evidence: `README.md`)
- APL Entry → Game Runner: starts (evidence: `README.md`)
- Game Runner → Game State: starts play (evidence: `README.md`)
- Player → Player Logic: controls
- Player Logic → Voxel World: interacts
- Shader Setup → Shader Assets: loads
- Event Helpers → SDL3: polls events (evidence: `lse/src/events.c`)
- GPU Helpers → SDL3: creates GPU objects (evidence: `lse/src/gpu.c`)
- Pipeline Helpers → SDL3: creates pipeline (evidence: `lse/src/pipeline.c`)
- Render Utilities → SDL3: draws GPU primitives (evidence: `lse/src/utils.c`)
