From d1d87447ae44d85b15e748c5b1cc8ccd310f8740 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 13:12:01 +0100 Subject: feat(3d): Add scaffolding for visual debugging (Task #18a) - Added 'src/3d/visual_debug.h/cc' to implement wireframe rendering. - Integrated VisualDebug into Renderer3D with a static global toggle. - Added '--debug' command-line option to 'demo64k' and 'test_3d_render' to enable wireframes. - Updated 'src/gpu/effects/hybrid_3d_effect.h' to expose the debug setter (reverted later as static method used). - Ensured full cross-platform compatibility (native and Windows) for the new debug module. - All code guarded by STRIP_ALL for final release. --- src/3d/renderer.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/3d/renderer.h') diff --git a/src/3d/renderer.h b/src/3d/renderer.h index 8cb379b..453daf2 100644 --- a/src/3d/renderer.h +++ b/src/3d/renderer.h @@ -9,6 +9,10 @@ #include "gpu/gpu.h" #include +#if !defined(STRIP_ALL) +#include "3d/visual_debug.h" +#endif + // Matches the GPU struct layout struct GlobalUniforms { mat4 view_proj; @@ -28,6 +32,10 @@ class Renderer3D { void init(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format); void shutdown(); +#if !defined(STRIP_ALL) + static void SetDebugEnabled(bool enabled) { s_debug_enabled_ = enabled; } +#endif + // Renders the scene to the given texture view (Convenience: creates a pass) void render(const Scene& scene, const Camera& camera, float time, @@ -75,4 +83,9 @@ class Renderer3D { // Max objects capacity static const int kMaxObjects = 100; + +#if !defined(STRIP_ALL) + VisualDebug visual_debug_; + static bool s_debug_enabled_; +#endif }; -- cgit v1.2.3