# rohithnafeel/arc-engine architecture

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

- Interactive diagram: https://gitdiagram.com/rohithnafeel/arc-engine
- Repository: https://github.com/rohithnafeel/arc-engine

## Overview

Arc Engine is a developing C++/OpenGL 2D game engine with an ImGui editor. The current user path is Sandbox startup → Application window and frame loop → attached layers, including the EditorLayer, which renders into a framebuffer and presents it in a dockable editor viewport alongside hierarchy, inspector, and console panels. The README also lists GLFW/GLAD integration and docking as current capabilities. Physics, scenes, ECS, audio, assets, and other roadmap items have no implementation paths in the supplied tree and are omitted. Panel and dockspace call relationships are supported by the EditorLayer source; other unsampled subsystem details are not inferred.

Main entry points: [`Engine/Core/Application.cpp`](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/Application.cpp) (Application loop), [`Engine/Editor/EditorLayer.cpp`](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/EditorLayer.cpp) (Editor layer), [`Sandbox/src/SandboxApp.cpp`](https://github.com/rohithnafeel/arc-engine/blob/main/Sandbox/src/SandboxApp.cpp) (Sandbox app), [`Engine/src/Renderer/Framebuffer.cpp`](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/src/Renderer/Framebuffer.cpp) (Framebuffer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Core"]
  node_application["Application loop<br/>[Application.cpp]"]
  node_layerstack["Layer stack<br/>[LayerStack.cpp]"]
  node_layer["Layer lifecycle<br/>[Layer.cpp]"]
  node_glfw["GLFW windowing<br/>[glfw3.h]"]
end

subgraph group_render["Rendering"]
  node_framebuffer["Framebuffer<br/>[Framebuffer.cpp]"]
  node_renderer["OpenGL renderer<br/>[Renderer.cpp]"]
  node_glad["GLAD loader<br/>[glad.h]"]
end

subgraph group_editor["Editor UI"]
  node_editorlayer["Editor layer<br/>[EditorLayer.cpp]"]
  node_dockspace["Dockspace<br/>[Dockspace.cpp]"]
  node_viewport["Viewport panel<br/>[ViewportPanel.cpp]"]
  node_hierarchy["Hierarchy panel<br/>[HierarchyPanel.cpp]"]
  node_inspector["Inspector panel<br/>[InspectorPanel.cpp]"]
  node_console["Console panel<br/>[ConsolePanel.cpp]"]
  node_imgui["ImGui UI<br/>[imgui.cpp]"]
  node_imguiopengl["ImGui OpenGL backend"]
end

subgraph group_sandbox["Sandbox App"]
  node_main["Sandbox entry<br/>[main.cpp]"]
  node_sandboxapp["Sandbox app<br/>[SandboxApp.cpp]"]
end

node_user(("Developer"))

node_user -->|"launches"| node_main
node_main -->|"constructs"| node_sandboxapp
node_sandboxapp -->|"inherits and runs"| node_application
node_sandboxapp -->|"adds layer"| node_editorlayer
node_application -->|"creates window"| node_glfw
node_application -->|"loads OpenGL"| node_glad
node_application -->|"initializes"| node_renderer
node_application -->|"starts frame"| node_imgui
node_application -->|"renders draw data"| node_imguiopengl
node_application -->|"dispatches layers"| node_layerstack
node_layerstack -->|"stores layers"| node_layer
node_application -->|"polls and swaps"| node_glfw
node_editorlayer -->|"creates and binds"| node_framebuffer
node_editorlayer -->|"draws frame"| node_renderer
node_editorlayer -->|"opens and closes"| node_dockspace
node_editorlayer -->|"renders framebuffer"| node_viewport
node_editorlayer -->|"renders"| node_hierarchy
node_editorlayer -->|"renders"| node_inspector
node_editorlayer -->|"renders"| node_console
node_viewport -->|"displays attachment"| node_framebuffer
node_framebuffer -.->|"receives rendering"| node_renderer

click node_main "https://github.com/rohithnafeel/arc-engine/blob/main/Sandbox/src/main.cpp"
click node_sandboxapp "https://github.com/rohithnafeel/arc-engine/blob/main/Sandbox/src/SandboxApp.cpp"
click node_application "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/Application.cpp"
click node_layerstack "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/LayerStack.cpp"
click node_layer "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/Layer.cpp"
click node_editorlayer "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/EditorLayer.cpp"
click node_dockspace "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Dockspace.cpp"
click node_viewport "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/ViewportPanel.cpp"
click node_hierarchy "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/HierarchyPanel.cpp"
click node_inspector "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/InspectorPanel.cpp"
click node_console "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/ConsolePanel.cpp"
click node_framebuffer "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/src/Renderer/Framebuffer.cpp"
click node_renderer "https://github.com/rohithnafeel/arc-engine/blob/main/Engine/include/Arc/Renderer/Renderer.cpp"
click node_glfw "https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/GLFW/include/GLFW/glfw3.h"
click node_glad "https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/GLAD/include/glad/glad.h"
click node_imgui "https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/ImGui/imgui.cpp"
click node_imguiopengl "https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/ImGui/backends/imgui_impl_opengl3.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_application,node_layerstack,node_layer,node_glfw toneBlue
class node_framebuffer,node_renderer,node_glad toneAmber
class node_editorlayer,node_dockspace,node_viewport,node_hierarchy,node_inspector,node_console,node_imgui,node_imguiopengl toneMint
class node_main,node_sandboxapp toneRose
class node_user toneIndigo
```

## Components

### Runtime Core

- [Application loop](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/Application.cpp): `Engine/Core/Application.cpp`
- [Layer stack](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/LayerStack.cpp): `Engine/Core/LayerStack.cpp`
- [Layer lifecycle](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Core/Layer.cpp): `Engine/Core/Layer.cpp`
- [GLFW windowing](https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/GLFW/include/GLFW/glfw3.h): `ThirdParty/GLFW/include/GLFW/glfw3.h`

### Rendering

- [Framebuffer](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/src/Renderer/Framebuffer.cpp): `Engine/src/Renderer/Framebuffer.cpp`
- [OpenGL renderer](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/include/Arc/Renderer/Renderer.cpp): `Engine/include/Arc/Renderer/Renderer.cpp`
- [GLAD loader](https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/GLAD/include/glad/glad.h): `ThirdParty/GLAD/include/glad/glad.h`

### Editor UI

- [Editor layer](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/EditorLayer.cpp): `Engine/Editor/EditorLayer.cpp`
- [Dockspace](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Dockspace.cpp): `Engine/Editor/Dockspace.cpp`
- [Viewport panel](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/ViewportPanel.cpp): `Engine/Editor/Panels/ViewportPanel.cpp`
- [Hierarchy panel](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/HierarchyPanel.cpp): `Engine/Editor/Panels/HierarchyPanel.cpp`
- [Inspector panel](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/InspectorPanel.cpp): `Engine/Editor/Panels/InspectorPanel.cpp`
- [Console panel](https://github.com/rohithnafeel/arc-engine/blob/main/Engine/Editor/Panels/ConsolePanel.cpp): `Engine/Editor/Panels/ConsolePanel.cpp`
- [ImGui UI](https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/ImGui/imgui.cpp): `ThirdParty/ImGui/imgui.cpp`
- [ImGui OpenGL backend](https://github.com/rohithnafeel/arc-engine/blob/main/ThirdParty/ImGui/backends/imgui_impl_opengl3.cpp): `ThirdParty/ImGui/backends/imgui_impl_opengl3.cpp`

### Sandbox App

- [Sandbox entry](https://github.com/rohithnafeel/arc-engine/blob/main/Sandbox/src/main.cpp): `Sandbox/src/main.cpp`
- [Sandbox app](https://github.com/rohithnafeel/arc-engine/blob/main/Sandbox/src/SandboxApp.cpp): `Sandbox/src/SandboxApp.cpp`

### Other components

- **Developer**

## Connections

- Developer → Sandbox entry: launches (evidence: `Sandbox/src/main.cpp`)
- Sandbox entry → Sandbox app: constructs (evidence: `Sandbox/src/main.cpp`)
- Sandbox app → Application loop: inherits and runs
- Sandbox app → Editor layer: adds layer (evidence: `Sandbox/src/SandboxApp.cpp`)
- Application loop → GLFW windowing: creates window (evidence: `Engine/Core/Application.cpp`)
- Application loop → GLAD loader: loads OpenGL (evidence: `Engine/Core/Application.cpp`)
- Application loop → OpenGL renderer: initializes (evidence: `Engine/Core/Application.cpp`)
- Application loop → ImGui UI: starts frame (evidence: `Engine/Core/Application.cpp`)
- Application loop → ImGui OpenGL backend: renders draw data (evidence: `Engine/Core/Application.cpp`)
- Application loop → Layer stack: dispatches layers (evidence: `Engine/Core/Application.cpp`)
- Layer stack → Layer lifecycle: stores layers
- Application loop → GLFW windowing: polls and swaps (evidence: `Engine/Core/Application.cpp`)
- Editor layer → Framebuffer: creates and binds (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → OpenGL renderer: draws frame (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → Dockspace: opens and closes (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → Viewport panel: renders framebuffer (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → Hierarchy panel: renders (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → Inspector panel: renders (evidence: `Engine/Editor/EditorLayer.cpp`)
- Editor layer → Console panel: renders (evidence: `Engine/Editor/EditorLayer.cpp`)
- Viewport panel → Framebuffer: displays attachment (evidence: `Engine/Editor/Panels/ViewportPanel.cpp`)
- Framebuffer → OpenGL renderer: receives rendering
