# curtidor/consolegraphx architecture

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

- Interactive diagram: https://gitdiagram.com/curtidor/consolegraphx
- Repository: https://github.com/curtidor/consolegraphx
- Video tour (about a minute): https://gitdiagram.com/curtidor/consolegraphx/video

## Overview

ConsoleGraphX is a Windows-console 2D game engine with an ECS runtime, scene scripting, sprite/map resources, and multi-console editor/runtime views. The main workflow loads a game module, registers and loads scenes, initializes entities and resources, updates systems, then renders to a console screen. The graph also captures the documented sprite/map authoring and window/logging capabilities. Source excerpts show the engine loop, editor setup, map-driven scene construction, and window-handler buffer sharing; unshown subsystem links are omitted rather than inferred.

Main entry points: [`ConsoleGraphX/Engine/Core/Application/engine.cpp`](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/engine.cpp) (Engine orchestration), [`ConsoleGraphX/Engine/Scene/scene.h`](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Scene/scene.h) (Scene management), [`Editor/Editor.cpp`](https://github.com/curtidor/consolegraphx/blob/main/Editor/Editor.cpp) (Editor application), [`WindowHandler/window_handler.cpp`](https://github.com/curtidor/consolegraphx/blob/main/WindowHandler/window_handler.cpp) (Window process)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_runtime_app["Standalone launcher<br/>[RunTime.cpp]"]
  node_game_module["Game module<br/>[IGameModule.h]"]
  node_application["Application loop<br/>[application.cpp]"]
  node_engine["Engine orchestration<br/>[engine.cpp]"]
  node_systems["Runtime systems"]
  node_input["Input system<br/>[input_system.h]"]
  node_ecs["Entities and components<br/>[entity.h]"]
  node_script["Script components<br/>[script.h]"]
end

subgraph group_content["Scenes and assets"]
  node_scenes["Scene management<br/>[scene.h]"]
  node_map_loader["Map loading<br/>[map_loader.h]"]
  node_resources["Resource pools<br/>[resource_manager.h]"]
  node_sprites["Sprite components<br/>[sprite.h]"]
  node_textures["Texture loading<br/>[texture_loader.h]"]
  node_sandbox_scenes["Sample scenes<br/>[main_scene.h]"]
end

subgraph group_graphics["Rendering and windows"]
  node_renderer["Sprite renderer<br/>[renderer.cpp]"]
  node_screen["Console screen<br/>[screen.h]"]
  node_window_manager["Window manager<br/>[window_manager.cpp]"]
  node_palette["Palette control<br/>[palette.h]"]
end

subgraph group_tools["Editor and authoring"]
  node_editor_app["Editor application<br/>[Editor.cpp]"]
  node_world_editor["World editor<br/>[world_editor.py]"]
  node_sprite_maker["Sprite maker<br/>[sprite_maker.py]"]
end

subgraph group_platform["Platform services"]
  node_window_handler["Window process<br/>[window_handler.cpp]"]
  node_wincore["Windows services<br/>[WinCore.h]"]
  node_profiler["Profiler<br/>[profiler.h]"]
  node_logger["Logger<br/>[logger_manager.h]"]
  node_term_log["TermLog client<br/>[client.h]"]
end

node_developer(("Game developer"))
node_console_user(("Player"))

node_developer -->|"authors with"| node_editor_app
node_editor_app -->|"loads"| node_game_module
node_runtime_app -->|"loads"| node_game_module
node_editor_app -->|"runs"| node_application
node_runtime_app -->|"runs"| node_application
node_game_module -.->|"registers scenes"| node_scenes
node_application -->|"delegates runtime"| node_engine
node_engine -->|"polls"| node_input
node_engine -->|"updates"| node_systems
node_systems -.->|"updates"| node_scenes
node_scenes -->|"creates entities"| node_ecs
node_scenes -->|"loads map data"| node_map_loader
node_scenes -->|"creates resources"| node_resources
node_resources -.->|"loads textures"| node_textures
node_ecs -->|"attaches"| node_sprites
node_engine -->|"draws sprites"| node_renderer
node_renderer -->|"renders to"| node_screen
node_engine -->|"fills and presents"| node_screen
node_engine -->|"creates window"| node_window_manager
node_window_manager -.->|"spawns process"| node_window_handler
node_window_handler -->|"uses"| node_wincore
node_window_handler -->|"presents shared buffer"| node_screen
node_screen -->|"sets colors"| node_palette
node_editor_app -->|"attaches metrics view"| node_profiler
node_editor_app -->|"attaches log view"| node_logger
node_window_handler -->|"includes client"| node_term_log
node_developer -->|"edits maps"| node_world_editor
node_developer -->|"creates sprites"| node_sprite_maker
node_console_user -->|"starts game"| node_runtime_app
node_sandbox_scenes -->|"implements scenes"| node_scenes

click node_editor_app "https://github.com/curtidor/consolegraphx/blob/main/Editor/Editor.cpp"
click node_runtime_app "https://github.com/curtidor/consolegraphx/blob/main/RunTime/RunTime.cpp"
click node_game_module "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/IGameModule.h"
click node_application "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/application.cpp"
click node_engine "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/engine.cpp"
click node_systems "https://github.com/curtidor/consolegraphx/tree/main/ConsoleGraphX/Engine/Systems"
click node_input "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Systems/input_system.h"
click node_ecs "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/entity.h"
click node_script "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Components/script.h"
click node_scenes "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Scene/scene.h"
click node_map_loader "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/map_loader.h"
click node_resources "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/resource_manager.h"
click node_sprites "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Components/PositionComponents/sprite.h"
click node_textures "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/texture_loader.h"
click node_sandbox_scenes "https://github.com/curtidor/consolegraphx/blob/main/Sandbox/main_scene.h"
click node_renderer "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/renderer.cpp"
click node_screen "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/ScreenGraphics/screen.h"
click node_window_manager "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Window/window_manager.cpp"
click node_window_handler "https://github.com/curtidor/consolegraphx/blob/main/WindowHandler/window_handler.cpp"
click node_wincore "https://github.com/curtidor/consolegraphx/blob/main/WinCore/WinCore.h"
click node_palette "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/palette.h"
click node_profiler "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Profiler/profiler.h"
click node_logger "https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Logger/logger_manager.h"
click node_term_log "https://github.com/curtidor/consolegraphx/blob/main/External/TermLog/Client/client.h"
click node_world_editor "https://github.com/curtidor/consolegraphx/blob/main/Tools/WorldEditor/world_editor.py"
click node_sprite_maker "https://github.com/curtidor/consolegraphx/blob/main/Tools/SpriteMaker/sprite_maker.py"

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_runtime_app,node_game_module,node_application,node_engine,node_systems,node_input,node_ecs,node_script toneBlue
class node_scenes,node_map_loader,node_resources,node_sprites,node_textures,node_sandbox_scenes toneAmber
class node_renderer,node_screen,node_window_manager,node_palette toneMint
class node_editor_app,node_world_editor,node_sprite_maker toneRose
class node_window_handler,node_wincore,node_profiler,node_logger,node_term_log,node_developer,node_console_user toneIndigo
```

## Components

### Game runtime

- [Standalone launcher](https://github.com/curtidor/consolegraphx/blob/main/RunTime/RunTime.cpp): `RunTime/RunTime.cpp`
- [Game module](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/IGameModule.h): `ConsoleGraphX/Engine/Core/Application/IGameModule.h`
- [Application loop](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/application.cpp): `ConsoleGraphX/Engine/Core/Application/application.cpp`
- [Engine orchestration](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Application/engine.cpp): `ConsoleGraphX/Engine/Core/Application/engine.cpp`
- [Runtime systems](https://github.com/curtidor/consolegraphx/tree/main/ConsoleGraphX/Engine/Systems): `ConsoleGraphX/Engine/Systems`
- [Input system](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Systems/input_system.h): `ConsoleGraphX/Engine/Systems/input_system.h`
- [Entities and components](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/entity.h): `ConsoleGraphX/Engine/Core/entity.h`
- [Script components](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Components/script.h): `ConsoleGraphX/Engine/Components/script.h`

### Scenes and assets

- [Scene management](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Scene/scene.h): `ConsoleGraphX/Engine/Scene/scene.h`
- [Map loading](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/map_loader.h): `ConsoleGraphX/Engine/Resources/map_loader.h`
- [Resource pools](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/resource_manager.h): `ConsoleGraphX/Engine/Resources/resource_manager.h`
- [Sprite components](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Components/PositionComponents/sprite.h): `ConsoleGraphX/Engine/Components/PositionComponents/sprite.h`
- [Texture loading](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Resources/texture_loader.h): `ConsoleGraphX/Engine/Resources/texture_loader.h`
- [Sample scenes](https://github.com/curtidor/consolegraphx/blob/main/Sandbox/main_scene.h): `Sandbox/main_scene.h`

### Rendering and windows

- [Sprite renderer](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/renderer.cpp): `ConsoleGraphX/Engine/Graphics/renderer.cpp`
- [Console screen](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/ScreenGraphics/screen.h): `ConsoleGraphX/Engine/Graphics/ScreenGraphics/screen.h`
- [Window manager](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Window/window_manager.cpp): `ConsoleGraphX/Engine/Core/Window/window_manager.cpp`
- [Palette control](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Graphics/palette.h): `ConsoleGraphX/Engine/Graphics/palette.h`

### Editor and authoring

- [Editor application](https://github.com/curtidor/consolegraphx/blob/main/Editor/Editor.cpp): `Editor/Editor.cpp`
- [World editor](https://github.com/curtidor/consolegraphx/blob/main/Tools/WorldEditor/world_editor.py): `Tools/WorldEditor/world_editor.py`
- [Sprite maker](https://github.com/curtidor/consolegraphx/blob/main/Tools/SpriteMaker/sprite_maker.py): `Tools/SpriteMaker/sprite_maker.py`

### Platform services

- [Window process](https://github.com/curtidor/consolegraphx/blob/main/WindowHandler/window_handler.cpp): `WindowHandler/window_handler.cpp`
- [Windows services](https://github.com/curtidor/consolegraphx/blob/main/WinCore/WinCore.h): `WinCore/WinCore.h`
- [Profiler](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Profiler/profiler.h): `ConsoleGraphX/Engine/Core/Profiler/profiler.h`
- [Logger](https://github.com/curtidor/consolegraphx/blob/main/ConsoleGraphX/Engine/Core/Logger/logger_manager.h): `ConsoleGraphX/Engine/Core/Logger/logger_manager.h`
- [TermLog client](https://github.com/curtidor/consolegraphx/blob/main/External/TermLog/Client/client.h): `External/TermLog/Client/client.h`

### Other components

- **Game developer**
- **Player**

## Connections

- Game developer → Editor application: authors with (evidence: `README.md`)
- Editor application → Game module: loads (evidence: `Editor/Editor.cpp`)
- Standalone launcher → Game module: loads (evidence: `RunTime/RunTime.cpp`)
- Editor application → Application loop: runs (evidence: `Editor/Editor.cpp`)
- Standalone launcher → Application loop: runs (evidence: `RunTime/RunTime.cpp`)
- Game module → Scene management: registers scenes
- Application loop → Engine orchestration: delegates runtime (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Engine orchestration → Input system: polls (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Engine orchestration → Runtime systems: updates (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Runtime systems → Scene management: updates
- Scene management → Entities and components: creates entities (evidence: `Sandbox/main_scene.h`)
- Scene management → Map loading: loads map data (evidence: `Sandbox/main_scene.h`)
- Scene management → Resource pools: creates resources
- Resource pools → Texture loading: loads textures
- Entities and components → Sprite components: attaches (evidence: `Sandbox/main_scene.h`)
- Engine orchestration → Sprite renderer: draws sprites (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Sprite renderer → Console screen: renders to
- Engine orchestration → Console screen: fills and presents (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Engine orchestration → Window manager: creates window (evidence: `ConsoleGraphX/Engine/Core/Application/engine.cpp`)
- Window manager → Window process: spawns process
- Window process → Windows services: uses (evidence: `WindowHandler/window_handler.cpp`)
- Window process → Console screen: presents shared buffer (evidence: `WindowHandler/window_handler.cpp`)
- Console screen → Palette control: sets colors (evidence: `ConsoleGraphX/Engine/Graphics/ScreenGraphics/screen.h`)
- Editor application → Profiler: attaches metrics view (evidence: `Editor/Editor.cpp`)
- Editor application → Logger: attaches log view (evidence: `Editor/Editor.cpp`)
- Window process → TermLog client: includes client (evidence: `WindowHandler/window_handler.cpp`)
- Game developer → World editor: edits maps (evidence: `README.md`)
- Game developer → Sprite maker: creates sprites (evidence: `README.md`)
- Player → Standalone launcher: starts game (evidence: `README.md`)
- Sample scenes → Scene management: implements scenes (evidence: `Sandbox/main_scene.h`)
