# leo5852/openengine architecture

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

- Interactive diagram: https://gitdiagram.com/leo5852/openengine
- Repository: https://github.com/leo5852/openengine

## Overview

OpenEngine is a small OpenGL 3D engine with Jolt-backed physics. Its visible runtime workflow initializes a GLFW window, configures shaders and physics, creates a scene of renderable objects, then updates and draws the scene while processing window events. The graph preserves distinct rendering, scene, and physics responsibilities, plus the GLFW and GLM libraries used by the application. Source coverage is limited to the supplied excerpts and SOURCE INDEX; relationships for unsampled implementation details are omitted rather than inferred.

Main entry points: [`src/main.cpp`](https://github.com/leo5852/openengine/blob/main/src/main.cpp) (Runtime entry), [`include/scene.h`](https://github.com/leo5852/openengine/blob/main/include/scene.h) (Scene management), [`src/physicsWorld.cpp`](https://github.com/leo5852/openengine/blob/main/src/physicsWorld.cpp) (Physics world), [`src/renderableObject.cpp`](https://github.com/leo5852/openengine/blob/main/src/renderableObject.cpp) (Renderable objects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Runtime entry<br/>[main.cpp]"]
  node_scene["Scene management<br/>[scene.h]"]
  node_player["Player control<br/>[player.cpp]"]
end

subgraph group_render["Rendering"]
  node_renderable["Renderable objects"]
  node_cube["Cube geometry<br/>[cube.cpp]"]
  node_plane["Plane geometry<br/>[plane.cpp]"]
  node_wireframe["Wireframe geometry<br/>[wireframe.cpp]"]
  node_shader["Shader program<br/>[shader.cpp]"]
  node_light["Lighting data<br/>[light.h]"]
end

subgraph group_physics["Physics"]
  node_gameobject["Game objects<br/>[gameObject.h]"]
  node_physicsworld["Physics world<br/>[physicsWorld.cpp]"]
  node_colliders["Collider types<br/>[collider.h]"]
  node_boxcollider["Box collider<br/>[boxCollider.h]"]
  node_spherecollider["Sphere collider<br/>[sphereCollider.h]"]
  node_conversions["Jolt conversions<br/>[joltConversions.h]"]
end

subgraph group_vendor["Runtime dependencies"]
  node_glfw["Window and input API<br/>[glfw3.h]"]
  node_glfwcore["GLFW platform core<br/>[internal.h]"]
  node_glm["GLM math library<br/>[glm.hpp]"]
end

node_user(("Engine user"))

node_user -->|"starts"| node_main
node_main -->|"creates window"| node_glfw
node_main -->|"configures shaders"| node_shader
node_main -->|"creates character"| node_player
node_main -->|"initializes"| node_physicsworld
node_main -->|"creates scene"| node_scene
node_main -->|"spawns"| node_cube
node_main -->|"spawns"| node_plane
node_main -->|"uploads lights"| node_light
node_main -->|"polls events"| node_glfw
node_main -->|"draws scene"| node_scene
node_main -->|"uses transforms"| node_glm
node_scene -->|"uses renderables"| node_renderable
node_scene -->|"holds physics world"| node_physicsworld
node_scene -->|"uses lighting"| node_light
node_gameobject -->|"uses collider"| node_colliders
node_physicsworld -->|"builds bodies from"| node_gameobject
node_physicsworld -->|"handles shapes"| node_boxcollider
node_physicsworld -->|"uses conversions"| node_conversions
node_cube -.->|"specializes"| node_renderable
node_plane -.->|"specializes"| node_renderable
node_wireframe -.->|"uses base"| node_renderable
node_glfw -.->|"implemented by"| node_glfwcore

click node_main "https://github.com/leo5852/openengine/blob/main/src/main.cpp"
click node_scene "https://github.com/leo5852/openengine/blob/main/include/scene.h"
click node_player "https://github.com/leo5852/openengine/blob/main/src/player.cpp"
click node_gameobject "https://github.com/leo5852/openengine/blob/main/include/gameObject.h"
click node_physicsworld "https://github.com/leo5852/openengine/blob/main/src/physicsWorld.cpp"
click node_colliders "https://github.com/leo5852/openengine/blob/main/include/collider.h"
click node_boxcollider "https://github.com/leo5852/openengine/blob/main/include/boxCollider.h"
click node_spherecollider "https://github.com/leo5852/openengine/blob/main/include/sphereCollider.h"
click node_conversions "https://github.com/leo5852/openengine/blob/main/include/joltConversions.h"
click node_renderable "https://github.com/leo5852/openengine/blob/main/src/renderableObject.cpp"
click node_cube "https://github.com/leo5852/openengine/blob/main/src/cube.cpp"
click node_plane "https://github.com/leo5852/openengine/blob/main/src/plane.cpp"
click node_wireframe "https://github.com/leo5852/openengine/blob/main/src/wireframe.cpp"
click node_shader "https://github.com/leo5852/openengine/blob/main/src/shader.cpp"
click node_light "https://github.com/leo5852/openengine/blob/main/include/light.h"
click node_glfw "https://github.com/leo5852/openengine/blob/main/dependencies/glfw-3.4/include/GLFW/glfw3.h"
click node_glfwcore "https://github.com/leo5852/openengine/blob/main/dependencies/glfw-3.4/src/internal.h"
click node_glm "https://github.com/leo5852/openengine/blob/main/dependencies/glm/glm/glm.hpp"

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_main,node_scene,node_player,node_user toneBlue
class node_renderable,node_cube,node_plane,node_wireframe,node_shader,node_light toneAmber
class node_gameobject,node_physicsworld,node_colliders,node_boxcollider,node_spherecollider,node_conversions toneMint
class node_glfw,node_glfwcore,node_glm toneRose
```

## Components

### Application

- [Runtime entry](https://github.com/leo5852/openengine/blob/main/src/main.cpp): `src/main.cpp`
- [Scene management](https://github.com/leo5852/openengine/blob/main/include/scene.h): `include/scene.h`
- [Player control](https://github.com/leo5852/openengine/blob/main/src/player.cpp): `src/player.cpp`

### Rendering

- [Renderable objects](https://github.com/leo5852/openengine/blob/main/src/renderableObject.cpp): `src/renderableObject.cpp`
- [Cube geometry](https://github.com/leo5852/openengine/blob/main/src/cube.cpp): `src/cube.cpp`
- [Plane geometry](https://github.com/leo5852/openengine/blob/main/src/plane.cpp): `src/plane.cpp`
- [Wireframe geometry](https://github.com/leo5852/openengine/blob/main/src/wireframe.cpp): `src/wireframe.cpp`
- [Shader program](https://github.com/leo5852/openengine/blob/main/src/shader.cpp): `src/shader.cpp`
- [Lighting data](https://github.com/leo5852/openengine/blob/main/include/light.h): `include/light.h`

### Physics

- [Game objects](https://github.com/leo5852/openengine/blob/main/include/gameObject.h): `include/gameObject.h`
- [Physics world](https://github.com/leo5852/openengine/blob/main/src/physicsWorld.cpp): `src/physicsWorld.cpp`
- [Collider types](https://github.com/leo5852/openengine/blob/main/include/collider.h): `include/collider.h`
- [Box collider](https://github.com/leo5852/openengine/blob/main/include/boxCollider.h): `include/boxCollider.h`
- [Sphere collider](https://github.com/leo5852/openengine/blob/main/include/sphereCollider.h): `include/sphereCollider.h`
- [Jolt conversions](https://github.com/leo5852/openengine/blob/main/include/joltConversions.h): `include/joltConversions.h`

### Runtime dependencies

- [Window and input API](https://github.com/leo5852/openengine/blob/main/dependencies/glfw-3.4/include/GLFW/glfw3.h): `dependencies/glfw-3.4/include/GLFW/glfw3.h`
- [GLFW platform core](https://github.com/leo5852/openengine/blob/main/dependencies/glfw-3.4/src/internal.h): `dependencies/glfw-3.4/src/internal.h`
- [GLM math library](https://github.com/leo5852/openengine/blob/main/dependencies/glm/glm/glm.hpp): `dependencies/glm/glm/glm.hpp`

### Other components

- **Engine user**

## Connections

- Engine user → Runtime entry: starts
- Runtime entry → Window and input API: creates window (evidence: `src/main.cpp`)
- Runtime entry → Shader program: configures shaders (evidence: `src/main.cpp`)
- Runtime entry → Player control: creates character (evidence: `src/main.cpp`)
- Runtime entry → Physics world: initializes (evidence: `src/main.cpp`)
- Runtime entry → Scene management: creates scene (evidence: `src/main.cpp`)
- Runtime entry → Cube geometry: spawns (evidence: `src/main.cpp`)
- Runtime entry → Plane geometry: spawns (evidence: `src/main.cpp`)
- Runtime entry → Lighting data: uploads lights (evidence: `src/main.cpp`)
- Runtime entry → Window and input API: polls events (evidence: `src/main.cpp`)
- Runtime entry → Scene management: draws scene (evidence: `src/main.cpp`)
- Runtime entry → GLM math library: uses transforms (evidence: `src/main.cpp`)
- Scene management → Renderable objects: uses renderables (evidence: `include/scene.h`)
- Scene management → Physics world: holds physics world (evidence: `include/scene.h`)
- Scene management → Lighting data: uses lighting (evidence: `include/scene.h`)
- Game objects → Collider types: uses collider (evidence: `include/gameObject.h`)
- Physics world → Game objects: builds bodies from (evidence: `src/physicsWorld.cpp`)
- Physics world → Box collider: handles shapes (evidence: `src/physicsWorld.cpp`)
- Physics world → Jolt conversions: uses conversions (evidence: `src/physicsWorld.cpp`)
- Cube geometry → Renderable objects: specializes
- Plane geometry → Renderable objects: specializes
- Wireframe geometry → Renderable objects: uses base
- Window and input API → GLFW platform core: implemented by (evidence: `dependencies/glfw-3.4/src/internal.h`)
