How floooh/sokol works
Main Components
a) Core Libraries Layer:
• sokol_gfx.h (3D-API wrapper)
• sokol_app.h (application framework)
• sokol_time.h (time measurement)
• sokol_audio.h (audio playback)
• sokol_fetch.h (data streaming)
• sokol_args.h (argument parsing)
• sokol_log.h (logging system)
b) Utility Libraries Layer:
• UI-related (sokol_imgui.h, sokol_nuklear.h)
• Graphics utilities (sokol_gl.h, sokol_shape.h, sokol_color.h)
• Debug tools (sokol_debugtext.h, sokol_gfx_imgui.h)
• Memory tracking (sokol_memtrack.h)
• Font handling (sokol_fontstash.h)
• Animation (sokol_spine.h)
c) Platform Support Layer:
• Windows (Win32)
• macOS/iOS (Metal)
• Linux (X11)
• Web (WebAssembly)
• Android
• UWP
d) Graphics Backend Layer:
• OpenGL/GLES3/WebGL2
• Metal
• Direct3D 11
• WebGPU
Relationships and Data Flow
[Platform Layer] → [Core Libraries] ← [Utility Libraries]
• ↓
• [Graphics Backend Layer]
┌─ Platform Layer ─────────────────────────┐
• Win32 │ MacOS │ Linux │ Web │ Android │
• ┬─────────────────────────┘
• ↓
┌─ Core Libraries ─────────────────────────┐
• ┌─────────┐ ┌─────────┐ ┌────────────┐ │
• sokol_gfx│ │sokol_app│ │sokol_audio │ │
• ┘ └─────────┘ └────────────┘ │
• ┌─────────┐ ┌─────────┐ ┌────────────┐ │
• sokol_time│ │sokol_log│ │sokol_fetch│ │
• ┘ └─────────┘ └────────────┘ │
• ┬─────────────────────┘
• ↓
┌─ Graphics Backends ────────────────────┐
• OpenGL │ Metal │ D3D11 │ WebGPU │
• ┘
Additional Elements
• Version/compatibility information
• Binding support for different languages
• Test coverage paths
Implementation Notes
• Clear separation between core and utility components
• Minimal dependencies between components
• Build and test workflow connections
Remember to maintain a balance between detail and clarity, as Sokol's strength lies in its simplicity and modularity while still providing comprehensive functionality.