How rdappel/katanaengine works
KatanaEngine is a lightweight C++ 2D game engine. A game implementation enters through Game, whose runtime provides timing, input, resource access, rendering, and optional screen-stack management; screens handle scene-specific input, updates, and drawing. Supporting branches provide asset loading, UI controls, particles, math, persistence, platform integration, and hosted-game interop. The README documents the capabilities and usage flow; source excerpts show resource caching and screen dispatch. Some subsystem internals were not sampled, so their connections are omitted where evidence is insufficient.
Main entry points: Game.cpp Game Loop · ResourceManager.cpp Resource Cache · Screen.h Game Screen · SpriteBatch.cpp Sprite Rendering
Components 23
Game Runtime
- Game Loop
Source/Core/Game.cpp - Frame Timing
Source/Core/GameTime.h - Input State
Source/Core/Input/InputState.cpp - Screen Stack
Source/Core/Screens/ScreenManager.cpp - Game Screen
Source/Core/Screens/Screen.h
Graphics and Assets
- Sprite Rendering
Source/Core/Graphics/SpriteBatch.cpp - Camera
Source/Core/Camera.cpp - Resource Cache
Source/Core/Resource/ResourceManager.cpp - Texture Assets
Source/Core/Resource/Texture.cpp - Animations
Source/Core/Resource/AnimationSet.cpp - Effects
Source/Core/Resource/Effect.cpp - Audio Assets
Source/Core/Resource/Music.cpp - Animation Curves
Source/Core/Math/Curve.cpp
Game Interaction
- UI Controls
Source/GUI/Control.cpp - Particle System
Source/Particles/ParticleEmitter.h - Math Geometry
Source/Core/Math/Vector2.h
Platform Services
- Save Management
Source/Core/Save/SaveManager.cpp - Allegro Platform
Source/Core/Platform/Platform.h - Engine Services
Source/Core/Services/EngineServices.h
Hosting Integration
- Native Game Host
Source/Core/Hosting/GameHost.cpp - WinForms Viewport
WinForms/KatanaViewport.cs - Native Library Bridge
WinForms/NativeGameLibrary.cs
Other components
- Game Project
Connections 25
- Game Project → Game Loop: runs
- Game Loop → Input State: polls
- Game Loop → Frame Timing: tracks
Source/Core/Game.cpp - Game Loop → Sprite Rendering: draws with
- Game Loop → Screen Stack: manages
Source/Core/Game.cpp - Screen Stack → Game Screen: dispatches
Source/Core/Screens/ScreenManager.cpp - Game Loop → Resource Cache: provides
- Resource Cache → Texture Assets: loads
Source/Core/Resource/ResourceManager.cpp - Resource Cache → Animations: loads
Source/Core/Resource/ResourceManager.cpp - Resource Cache → Effects: loads
Source/Core/Resource/ResourceManager.cpp - Resource Cache → Audio Assets: loads
Source/Core/Resource/ResourceManager.cpp - Resource Cache → Animation Curves: loads
Source/Core/Resource/ResourceManager.cpp - Sprite Rendering → Camera: supports
- Sprite Rendering → Texture Assets: draws
- Game Screen → Resource Cache: loads content
- Game Screen → Input State: handles input
- Game Screen → Sprite Rendering: draws with
- Game Project → UI Controls: uses
- Game Project → Particle System: uses
- Game Loop → Allegro Platform: runs on
- Game Loop → Engine Services: configures
Source/Core/Game.cpp - Game Project → Save Management: persists state
- Game Loop → Native Game Host: supports hosting
- WinForms Viewport → Native Library Bridge: calls
WinForms/KatanaViewport.cs - Native Library Bridge → Native Game Host: bridges to