How h4tch/basic-sdl2-demo works
Main Components
a) Core Engine Layer:
• Engine class (engine.h/cpp) as the central coordinator
• Window management system (window.h/cpp)
• Timer system (timer.h)
b) Graphics System:
• Sprite rendering (animated_sprite.h/cpp)
• Camera system (camera.h)
c) Game Object System:
• Base Object class (object.h/cpp)
• Component System:
• Base Component (component/component.h)
• Animation Component (component/animation.h/cpp)
• Physics Component (component/physics.h/cpp)
d) Resource Management:
• System (map.h)
• Asset loading (data/images directory)
[Top Layer]
Game Logic Layer
• Object Management
• Component System
[Middle Layer]
Engine Core
• Main Game Loop
• Timer System
• Resource Management
[Bottom Layer]
SDL2 Framework
• Graphics (SDL2_image)
• Text Rendering (SDL2_ttf)
• Window Management
Specific Implementation Details
• Component-based architecture pattern
• Separation between engine core and game-specific logic
• Resource management flow
• Rendering pipeline from sprite management to window display
Key Architectural Patterns to Highlight
• Component-based design pattern (shown in component/ directory)
• Game loop pattern (in engine.cpp)
• Resource management system
• Event-driven architecture (SDL2 events)