# constref/sdl3-gamedev architecture

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

- Interactive diagram: https://gitdiagram.com/constref/sdl3-gamedev
- Repository: https://github.com/constref/sdl3-gamedev

## Overview

This repository is an SDL3-based 2D game-engine demo, with platformer-oriented animation, physics, collisions, input, rendering, and TMX map support. Its intended runtime centers on an SDL window and game-world updates, but the platformer demo sources and main loop are not included in the supplied tree or excerpts, so those orchestration links remain unverified. The graph preserves the documented-by-source engine capabilities and the supported resource/map relationships; dashed links mark likely runtime interactions not established by the available evidence.

Main entry points: [`sdl3-demo/engine/components/component.h`](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/component.h) (Component Base), [`sdl3-demo/engine/resources.h`](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/resources.h) (Resource Manager), [`sdl3-demo/engine/engine.h`](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/engine.h) (Engine Runtime), [`sdl3-demo/engine/world.h`](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/world.h) (Game World)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["SDL Platform"]
  node_sdl["SDL State<br/>[sdlstate.h]"]
  node_engine["Engine Runtime<br/>[engine.h]"]
end

subgraph group_world["World Components"]
  node_world["Game World<br/>[world.h]"]
  node_node["Scene Nodes<br/>[node.h]"]
  node_component["Component Base<br/>[component.h]"]
  node_collision["Collision Data"]
  node_physics["Physics Data<br/>[physicscomponent.h]"]
  node_sprite["Sprite Component<br/>[spritecomponent.h]"]
  node_input["Input Component<br/>[inputcomponent.h]"]
  node_animation_component["Animation Component"]
  node_component_store["Component Store<br/>[componentstore.h]"]
end

subgraph group_systems["Runtime Systems"]
  node_collision_system["Collision System"]
  node_physics_system["Physics System<br/>[physicssystem.cpp]"]
  node_input_system["Input System<br/>[inputsystem.cpp]"]
  node_camera_system["Camera System"]
  node_animation_system["Animation System"]
  node_render_system["Sprite Renderer"]
  node_timer_system["Timer System<br/>[timersystem.cpp]"]
end

subgraph group_assets["Assets and Messaging"]
  node_resources["Resource Manager<br/>[resources.h]"]
  node_animation["Animation Data<br/>[animation.h]"]
  node_tmx_loader["TMX Map Loader<br/>[tmx.cpp]"]
  node_tmx_map["TMX Map Model<br/>[tmx.h]"]
  node_commands["Commands<br/>[commands.h]"]
  node_events["Events<br/>[events.h]"]
  node_event_queue["Event Queue<br/>[eventqueue.cpp]"]
  node_timer["Timer<br/>[timer.h]"]
end

node_player(("Game Player"))

node_player -.->|"runs"| node_engine
node_engine -.->|"uses"| node_sdl
node_engine -.->|"updates"| node_world
node_world -.->|"manages"| node_node
node_node -.->|"attaches"| node_component
node_collision -->|"extends"| node_component
node_physics -->|"extends"| node_component
node_animation_component -->|"extends"| node_component
node_world -.->|"stores"| node_component_store
node_collision_system -.->|"processes"| node_collision
node_physics_system -.->|"processes"| node_physics
node_input_system -.->|"reads"| node_input
node_camera_system -.->|"updates view"| node_sdl
node_animation_system -.->|"advances"| node_animation_component
node_render_system -.->|"renders"| node_sprite
node_timer_system -.->|"steps"| node_timer
node_resources -->|"uses state"| node_sdl
node_resources -->|"creates"| node_animation
node_resources -->|"loads map"| node_tmx_loader
node_tmx_loader -->|"constructs"| node_tmx_map
node_animation -->|"uses"| node_timer
node_commands -.->|"affects"| node_physics
node_collision -->|"enqueues events"| node_event_queue
node_component -->|"tracks"| node_timer
node_component -.->|"queues timeouts"| node_event_queue

click node_sdl "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/sdlstate.h"
click node_engine "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/engine.h"
click node_world "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/world.h"
click node_node "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/node.h"
click node_component "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/component.h"
click node_collision "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/collisioncomponent.h"
click node_physics "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/physicscomponent.h"
click node_sprite "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/spritecomponent.h"
click node_input "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/inputcomponent.h"
click node_animation_component "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/animationcomponent.h"
click node_component_store "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/componentstore.h"
click node_collision_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/collisionsystem.cpp"
click node_physics_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/physicssystem.cpp"
click node_input_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/inputsystem.cpp"
click node_camera_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/basiccamerasystem.cpp"
click node_animation_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/spriteanimationsystem.cpp"
click node_render_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/spriterendersystem.cpp"
click node_timer_system "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/timersystem.cpp"
click node_resources "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/resources.h"
click node_animation "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/animation.h"
click node_tmx_loader "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/tmx.cpp"
click node_tmx_map "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/tmx.h"
click node_commands "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/commands.h"
click node_events "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/events.h"
click node_event_queue "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/eventqueue.cpp"
click node_timer "https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/timer.h"

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_sdl,node_engine toneBlue
class node_world,node_node,node_component,node_collision,node_physics,node_sprite,node_input,node_animation_component,node_component_store toneAmber
class node_collision_system,node_physics_system,node_input_system,node_camera_system,node_animation_system,node_render_system,node_timer_system toneMint
class node_resources,node_animation,node_tmx_loader,node_tmx_map,node_commands,node_events,node_event_queue,node_timer toneRose
class node_player toneIndigo
```

## Components

### SDL Platform

- [SDL State](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/sdlstate.h): `sdl3-demo/engine/sdlstate.h`
- [Engine Runtime](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/engine.h): `sdl3-demo/engine/engine.h`

### World Components

- [Game World](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/world.h): `sdl3-demo/engine/world.h`
- [Scene Nodes](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/node.h): `sdl3-demo/engine/node.h`
- [Component Base](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/component.h): `sdl3-demo/engine/components/component.h`
- [Collision Data](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/collisioncomponent.h): `sdl3-demo/engine/components/collisioncomponent.h`
- [Physics Data](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/physicscomponent.h): `sdl3-demo/engine/components/physicscomponent.h`
- [Sprite Component](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/spritecomponent.h): `sdl3-demo/engine/components/spritecomponent.h`
- [Input Component](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/inputcomponent.h): `sdl3-demo/engine/components/inputcomponent.h`
- [Animation Component](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/animationcomponent.h): `sdl3-demo/engine/components/animationcomponent.h`
- [Component Store](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/components/componentstore.h): `sdl3-demo/engine/components/componentstore.h`

### Runtime Systems

- [Collision System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/collisionsystem.cpp): `sdl3-demo/engine/systems/collisionsystem.cpp`
- [Physics System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/physicssystem.cpp): `sdl3-demo/engine/systems/physicssystem.cpp`
- [Input System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/inputsystem.cpp): `sdl3-demo/engine/systems/inputsystem.cpp`
- [Camera System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/basiccamerasystem.cpp): `sdl3-demo/engine/systems/basiccamerasystem.cpp`
- [Animation System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/spriteanimationsystem.cpp): `sdl3-demo/engine/systems/spriteanimationsystem.cpp`
- [Sprite Renderer](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/spriterendersystem.cpp): `sdl3-demo/engine/systems/spriterendersystem.cpp`
- [Timer System](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/systems/timersystem.cpp): `sdl3-demo/engine/systems/timersystem.cpp`

### Assets and Messaging

- [Resource Manager](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/resources.h): `sdl3-demo/engine/resources.h`
- [Animation Data](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/animation.h): `sdl3-demo/engine/animation.h`
- [TMX Map Loader](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/tmx.cpp): `sdl3-demo/engine/tmx.cpp`
- [TMX Map Model](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/tmx.h): `sdl3-demo/engine/tmx.h`
- [Commands](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/commands.h): `sdl3-demo/engine/messaging/commands.h`
- [Events](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/events.h): `sdl3-demo/engine/messaging/events.h`
- [Event Queue](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/messaging/eventqueue.cpp): `sdl3-demo/engine/messaging/eventqueue.cpp`
- [Timer](https://github.com/constref/sdl3-gamedev/blob/master/sdl3-demo/engine/timer.h): `sdl3-demo/engine/timer.h`

### Other components

- **Game Player**

## Connections

- Game Player → Engine Runtime: runs
- Engine Runtime → SDL State: uses
- Engine Runtime → Game World: updates
- Game World → Scene Nodes: manages
- Scene Nodes → Component Base: attaches
- Collision Data → Component Base: extends (evidence: `sdl3-demo/engine/components/collisioncomponent.h`)
- Physics Data → Component Base: extends (evidence: `sdl3-demo/engine/components/physicscomponent.h`)
- Animation Component → Component Base: extends (evidence: `sdl3-demo/engine/components/animationcomponent.h`)
- Game World → Component Store: stores
- Collision System → Collision Data: processes
- Physics System → Physics Data: processes
- Input System → Input Component: reads
- Camera System → SDL State: updates view
- Animation System → Animation Component: advances
- Sprite Renderer → Sprite Component: renders
- Timer System → Timer: steps
- Resource Manager → SDL State: uses state (evidence: `sdl3-demo/engine/resources.h`)
- Resource Manager → Animation Data: creates (evidence: `sdl3-demo/engine/resources.h`)
- Resource Manager → TMX Map Loader: loads map (evidence: `sdl3-demo/engine/resources.h`)
- TMX Map Loader → TMX Map Model: constructs (evidence: `sdl3-demo/engine/tmx.cpp`)
- Animation Data → Timer: uses (evidence: `sdl3-demo/engine/animation.h`)
- Commands → Physics Data: affects
- Collision Data → Event Queue: enqueues events
- Component Base → Timer: tracks
- Component Base → Event Queue: queues timeouts
