# halva89/main-frame-graphics architecture

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

- Interactive diagram: https://gitdiagram.com/halva89/main-frame-graphics
- Repository: https://github.com/halva89/main-frame-graphics

## Overview

main.frame is a Rust/Vulkan 3D graphics engine. The principal workflow is to load a text .mff scene, parse its settings and objects, build scene state, then run the windowed frame loop with input, animation and physics updates feeding rendering. The graph also preserves documented rendering, culling and thermal capabilities. Evidence is limited to the README and indexed or excerpted sources; some subsystem links reflect README statements where implementation excerpts were unavailable.

Main entry points: [`src/core/engine.rs`](https://github.com/halva89/main-frame-graphics/blob/main/src/core/engine.rs) (Engine loop), [`src/scene_parser/mod.rs`](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/mod.rs) (MFF parser), [`src/render/vulkan.rs`](https://github.com/halva89/main-frame-graphics/blob/main/src/render/vulkan.rs) (Vulkan backend), [`src/core/object.rs`](https://github.com/halva89/main-frame-graphics/blob/main/src/core/object.rs) (Scene objects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Engine runtime"]
  node_engine["Engine loop<br/>[engine.rs]"]
  node_window["Window control<br/>[window.rs]"]
  node_input["Input handling<br/>[input.rs]"]
  node_time["Frame timing<br/>[time.rs]"]
end

subgraph group_scene["Scene and assets"]
  node_scene["Scene state<br/>[scene.rs]"]
  node_objects["Scene objects<br/>[object.rs]"]
  node_parser["MFF parser<br/>[mod.rs]"]
  node_settings["Scene settings<br/>[scene_settings.rs]"]
  node_staticparse["Static objects<br/>[static_objects.rs]"]
  node_animatedparse["Animated objects"]
  node_meshloader["Mesh loader<br/>[mesh_loader.rs]"]
end

subgraph group_simulation["Simulation"]
  node_transform["Transforms<br/>[transform.rs]"]
  node_animation["Keyframe animation<br/>[animator.rs]"]
  node_interpolation["Interpolation<br/>[interpolator.rs]"]
  node_physics["Physics world<br/>[world.rs]"]
end

subgraph group_graphics["Graphics"]
  node_mesh["Mesh data<br/>[mesh.rs]"]
  node_renderer["Renderer<br/>[renderer.rs]"]
  node_vulkan["Vulkan backend<br/>[vulkan.rs]"]
  node_pipeline["Graphics pipeline<br/>[pipeline.rs]"]
  node_shader["Shader support<br/>[shader.rs]"]
  node_buffers["Geometry buffers<br/>[buffer_manager.rs]"]
  node_culling["Frustum culling<br/>[object.rs]"]
  node_thermal["Thermal mode<br/>[vulkan.rs]"]
end

node_user(("Scene user"))
node_vulkanapi{{"Vulkan API"}}
node_gpu(("Graphics device"))

node_user -->|"runs scene"| node_engine
node_engine -->|"loads scene"| node_parser
node_parser -->|"parses settings"| node_settings
node_parser -->|"parses static"| node_staticparse
node_parser -->|"parses animated"| node_animatedparse
node_parser -->|"loads meshes"| node_meshloader
node_parser -->|"builds geometry"| node_mesh
node_parser -->|"reads physics"| node_physics
node_engine -->|"updates scene"| node_scene
node_scene -->|"stores objects"| node_objects
node_objects -->|"holds mesh"| node_mesh
node_objects -->|"holds transform"| node_transform
node_engine -->|"opens window"| node_window
node_window -->|"handles input"| node_input
node_window -->|"tracks time"| node_time
node_engine -->|"applies animation"| node_animation
node_animation -->|"interpolates frames"| node_interpolation
node_engine -->|"steps physics"| node_physics
node_engine -->|"renders frames"| node_renderer
node_renderer -.->|"uses backend"| node_vulkan
node_vulkan -->|"creates pipelines"| node_pipeline
node_vulkan -->|"renders meshes"| node_mesh
node_vulkan -->|"loads shaders"| node_shader
node_vulkan -->|"calls API"| node_vulkanapi
node_vulkanapi -->|"submits work"| node_gpu
node_meshloader -->|"produces mesh"| node_mesh
node_objects -->|"provides bounds"| node_culling
node_renderer -.->|"culls objects"| node_culling
node_vulkan -.->|"supports effects"| node_thermal

click node_engine "https://github.com/halva89/main-frame-graphics/blob/main/src/core/engine.rs"
click node_window "https://github.com/halva89/main-frame-graphics/blob/main/src/platform/window.rs"
click node_input "https://github.com/halva89/main-frame-graphics/blob/main/src/platform/input.rs"
click node_time "https://github.com/halva89/main-frame-graphics/blob/main/src/platform/time.rs"
click node_scene "https://github.com/halva89/main-frame-graphics/blob/main/src/core/scene.rs"
click node_objects "https://github.com/halva89/main-frame-graphics/blob/main/src/core/object.rs"
click node_parser "https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/mod.rs"
click node_settings "https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/scene_settings.rs"
click node_staticparse "https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/static_objects.rs"
click node_animatedparse "https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/animated_objects.rs"
click node_meshloader "https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/mesh_loader.rs"
click node_mesh "https://github.com/halva89/main-frame-graphics/blob/main/src/render/mesh.rs"
click node_transform "https://github.com/halva89/main-frame-graphics/blob/main/src/core/transform.rs"
click node_animation "https://github.com/halva89/main-frame-graphics/blob/main/src/animation/animator.rs"
click node_interpolation "https://github.com/halva89/main-frame-graphics/blob/main/src/animation/interpolator.rs"
click node_physics "https://github.com/halva89/main-frame-graphics/blob/main/src/physics/world.rs"
click node_renderer "https://github.com/halva89/main-frame-graphics/blob/main/src/render/renderer.rs"
click node_vulkan "https://github.com/halva89/main-frame-graphics/blob/main/src/render/vulkan.rs"
click node_pipeline "https://github.com/halva89/main-frame-graphics/blob/main/src/render/pipeline.rs"
click node_shader "https://github.com/halva89/main-frame-graphics/blob/main/src/render/shader.rs"
click node_buffers "https://github.com/halva89/main-frame-graphics/blob/main/src/render/buffer_manager.rs"
click node_culling "https://github.com/halva89/main-frame-graphics/blob/main/src/core/object.rs"
click node_thermal "https://github.com/halva89/main-frame-graphics/blob/main/src/render/vulkan.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_engine,node_window,node_input,node_time,node_user toneBlue
class node_scene,node_objects,node_parser,node_settings,node_staticparse,node_animatedparse,node_meshloader toneAmber
class node_transform,node_animation,node_interpolation,node_physics,node_vulkanapi toneMint
class node_mesh,node_renderer,node_vulkan,node_pipeline,node_shader,node_buffers,node_culling,node_thermal toneRose
class node_gpu toneIndigo
```

## Components

### Engine runtime

- [Engine loop](https://github.com/halva89/main-frame-graphics/blob/main/src/core/engine.rs): `src/core/engine.rs`
- [Window control](https://github.com/halva89/main-frame-graphics/blob/main/src/platform/window.rs): `src/platform/window.rs`
- [Input handling](https://github.com/halva89/main-frame-graphics/blob/main/src/platform/input.rs): `src/platform/input.rs`
- [Frame timing](https://github.com/halva89/main-frame-graphics/blob/main/src/platform/time.rs): `src/platform/time.rs`

### Scene and assets

- [Scene state](https://github.com/halva89/main-frame-graphics/blob/main/src/core/scene.rs): `src/core/scene.rs`
- [Scene objects](https://github.com/halva89/main-frame-graphics/blob/main/src/core/object.rs): `src/core/object.rs`
- [MFF parser](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/mod.rs): `src/scene_parser/mod.rs`
- [Scene settings](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/scene_settings.rs): `src/scene_parser/scene_settings.rs`
- [Static objects](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/static_objects.rs): `src/scene_parser/static_objects.rs`
- [Animated objects](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/animated_objects.rs): `src/scene_parser/animated_objects.rs`
- [Mesh loader](https://github.com/halva89/main-frame-graphics/blob/main/src/scene_parser/mesh_loader.rs): `src/scene_parser/mesh_loader.rs`

### Simulation

- [Transforms](https://github.com/halva89/main-frame-graphics/blob/main/src/core/transform.rs): `src/core/transform.rs`
- [Keyframe animation](https://github.com/halva89/main-frame-graphics/blob/main/src/animation/animator.rs): `src/animation/animator.rs`
- [Interpolation](https://github.com/halva89/main-frame-graphics/blob/main/src/animation/interpolator.rs): `src/animation/interpolator.rs`
- [Physics world](https://github.com/halva89/main-frame-graphics/blob/main/src/physics/world.rs): `src/physics/world.rs`

### Graphics

- [Mesh data](https://github.com/halva89/main-frame-graphics/blob/main/src/render/mesh.rs): `src/render/mesh.rs`
- [Renderer](https://github.com/halva89/main-frame-graphics/blob/main/src/render/renderer.rs): `src/render/renderer.rs`
- [Vulkan backend](https://github.com/halva89/main-frame-graphics/blob/main/src/render/vulkan.rs): `src/render/vulkan.rs`
- [Graphics pipeline](https://github.com/halva89/main-frame-graphics/blob/main/src/render/pipeline.rs): `src/render/pipeline.rs`
- [Shader support](https://github.com/halva89/main-frame-graphics/blob/main/src/render/shader.rs): `src/render/shader.rs`
- [Geometry buffers](https://github.com/halva89/main-frame-graphics/blob/main/src/render/buffer_manager.rs): `src/render/buffer_manager.rs`
- [Frustum culling](https://github.com/halva89/main-frame-graphics/blob/main/src/core/object.rs): `src/core/object.rs`
- [Thermal mode](https://github.com/halva89/main-frame-graphics/blob/main/src/render/vulkan.rs): `src/render/vulkan.rs`

### Other components

- **Scene user**
- **Vulkan API**
- **Graphics device**

## Connections

- Scene user → Engine loop: runs scene
- Engine loop → MFF parser: loads scene (evidence: `src/core/engine.rs`)
- MFF parser → Scene settings: parses settings (evidence: `src/scene_parser/mod.rs`)
- MFF parser → Static objects: parses static (evidence: `src/scene_parser/mod.rs`)
- MFF parser → Animated objects: parses animated (evidence: `src/scene_parser/mod.rs`)
- MFF parser → Mesh loader: loads meshes (evidence: `src/scene_parser/mod.rs`)
- MFF parser → Mesh data: builds geometry (evidence: `src/scene_parser/mod.rs`)
- MFF parser → Physics world: reads physics (evidence: `src/scene_parser/mod.rs`)
- Engine loop → Scene state: updates scene (evidence: `src/core/engine.rs`)
- Scene state → Scene objects: stores objects (evidence: `src/core/scene.rs`)
- Scene objects → Mesh data: holds mesh (evidence: `src/core/object.rs`)
- Scene objects → Transforms: holds transform (evidence: `src/core/object.rs`)
- Engine loop → Window control: opens window (evidence: `src/core/engine.rs`)
- Window control → Input handling: handles input (evidence: `src/platform/window.rs`)
- Window control → Frame timing: tracks time (evidence: `src/platform/window.rs`)
- Engine loop → Keyframe animation: applies animation (evidence: `src/core/engine.rs`)
- Keyframe animation → Interpolation: interpolates frames (evidence: `src/animation/animator.rs`)
- Engine loop → Physics world: steps physics (evidence: `src/core/engine.rs`)
- Engine loop → Renderer: renders frames (evidence: `src/core/engine.rs`)
- Renderer → Vulkan backend: uses backend
- Vulkan backend → Graphics pipeline: creates pipelines (evidence: `src/render/vulkan.rs`)
- Vulkan backend → Mesh data: renders meshes (evidence: `src/render/vulkan.rs`)
- Vulkan backend → Shader support: loads shaders (evidence: `src/render/vulkan.rs`)
- Vulkan backend → Vulkan API: calls API
- Vulkan API → Graphics device: submits work
- Mesh loader → Mesh data: produces mesh (evidence: `src/scene_parser/mesh_loader.rs`)
- Scene objects → Frustum culling: provides bounds (evidence: `src/core/object.rs`)
- Renderer → Frustum culling: culls objects
- Vulkan backend → Thermal mode: supports effects (evidence: `src/render/vulkan.rs`)
