# iddeqpt/engine architecture

> Architecture diagram of the GitHub repository iddeqpt/engine, 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/iddeqpt/engine
- Repository: https://github.com/iddeqpt/engine

## Overview

Engine is a cross-platform C++ game-engine library. An application supplies a root node; Engine initializes shared services and a window, then runs an event, node-update, physics, and rendering loop until the window closes. Rendering has distinct 2D canvas and 3D world paths backed by shader pipelines and selectable graphics APIs. The repository also provides input, configuration/signals, resources, 2D physics, fonts, image textures, and math. The graph preserves README capabilities, but unsampled implementation links are omitted or marked unverified.

Main entry points: [`src/Core/Engine.cpp`](https://github.com/iddeqpt/engine/blob/dev/src/Core/Engine.cpp) (Engine Loop), [`src/Graphics/GL/Api.cpp`](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/Api.cpp) (Graphics API), [`src/Physics/PhysicsWorld.cpp`](https://github.com/iddeqpt/engine/blob/dev/src/Physics/PhysicsWorld.cpp) (Physics World), [`src/System/Window.cpp`](https://github.com/iddeqpt/engine/blob/dev/src/System/Window.cpp) (Window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Engine Runtime"]
  node_engine["Engine Loop<br/>[Engine.cpp]"]
  node_scene_nodes["Root Node Tree<br/>[Node.cpp]"]
  node_config["Configuration<br/>[ConfigManager.cpp]"]
  node_signals["Signal Bus<br/>[SignalBus.cpp]"]
  node_time["Time Manager<br/>[TimeManager.cpp]"]
end

subgraph group_graphics["Rendering"]
  node_render2d["2D Canvas<br/>[RenderCanvas.cpp]"]
  node_render3d["3D World<br/>[RenderWorld.cpp]"]
  node_shaders["Default Shaders"]
  node_shader_api["Shader Programs<br/>[Shader.cpp]"]
  node_graphics_api["Graphics API<br/>[Api.cpp]"]
  node_opengl["OpenGL 3.3 Backend<br/>[Api.cpp]"]
  node_null_api["Null Backend<br/>[Api.cpp]"]
end

subgraph group_platform["Window and Input"]
  node_events["Event Manager<br/>[EventManager.cpp]"]
  node_window["Window<br/>[Window.cpp]"]
  node_input["Keyboard and Mouse<br/>[Keyboard.cpp]"]
end

subgraph group_physics["Physics and Math"]
  node_physics_world["Physics World<br/>[PhysicsWorld.cpp]"]
  node_collision["2D Collision"]
  node_math["Math Library<br/>[Mat4.cpp]"]
end

subgraph group_assets["Resources and Assets"]
  node_resources["Resource Manager"]
  node_texture["Textures and Images<br/>[Texture.cpp]"]
  node_fonts["TrueType Fonts<br/>[Font.cpp]"]
end

node_application(("Application"))
node_external_glfw(("GLFW"))
node_external_freetype(("FreeType"))
node_external_stb(("stb_image"))

node_application -->|"starts with root"| node_engine
node_engine -->|"initializes"| node_window
node_engine -->|"pulls events"| node_events
node_engine -->|"updates tree"| node_scene_nodes
node_engine -->|"updates physics"| node_physics_world
node_engine -->|"renders world"| node_render3d
node_engine -->|"renders canvas"| node_render2d
node_engine -->|"limits frame rate"| node_time
node_engine -->|"notifies settings"| node_config
node_engine -->|"subscribes changes"| node_signals
node_engine -->|"creates service"| node_resources
node_engine -->|"loads shader sources"| node_shaders
node_engine -->|"creates pipelines"| node_shader_api
node_engine -->|"initializes"| node_graphics_api
node_engine -->|"clears and displays"| node_window
node_graphics_api -.->|"selects backend"| node_opengl
node_graphics_api -.->|"selects backend"| node_null_api
node_opengl -->|"loads GL functions"| node_external_glfw
node_render2d -->|"uses 2D pipeline"| node_shaders
node_render3d -->|"uses deferred pipeline"| node_shaders
node_physics_world -.->|"runs collision"| node_collision
node_events -.->|"dispatches input"| node_input
node_window -->|"uses window system"| node_external_glfw
node_fonts -->|"loads TrueType"| node_external_freetype
node_texture -->|"loads image files"| node_external_stb
node_scene_nodes -.->|"uses transforms"| node_math
node_physics_world -.->|"uses math types"| node_math

click node_engine "https://github.com/iddeqpt/engine/blob/dev/src/Core/Engine.cpp"
click node_scene_nodes "https://github.com/iddeqpt/engine/blob/dev/src/Core/Node.cpp"
click node_config "https://github.com/iddeqpt/engine/blob/dev/src/Core/ConfigManager.cpp"
click node_signals "https://github.com/iddeqpt/engine/blob/dev/src/Core/SignalBus.cpp"
click node_time "https://github.com/iddeqpt/engine/blob/dev/src/Core/TimeManager.cpp"
click node_events "https://github.com/iddeqpt/engine/blob/dev/src/System/EventManager.cpp"
click node_window "https://github.com/iddeqpt/engine/blob/dev/src/System/Window.cpp"
click node_input "https://github.com/iddeqpt/engine/blob/dev/src/System/Keyboard.cpp"
click node_render2d "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/2D/RenderCanvas.cpp"
click node_render3d "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/3D/RenderWorld.cpp"
click node_shaders "https://github.com/iddeqpt/engine/blob/dev/src/Core/shaders/default3d-deferred-frag.hpp"
click node_shader_api "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Shader.cpp"
click node_graphics_api "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/Api.cpp"
click node_opengl "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/OpenGL33/Api.cpp"
click node_null_api "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/Null/Api.cpp"
click node_physics_world "https://github.com/iddeqpt/engine/blob/dev/src/Physics/PhysicsWorld.cpp"
click node_collision "https://github.com/iddeqpt/engine/blob/dev/src/Physics/2D/CollisionDetector2D.cpp"
click node_math "https://github.com/iddeqpt/engine/blob/dev/src/Math/Mat4.cpp"
click node_resources "https://github.com/iddeqpt/engine/blob/dev/src/Core/ResourceManager.cpp"
click node_texture "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Texture.cpp"
click node_fonts "https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Font.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_scene_nodes,node_config,node_signals,node_time toneBlue
class node_render2d,node_render3d,node_shaders,node_shader_api,node_graphics_api,node_opengl,node_null_api toneAmber
class node_events,node_window,node_input toneMint
class node_physics_world,node_collision,node_math toneRose
class node_resources,node_texture,node_fonts,node_application,node_external_glfw,node_external_freetype,node_external_stb toneIndigo
```

## Components

### Engine Runtime

- [Engine Loop](https://github.com/iddeqpt/engine/blob/dev/src/Core/Engine.cpp): `src/Core/Engine.cpp`
- [Root Node Tree](https://github.com/iddeqpt/engine/blob/dev/src/Core/Node.cpp): `src/Core/Node.cpp`
- [Configuration](https://github.com/iddeqpt/engine/blob/dev/src/Core/ConfigManager.cpp): `src/Core/ConfigManager.cpp`
- [Signal Bus](https://github.com/iddeqpt/engine/blob/dev/src/Core/SignalBus.cpp): `src/Core/SignalBus.cpp`
- [Time Manager](https://github.com/iddeqpt/engine/blob/dev/src/Core/TimeManager.cpp): `src/Core/TimeManager.cpp`

### Rendering

- [2D Canvas](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/2D/RenderCanvas.cpp): `src/Graphics/2D/RenderCanvas.cpp`
- [3D World](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/3D/RenderWorld.cpp): `src/Graphics/3D/RenderWorld.cpp`
- [Default Shaders](https://github.com/iddeqpt/engine/blob/dev/src/Core/shaders/default3d-deferred-frag.hpp): `src/Core/shaders/default3d-deferred-frag.hpp`
- [Shader Programs](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Shader.cpp): `src/Graphics/Shader.cpp`
- [Graphics API](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/Api.cpp): `src/Graphics/GL/Api.cpp`
- [OpenGL 3.3 Backend](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/OpenGL33/Api.cpp): `src/Graphics/GL/OpenGL33/Api.cpp`
- [Null Backend](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/GL/Null/Api.cpp): `src/Graphics/GL/Null/Api.cpp`

### Window and Input

- [Event Manager](https://github.com/iddeqpt/engine/blob/dev/src/System/EventManager.cpp): `src/System/EventManager.cpp`
- [Window](https://github.com/iddeqpt/engine/blob/dev/src/System/Window.cpp): `src/System/Window.cpp`
- [Keyboard and Mouse](https://github.com/iddeqpt/engine/blob/dev/src/System/Keyboard.cpp): `src/System/Keyboard.cpp`

### Physics and Math

- [Physics World](https://github.com/iddeqpt/engine/blob/dev/src/Physics/PhysicsWorld.cpp): `src/Physics/PhysicsWorld.cpp`
- [2D Collision](https://github.com/iddeqpt/engine/blob/dev/src/Physics/2D/CollisionDetector2D.cpp): `src/Physics/2D/CollisionDetector2D.cpp`
- [Math Library](https://github.com/iddeqpt/engine/blob/dev/src/Math/Mat4.cpp): `src/Math/Mat4.cpp`

### Resources and Assets

- [Resource Manager](https://github.com/iddeqpt/engine/blob/dev/src/Core/ResourceManager.cpp): `src/Core/ResourceManager.cpp`
- [Textures and Images](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Texture.cpp): `src/Graphics/Texture.cpp`
- [TrueType Fonts](https://github.com/iddeqpt/engine/blob/dev/src/Graphics/Font.cpp): `src/Graphics/Font.cpp`

### Other components

- **Application**
- **GLFW**
- **FreeType**
- **stb_image**

## Connections

- Application → Engine Loop: starts with root (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Window: initializes (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Event Manager: pulls events (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Root Node Tree: updates tree (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Physics World: updates physics (evidence: `src/Core/Engine.cpp`)
- Engine Loop → 3D World: renders world (evidence: `src/Core/Engine.cpp`)
- Engine Loop → 2D Canvas: renders canvas (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Time Manager: limits frame rate (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Configuration: notifies settings (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Signal Bus: subscribes changes (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Resource Manager: creates service (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Default Shaders: loads shader sources (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Shader Programs: creates pipelines (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Graphics API: initializes (evidence: `src/Core/Engine.cpp`)
- Engine Loop → Window: clears and displays (evidence: `src/Core/Engine.cpp`)
- Graphics API → OpenGL 3.3 Backend: selects backend
- Graphics API → Null Backend: selects backend
- OpenGL 3.3 Backend → GLFW: loads GL functions (evidence: `src/Graphics/GL/OpenGL33/Api.cpp`)
- 2D Canvas → Default Shaders: uses 2D pipeline
- 3D World → Default Shaders: uses deferred pipeline
- Physics World → 2D Collision: runs collision
- Event Manager → Keyboard and Mouse: dispatches input
- Window → GLFW: uses window system (evidence: `README.md`)
- TrueType Fonts → FreeType: loads TrueType (evidence: `README.md`)
- Textures and Images → stb_image: loads image files (evidence: `README.md`)
- Root Node Tree → Math Library: uses transforms
- Physics World → Math Library: uses math types
