Toolbox Aid David Quesenberry 04/05/2026 debug-surfaces-external-integration.md
Engine consumers, sample/game maintainers, and tool integrators that need to adopt the debug platform safely without coupling to internals.
Use sample/game composition-level wiring only:
- Resolve debug flags/mode at entry (
dev|qa|prod). - Initialize debug integration only when debug is enabled.
- Pass integration into the scene layer as an optional dependency.
- Invoke update/render hooks only when integration exists.
- Dispose integration on scene exit/teardown.
Reference implementation:
samples/Phase 12 - Demo Games/Demo 1205 - Multi-System Demo/main.jssamples/Phase 12 - Demo Games/Demo 1205 - Multi-System Demo/MultiSystemDemoScene.js
- Debug is opt-in.
proddefaults to disabled.- Runtime query override is explicit (
?debug=1). - No debug integration object means no console/overlay update or render overhead.
Entry-level build/config flags:
BUILD_DEBUG_MODEBUILD_DEBUG_ENABLED
Runtime overrides:
debugquery param (0|1|true|false|on|off|yes|no)debugModequery param (dev|qa|prod)
- Overlay and console are not initialized when debug is disabled.
- Scene update/render checks remain guarded by optional integration presence.
- Debug surfaces render last only when enabled.
- No engine-core mutation required for adoption.
- No direct access to private runtime state from integration consumers.
- Track G (network) and Track H (3D) extensions are intentionally outside this contract.