From f7a34b7401695a4a9137889eb4eb322694f8c5c9 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 26 Mar 2026 07:34:54 +0100 Subject: fix(src/platform): code review cleanup - platform.h: deduplicate str_view/label_view/platform_wgpu_wait_any (were identical in WIN32 and default branches); remove dead platform_wgpu_set_error_callback and its never-used callback typedefs - platform.cc: remove glfwSetWindowUserPointer(nullptr) + stale comment block; drop if-guard on user pointer fixup in platform_poll; remove redundant aspect_ratio recompute (framebuffer_size_callback owns it) - headless_platform.cc: write g_virtual_time back to state->time in platform_poll; remove never-set g_should_close variable - stub_types.h: remove dead platform_wgpu_set_error_callback and callback typedefs; add comment on non-empty WGPURenderPassColorAttachment handoff(Gemini): platform layer cleaned up, no behaviour change --- src/platform/headless_platform.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/platform/headless_platform.cc') diff --git a/src/platform/headless_platform.cc b/src/platform/headless_platform.cc index 4ec8c5d..32e16fe 100644 --- a/src/platform/headless_platform.cc +++ b/src/platform/headless_platform.cc @@ -8,13 +8,11 @@ #include static double g_virtual_time = 0.0; -static bool g_should_close = false; static const double FRAME_TIME = 1.0 / 60.0; PlatformState platform_init(bool fullscreen, int width, int height) { (void)fullscreen; g_virtual_time = 0.0; - g_should_close = false; printf("[headless] Platform initialized (simulated %dx%d)\n", width, height); PlatformState state = {}; @@ -33,13 +31,13 @@ void platform_shutdown(PlatformState* state) { } void platform_poll(PlatformState* state) { - (void)state; g_virtual_time += FRAME_TIME; + state->time = g_virtual_time; } bool platform_should_close(PlatformState* state) { (void)state; - return g_should_close; + return false; } void platform_toggle_fullscreen(PlatformState* state) { -- cgit v1.2.3