How bitbranchi/sdl-skeleton works
SDL-Skeleton is reusable SDL2 game boilerplate: the application initializes SDL and its renderer, advances input and UI state each frame, updates the camera, and presents the frame. Its reusable capabilities include camera and input helpers, cached texture and audio resources, and a stateful immediate-mode UI with widgets, themes, animation, text, and drawing. The README describes the project only at a high level; several subsystem relationships below are supported by the source index rather than inspected implementations.
Main entry points: game.cpp Game Loop · ImState.h Widget State · UIDraw.h UI Drawing · UIText.h Text Textures
Components 21
Game Runtime
- Application Entry
src/main.cpp - Game Loop
src/game.cpp - Input State
src/input.h - Camera
src/camera.h
Resources and Audio
- Texture Cache
src/resource_manager.h - Texture Definitions
src/texture.h - Sound Manager
src/sound_manager.h - Sound Definitions
src/sound.h
UI Framework
- UI Widgets
src/ui/ImWidgets.h - Widget State
src/ui/ImState.h - UI Themes
src/ui/core/Theme.h - UI Drawing
src/ui/core/UIDraw.h - UI Input
src/ui/core/UIInput.h - UI Context
src/ui/core/UIContext.h - Text Textures
src/ui/core/UIText.h - Font Cache
src/ui/core/UIFont.h - Font Definitions
src/ui/core/font.h - UI Animation
src/ui/core/Tween.h - UI Geometry
src/ui/core/UITypes.h
Utilities
- Random Helpers
src/util/randomizer.h - Vector Math
src/util/vector2.hpp
Connections 27
- Application Entry → Game Loop: starts
src/main.cpp - Game Loop → Input State: updates
src/game.cpp - Game Loop → Camera: updates
src/game.cpp - Game Loop → Texture Cache: initializes
src/game.cpp - Game Loop → Sound Manager: initializes
src/game.cpp - Game Loop → Widget State: begins frame
src/game.cpp - Game Loop → UI Drawing: presents via
src/game.cpp - Texture Cache → Texture Definitions: loads definitions
src/resource_manager.h - Sound Manager → Sound Definitions: loads definitions
src/sound_manager.h - UI Widgets → Widget State: uses state
src/ui/ImWidgets.h - Widget State → UI Themes: reads theme
src/ui/ImState.h - Widget State → UI Animation: advances animation
src/ui/ImState.h - Widget State → Text Textures: caches text
src/ui/ImState.h - Widget State → UI Drawing: resets drawing
src/ui/ImState.h - UI Drawing → Texture Cache: gets textures
src/ui/core/UIDraw.h - UI Drawing → UI Themes: uses styles
src/ui/core/UIDraw.h - UI Drawing → UI Context: uses renderer
src/ui/core/UIDraw.h - UI Drawing → Text Textures: draws text
src/ui/core/UIDraw.h - UI Context → Font Cache: clears fonts
src/ui/core/UIContext.h - Text Textures → UI Context: uses renderer
src/ui/core/UIText.h - Text Textures → Font Cache: gets fonts
src/ui/core/UIText.h - Font Cache → Font Definitions: reads paths
src/ui/core/UIFont.h - UI Input → Input State: reads input
src/ui/core/UIInput.h - Camera → UI Geometry: uses geometry
src/camera.h - Camera → Vector Math: uses vectors
src/camera.h - Input State → Vector Math: uses vectors
src/input.h - Random Helpers → Vector Math: uses vectors
src/util/randomizer.h