# timothesandt/orosmo architecture

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

- Interactive diagram: https://gitdiagram.com/timothesandt/orosmo
- Repository: https://github.com/timothesandt/orosmo

## Overview

Orosmo is a C++ game engine whose principal workflow is generating procedural terrain and viewing it through the renderer; the README identifies the terrain generator and viewer as product applications using the internal world modules. The engine also provides platform services, a graphics abstraction and OpenGL backend, rendering, and a widget UI. Its `.cui` language is compiled to C++ for that UI. Edges are limited to relationships documented in the README or visible in supplied excerpts and the source index; unsampled implementation details are not inferred.

Main entry points: [`tools/cui-rs/src/main.rs`](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/main.rs) (CUI compiler CLI), [`include/orosmo/rhi/device.hpp`](https://github.com/timothesandt/orosmo/blob/main/include/orosmo/rhi/device.hpp) (Graphics device API), [`apps/terrain_viewer/src/viewer.cpp`](https://github.com/timothesandt/orosmo/blob/main/apps/terrain_viewer/src/viewer.cpp) (Terrain viewer), [`src/world/terrain.cpp`](https://github.com/timothesandt/orosmo/blob/main/src/world/terrain.cpp) (Terrain data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Terrain applications"]
  node_terrain_gen["Terrain generator<br/>[main.cpp]"]
  node_terrain_viewer["Terrain viewer<br/>[viewer.cpp]"]
end

subgraph group_world["Procedural world"]
  node_world_terrain["Terrain data<br/>[terrain.cpp]"]
  node_world_noise["Procedural noise<br/>[noise.cpp]"]
  node_world_gpu_noise["GPU noise<br/>[gpu_noise.cpp]"]
  node_world_lod["Terrain LOD<br/>[lod.cpp]"]
  node_world_streaming["World streaming<br/>[streaming.cpp]"]
  node_world_export["World export<br/>[export.cpp]"]
end

subgraph group_graphics["Graphics engine"]
  node_platform["Window and input<br/>[window.cpp]"]
  node_rhi["Graphics device API<br/>[device.hpp]"]
  node_gl_backend["OpenGL backend<br/>[gl_device.cpp]"]
  node_shader_compiler["Shader compiler"]
  node_shader_library["Shader library<br/>[shader_library.cpp]"]
  node_pipeline_cache[("Pipeline cache<br/>[pipeline_cache.cpp]")]
  node_renderer["Scene rendering<br/>[scene_renderer.cpp]"]
  node_terrain_renderer["Terrain rendering"]
end

subgraph group_ui["User interface"]
  node_ui["Widget UI runtime<br/>[ui.cpp]"]
  node_text_renderer["UI text rendering<br/>[text_renderer.cpp]"]
end

subgraph group_language["CUI compiler"]
  node_cui_cli["CUI compiler CLI<br/>[main.rs]"]
  node_cui_lexer["Lexer<br/>[lexer.rs]"]
  node_cui_parser["Parser<br/>[parser.rs]"]
  node_cui_ast["Syntax tree<br/>[ast.rs]"]
  node_cui_engine["C++ generator<br/>[engine.rs]"]
  node_cui_json["JSON diagnostics<br/>[json.rs]"]
end

node_user(("Engine user"))

node_user -->|"generates terrain"| node_terrain_gen
node_user -->|"views terrain"| node_terrain_viewer
node_terrain_gen -->|"uses world module"| node_world_terrain
node_terrain_viewer -->|"uses world module"| node_world_terrain
node_world_gpu_noise -->|"uses terrain API"| node_world_terrain
node_world_export -->|"exports terrain"| node_world_terrain
node_terrain_viewer -->|"opens window"| node_platform
node_terrain_viewer -.->|"renders terrain"| node_terrain_renderer
node_terrain_renderer -.->|"draws scene"| node_renderer
node_renderer -.->|"submits graphics"| node_rhi
node_gl_backend -->|"implements API"| node_rhi
node_shader_compiler -->|"compiles shaders"| node_rhi
node_shader_library -->|"creates shader programs"| node_rhi
node_shader_library -->|"uses compiler"| node_shader_compiler
node_pipeline_cache -->|"creates pipelines"| node_rhi
node_pipeline_cache -->|"caches program pipelines"| node_shader_library
node_ui -.->|"renders text"| node_text_renderer
node_cui_cli -->|"tokenizes input"| node_cui_lexer
node_cui_cli -->|"parses input"| node_cui_parser
node_cui_cli -->|"generates C++"| node_cui_engine
node_cui_cli -->|"formats diagnostics"| node_cui_json
node_cui_parser -->|"consumes tokens"| node_cui_lexer
node_cui_parser -->|"builds syntax tree"| node_cui_ast
node_cui_engine -->|"generates from AST"| node_cui_ast
node_cui_cli -->|"targets UI runtime"| node_ui

click node_terrain_gen "https://github.com/timothesandt/orosmo/blob/main/apps/terrain_gen/main.cpp"
click node_terrain_viewer "https://github.com/timothesandt/orosmo/blob/main/apps/terrain_viewer/src/viewer.cpp"
click node_world_terrain "https://github.com/timothesandt/orosmo/blob/main/src/world/terrain.cpp"
click node_world_noise "https://github.com/timothesandt/orosmo/blob/main/src/world/noise.cpp"
click node_world_gpu_noise "https://github.com/timothesandt/orosmo/blob/main/src/world/gpu/gpu_noise.cpp"
click node_world_lod "https://github.com/timothesandt/orosmo/blob/main/src/world/lod.cpp"
click node_world_streaming "https://github.com/timothesandt/orosmo/blob/main/src/world/streaming.cpp"
click node_world_export "https://github.com/timothesandt/orosmo/blob/main/src/world/export.cpp"
click node_platform "https://github.com/timothesandt/orosmo/blob/main/src/platform/window.cpp"
click node_rhi "https://github.com/timothesandt/orosmo/blob/main/include/orosmo/rhi/device.hpp"
click node_gl_backend "https://github.com/timothesandt/orosmo/blob/main/src/rhi/opengl/gl_device.cpp"
click node_shader_compiler "https://github.com/timothesandt/orosmo/blob/main/src/rhi/shader_compiler.cpp"
click node_shader_library "https://github.com/timothesandt/orosmo/blob/main/src/renderer/shader_library.cpp"
click node_pipeline_cache "https://github.com/timothesandt/orosmo/blob/main/src/renderer/pipeline_cache.cpp"
click node_renderer "https://github.com/timothesandt/orosmo/blob/main/src/renderer/scene_renderer.cpp"
click node_terrain_renderer "https://github.com/timothesandt/orosmo/blob/main/src/renderer/terrain_renderer.cpp"
click node_ui "https://github.com/timothesandt/orosmo/blob/main/src/ui/ui.cpp"
click node_text_renderer "https://github.com/timothesandt/orosmo/blob/main/src/ui/text_renderer.cpp"
click node_cui_cli "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/main.rs"
click node_cui_lexer "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/lexer.rs"
click node_cui_parser "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/parser.rs"
click node_cui_ast "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/ast.rs"
click node_cui_engine "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/engine.rs"
click node_cui_json "https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/json.rs"

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_terrain_gen,node_terrain_viewer,node_user toneBlue
class node_world_terrain,node_world_noise,node_world_gpu_noise,node_world_lod,node_world_streaming,node_world_export toneAmber
class node_platform,node_rhi,node_gl_backend,node_shader_compiler,node_shader_library,node_pipeline_cache,node_renderer,node_terrain_renderer toneMint
class node_ui,node_text_renderer toneRose
class node_cui_cli,node_cui_lexer,node_cui_parser,node_cui_ast,node_cui_engine,node_cui_json toneIndigo
```

## Components

### Terrain applications

- [Terrain generator](https://github.com/timothesandt/orosmo/blob/main/apps/terrain_gen/main.cpp): `apps/terrain_gen/main.cpp`
- [Terrain viewer](https://github.com/timothesandt/orosmo/blob/main/apps/terrain_viewer/src/viewer.cpp): `apps/terrain_viewer/src/viewer.cpp`

### Procedural world

- [Terrain data](https://github.com/timothesandt/orosmo/blob/main/src/world/terrain.cpp): `src/world/terrain.cpp`
- [Procedural noise](https://github.com/timothesandt/orosmo/blob/main/src/world/noise.cpp): `src/world/noise.cpp`
- [GPU noise](https://github.com/timothesandt/orosmo/blob/main/src/world/gpu/gpu_noise.cpp): `src/world/gpu/gpu_noise.cpp`
- [Terrain LOD](https://github.com/timothesandt/orosmo/blob/main/src/world/lod.cpp): `src/world/lod.cpp`
- [World streaming](https://github.com/timothesandt/orosmo/blob/main/src/world/streaming.cpp): `src/world/streaming.cpp`
- [World export](https://github.com/timothesandt/orosmo/blob/main/src/world/export.cpp): `src/world/export.cpp`

### Graphics engine

- [Window and input](https://github.com/timothesandt/orosmo/blob/main/src/platform/window.cpp): `src/platform/window.cpp`
- [Graphics device API](https://github.com/timothesandt/orosmo/blob/main/include/orosmo/rhi/device.hpp): `include/orosmo/rhi/device.hpp`
- [OpenGL backend](https://github.com/timothesandt/orosmo/blob/main/src/rhi/opengl/gl_device.cpp): `src/rhi/opengl/gl_device.cpp`
- [Shader compiler](https://github.com/timothesandt/orosmo/blob/main/src/rhi/shader_compiler.cpp): `src/rhi/shader_compiler.cpp`
- [Shader library](https://github.com/timothesandt/orosmo/blob/main/src/renderer/shader_library.cpp): `src/renderer/shader_library.cpp`
- [Pipeline cache](https://github.com/timothesandt/orosmo/blob/main/src/renderer/pipeline_cache.cpp): `src/renderer/pipeline_cache.cpp`
- [Scene rendering](https://github.com/timothesandt/orosmo/blob/main/src/renderer/scene_renderer.cpp): `src/renderer/scene_renderer.cpp`
- [Terrain rendering](https://github.com/timothesandt/orosmo/blob/main/src/renderer/terrain_renderer.cpp): `src/renderer/terrain_renderer.cpp`

### User interface

- [Widget UI runtime](https://github.com/timothesandt/orosmo/blob/main/src/ui/ui.cpp): `src/ui/ui.cpp`
- [UI text rendering](https://github.com/timothesandt/orosmo/blob/main/src/ui/text_renderer.cpp): `src/ui/text_renderer.cpp`

### CUI compiler

- [CUI compiler CLI](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/main.rs): `tools/cui-rs/src/main.rs`
- [Lexer](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/lexer.rs): `tools/cui-rs/src/lexer.rs`
- [Parser](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/parser.rs): `tools/cui-rs/src/parser.rs`
- [Syntax tree](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/ast.rs): `tools/cui-rs/src/ast.rs`
- [C++ generator](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/engine.rs): `tools/cui-rs/src/engine.rs`
- [JSON diagnostics](https://github.com/timothesandt/orosmo/blob/main/tools/cui-rs/src/json.rs): `tools/cui-rs/src/json.rs`

### Other components

- **Engine user**

## Connections

- Engine user → Terrain generator: generates terrain (evidence: `README.md`)
- Engine user → Terrain viewer: views terrain (evidence: `README.md`)
- Terrain generator → Terrain data: uses world module (evidence: `README.md`)
- Terrain viewer → Terrain data: uses world module (evidence: `README.md`)
- GPU noise → Terrain data: uses terrain API
- World export → Terrain data: exports terrain
- Terrain viewer → Window and input: opens window
- Terrain viewer → Terrain rendering: renders terrain
- Terrain rendering → Scene rendering: draws scene
- Scene rendering → Graphics device API: submits graphics
- OpenGL backend → Graphics device API: implements API
- Shader compiler → Graphics device API: compiles shaders
- Shader library → Graphics device API: creates shader programs
- Shader library → Shader compiler: uses compiler
- Pipeline cache → Graphics device API: creates pipelines (evidence: `src/renderer/pipeline_cache.cpp`)
- Pipeline cache → Shader library: caches program pipelines
- Widget UI runtime → UI text rendering: renders text
- CUI compiler CLI → Lexer: tokenizes input (evidence: `tools/cui-rs/src/main.rs`)
- CUI compiler CLI → Parser: parses input (evidence: `tools/cui-rs/src/main.rs`)
- CUI compiler CLI → C++ generator: generates C++ (evidence: `tools/cui-rs/src/main.rs`)
- CUI compiler CLI → JSON diagnostics: formats diagnostics (evidence: `tools/cui-rs/src/main.rs`)
- Parser → Lexer: consumes tokens (evidence: `tools/cui-rs/src/parser.rs`)
- Parser → Syntax tree: builds syntax tree (evidence: `tools/cui-rs/src/parser.rs`)
- C++ generator → Syntax tree: generates from AST (evidence: `tools/cui-rs/src/engine.rs`)
- CUI compiler CLI → Widget UI runtime: targets UI runtime (evidence: `tools/cui-rs/src/main.rs`)
