# whotftookshadowflare/voidengine architecture

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

- Interactive diagram: https://gitdiagram.com/whotftookshadowflare/voidengine
- Repository: https://github.com/whotftookshadowflare/voidengine

## Overview

VoidEngine is a desktop game engine. Its principal runtime path is engine initialization and event polling, scene/object composition, then scene drawing into a render frame for rendering. Other documented-by-tree capabilities include input/window handling, audio, resource providers, and script engines (with a Lua implementation). The README gives no usage workflow, and source excerpts are partial, so links for unsampled subsystem wiring are omitted.

Main entry points: [`src/scene/scene.cpp`](https://github.com/whotftookshadowflare/voidengine/blob/main/src/scene/scene.cpp) (Scene), [`src/engine.cpp`](https://github.com/whotftookshadowflare/voidengine/blob/main/src/engine.cpp) (Engine), [`components/graphics/opengl/graphics_program_opengl.cpp`](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/graphics_program_opengl.cpp) (GL programs), [`components/scripts/lua/lua_script_engine.cpp`](https://github.com/whotftookshadowflare/voidengine/blob/main/components/scripts/lua/lua_script_engine.cpp) (Lua engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Engine Core"]
  node_engine["Engine<br/>[engine.cpp]"]
  node_events["Event system<br/>[event_bus.cpp]"]
end

subgraph group_scene["Scene Runtime"]
  node_scene["Scene<br/>[scene.cpp]"]
  node_gameobjects["Game objects<br/>[game_object.cpp]"]
  node_components["Scene components"]
  node_models["Model providers"]
end

subgraph group_graphics["Graphics"]
  node_renderer["Renderer<br/>[renderer.cpp]"]
  node_renderframe["Render frame<br/>[render_frame.cpp]"]
  node_gfxapi["Graphics API"]
  node_opengl["OpenGL backend<br/>[backend_opengl.cpp]"]
  node_glprogram["GL programs"]
  node_glshader["GL shaders<br/>[shader_opengl.cpp]"]
  node_glmesh["GL meshes<br/>[mesh_opengl.cpp]"]
  node_gltexture["GL textures<br/>[texture_opengl.cpp]"]
end

subgraph group_io["Platform I/O"]
  node_window["Window<br/>[window.cpp]"]
  node_input["Input<br/>[input.cpp]"]
  node_audio["Audio<br/>[audio.cpp]"]
  node_audiobackend["OpenAL backend<br/>[backend_openal.cpp]"]
  node_resources["Resource providers"]
end

subgraph group_scripting["Scripting"]
  node_scriptregistry["Script engines<br/>[script_engines.cpp]"]
  node_lua["Lua engine"]
  node_scripts["Script runtime<br/>[script.cpp]"]
end

node_developer(("Game developer"))
node_sdl{{"SDL platform"}}
node_luaext{{"Lua runtime"}}
node_openal{{"OpenAL"}}

node_developer -->|"initializes"| node_engine
node_engine -->|"polls events"| node_window
node_engine -->|"forwards input"| node_input
node_engine -->|"creates audio"| node_audio
node_engine -->|"fires events"| node_events
node_sdl -->|"delivers events"| node_engine
node_window -->|"emits events"| node_events
node_input -->|"emits events"| node_events
node_developer -->|"loads scene"| node_scene
node_scene -->|"creates providers"| node_models
node_scene -->|"creates objects"| node_gameobjects
node_scene -->|"attaches components"| node_components
node_gameobjects -->|"draws components"| node_components
node_scene -->|"creates frame"| node_renderframe
node_scene -->|"gets renderer"| node_renderer
node_renderframe -->|"holds render data"| node_gfxapi
node_renderer -->|"uses interface"| node_gfxapi
node_opengl -->|"creates programs"| node_glprogram
node_glprogram -->|"attaches shaders"| node_glshader
node_glprogram -->|"draws mesh"| node_glmesh
node_glprogram -->|"binds textures"| node_gltexture
node_opengl -.-> node_openal
node_developer -->|"requests compilation"| node_scriptregistry
node_scriptregistry -->|"dispatches compile"| node_lua
node_lua -->|"creates scripts"| node_scripts
node_lua -->|"uses runtime"| node_luaext
node_audio -.->|"selects backend"| node_audiobackend
node_audiobackend -->|"uses audio API"| node_openal
node_developer -->|"selects assets"| node_resources

click node_engine "https://github.com/whotftookshadowflare/voidengine/blob/main/src/engine.cpp"
click node_events "https://github.com/whotftookshadowflare/voidengine/blob/main/src/event/event_bus.cpp"
click node_scene "https://github.com/whotftookshadowflare/voidengine/blob/main/src/scene/scene.cpp"
click node_gameobjects "https://github.com/whotftookshadowflare/voidengine/blob/main/src/scene/game_object.cpp"
click node_components "https://github.com/whotftookshadowflare/voidengine/tree/main/src/scene/components"
click node_models "https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/res_providers/model"
click node_renderer "https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/gfx/renderer.cpp"
click node_renderframe "https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/gfx/render_frame.cpp"
click node_gfxapi "https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/gfx"
click node_opengl "https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/backend_opengl.cpp"
click node_glprogram "https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/graphics_program_opengl.cpp"
click node_glshader "https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/shader_opengl.cpp"
click node_glmesh "https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/mesh_opengl.cpp"
click node_gltexture "https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/texture_opengl.cpp"
click node_window "https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/window.cpp"
click node_input "https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/input.cpp"
click node_audio "https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/sfx/audio.cpp"
click node_audiobackend "https://github.com/whotftookshadowflare/voidengine/blob/main/components/audio/openal/backend_openal.cpp"
click node_resources "https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/res_providers"
click node_scriptregistry "https://github.com/whotftookshadowflare/voidengine/blob/main/src/script/script_engines.cpp"
click node_lua "https://github.com/whotftookshadowflare/voidengine/blob/main/components/scripts/lua/lua_script_engine.cpp"
click node_scripts "https://github.com/whotftookshadowflare/voidengine/blob/main/src/script/script.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_engine,node_events toneBlue
class node_scene,node_gameobjects,node_components,node_models toneAmber
class node_renderer,node_renderframe,node_gfxapi,node_opengl,node_glprogram,node_glshader,node_glmesh,node_gltexture toneMint
class node_window,node_input,node_audio,node_audiobackend,node_resources toneRose
class node_scriptregistry,node_lua,node_scripts,node_developer,node_sdl,node_luaext,node_openal toneIndigo
```

## Components

### Engine Core

- [Engine](https://github.com/whotftookshadowflare/voidengine/blob/main/src/engine.cpp): `src/engine.cpp`
- [Event system](https://github.com/whotftookshadowflare/voidengine/blob/main/src/event/event_bus.cpp): `src/event/event_bus.cpp`

### Scene Runtime

- [Scene](https://github.com/whotftookshadowflare/voidengine/blob/main/src/scene/scene.cpp): `src/scene/scene.cpp`
- [Game objects](https://github.com/whotftookshadowflare/voidengine/blob/main/src/scene/game_object.cpp): `src/scene/game_object.cpp`
- [Scene components](https://github.com/whotftookshadowflare/voidengine/tree/main/src/scene/components): `src/scene/components`
- [Model providers](https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/res_providers/model): `include/ve/io/res_providers/model`

### Graphics

- [Renderer](https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/gfx/renderer.cpp): `src/io/gfx/renderer.cpp`
- [Render frame](https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/gfx/render_frame.cpp): `src/io/gfx/render_frame.cpp`
- [Graphics API](https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/gfx): `include/ve/io/gfx`
- [OpenGL backend](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/backend_opengl.cpp): `components/graphics/opengl/backend_opengl.cpp`
- [GL programs](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/graphics_program_opengl.cpp): `components/graphics/opengl/graphics_program_opengl.cpp`
- [GL shaders](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/shader_opengl.cpp): `components/graphics/opengl/shader_opengl.cpp`
- [GL meshes](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/mesh_opengl.cpp): `components/graphics/opengl/mesh_opengl.cpp`
- [GL textures](https://github.com/whotftookshadowflare/voidengine/blob/main/components/graphics/opengl/texture_opengl.cpp): `components/graphics/opengl/texture_opengl.cpp`

### Platform I/O

- [Window](https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/window.cpp): `src/io/window.cpp`
- [Input](https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/input.cpp): `src/io/input.cpp`
- [Audio](https://github.com/whotftookshadowflare/voidengine/blob/main/src/io/sfx/audio.cpp): `src/io/sfx/audio.cpp`
- [OpenAL backend](https://github.com/whotftookshadowflare/voidengine/blob/main/components/audio/openal/backend_openal.cpp): `components/audio/openal/backend_openal.cpp`
- [Resource providers](https://github.com/whotftookshadowflare/voidengine/tree/main/include/ve/io/res_providers): `include/ve/io/res_providers`

### Scripting

- [Script engines](https://github.com/whotftookshadowflare/voidengine/blob/main/src/script/script_engines.cpp): `src/script/script_engines.cpp`
- [Lua engine](https://github.com/whotftookshadowflare/voidengine/blob/main/components/scripts/lua/lua_script_engine.cpp): `components/scripts/lua/lua_script_engine.cpp`
- [Script runtime](https://github.com/whotftookshadowflare/voidengine/blob/main/src/script/script.cpp): `src/script/script.cpp`

### Other components

- **Game developer**
- **SDL platform**
- **Lua runtime**
- **OpenAL**

## Connections

- Game developer → Engine: initializes
- Engine → Window: polls events
- Engine → Input: forwards input
- Engine → Audio: creates audio
- Engine → Event system: fires events
- SDL platform → Engine: delivers events
- Window → Event system: emits events
- Input → Event system: emits events
- Game developer → Scene: loads scene
- Scene → Model providers: creates providers
- Scene → Game objects: creates objects
- Scene → Scene components: attaches components
- Game objects → Scene components: draws components
- Scene → Render frame: creates frame
- Scene → Renderer: gets renderer
- Render frame → Graphics API: holds render data
- Renderer → Graphics API: uses interface
- OpenGL backend → GL programs: creates programs
- GL programs → GL shaders: attaches shaders
- GL programs → GL meshes: draws mesh
- GL programs → GL textures: binds textures
- OpenGL backend → OpenAL
- Game developer → Script engines: requests compilation
- Script engines → Lua engine: dispatches compile
- Lua engine → Script runtime: creates scripts
- Lua engine → Lua runtime: uses runtime
- Audio → OpenAL backend: selects backend
- OpenAL backend → OpenAL: uses audio API
- Game developer → Resource providers: selects assets
