SDL3 + OpenGL Engine

Hot-reloadable C++23 engine with SDL3, modern OpenGL 4.6, and a modular gameplay library.

Highlights

  • Hot-reloadable gameplay module with state save/restore
  • Modern OpenGL 4.6 renderer (sprite batching, lighting/particles, post-processing)
  • Asset packing and cross-platform bundling (Linux/Windows) with Doxygen docs

Overview #

A custom 2D engine built around SDL3 and modern OpenGL 4.6 with a hot-reloadable gameplay module. The runtime host loads a shared gameplay library, preserves state across reloads, and supports asset packs plus cross-platform bundles.

Engine prototype 1
Screenshot 1.
Engine prototype 2
Screenshot 2.

Capabilities #

  • SDL3 window/input/audio with GLAD-initialized OpenGL 4.6 context.
  • Sprite batching, tilemap streaming, 2D camera, dynamic lighting, particles, color grading LUTs, and CRT post-processing.
  • GUI stack for HUD/inventory/stats; gameplay controllers for movement, combat, AI, progression, and persistence.
  • Hot-reloadable gameplay module: state is serialized, module is reloaded, then state is restored.
  • Asset packer consolidates runtime assets into a single archive; toggles between packed and loose assets at runtime.
  • Packaging targets for Linux and Windows (cross-built via MinGW-w64); bundles include runtime + engine + gameplay + assets.
  • Doxygen API docs for engine and gameplay modules.

Architecture (brief) #

  • Engine (libengine): rendering (sprite batch + shaders), input, audio, assets, platform/logging, lighting/particles, virtual resolution, rendering callbacks (draw/lighting/overlay).
  • Game module (libcorvus_core): scenes (menu, gameplay, UI), asset policy, save/load, state serialization, exposed C exports for init/run/shutdown.
  • Runtime host: entry/main, hot-reload loop, asset root rebasing, env overrides for library/asset pack selection.
  • Assets/Tools: asset packer, release/bundle helpers, cross files for MinGW.
flowchart TD
  Host["<b>Runtime Host</b><br/>entry / main<br/>hot reload loop<br/>asset root rebasing<br/>env overrides"]
  Game["<b>Game Module</b> (libcorvus_core)<br/>scenes (menu / gameplay / UI)<br/>controllers (movement / combat / AI)<br/>progression, persistence<br/>exports: init / run / shutdown"]
  Engine["<b>Engine</b> (libengine)<br/>SDL3 window / input / audio<br/>OpenGL 4.6 renderer: sprite batch,<br/>shaders, post-processing<br/>camera / scenes / virtual resolution<br/>lighting, particles, LUT color grading<br/>asset manager (pack vs filesystem)"]
  OS["OS / GPU"]
  Assets["Assets (pack / fs)"]
  Audio["Audio / Input"]

  Host -->|"load + init, hot reload<br/>(state save / restore)"| Game
  Game -->|"EngineInitConfig<br/>render / update callbacks"| Engine
  Engine --> OS
  Engine --> Assets
  Engine --> Audio

Tooling and builds (high level) #

  • Meson/Ninja project; single target builds engine, runtime host, and hot-reloadable gameplay module.
  • Asset packer target bundles assets/ into a pack for all release bundles.
  • Cross-builds to Windows from Linux via MinGW-w64 with dedicated cross files; bundles include runtime, engine, gameplay, assets, and needed DLLs.
  • Doxygen config ships with the repo for generating API docs.

Notes #

  • Requires GPU with OpenGL 4.6 drivers.
  • SDL3/SDL3_ttf/SDL3_mixer dev libraries for native Linux builds; Windows bundles embed SDL via the bootstrap step.