From 302d883f34864bc66a5e04532ae27d7e89fd94e8 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 28 Jan 2026 09:31:13 +0100 Subject: style: Add 3-line descriptive headers to all source files This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process. --- src/platform.cc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/platform.cc') diff --git a/src/platform.cc b/src/platform.cc index 2b6af44..7b1a0f8 100644 --- a/src/platform.cc +++ b/src/platform.cc @@ -1,3 +1,7 @@ +// This file is part of the 64k demo project. +// It implements platform-specific windowing and input using GLFW. +// Handles fullscreen toggling and native surface creation for WebGPU. + #include "platform.h" #include "glfw3webgpu.h" @@ -42,13 +46,9 @@ void platform_shutdown() { glfwTerminate(); } -void platform_poll() { - glfwPollEvents(); -} +void platform_poll() { glfwPollEvents(); } -bool platform_should_close() { - return glfwWindowShouldClose(window); -} +bool platform_should_close() { return glfwWindowShouldClose(window); } void platform_toggle_fullscreen() { g_is_fullscreen = !g_is_fullscreen; @@ -66,14 +66,10 @@ void platform_toggle_fullscreen() { } } -GLFWwindow *platform_get_window() { - return window; -} +GLFWwindow *platform_get_window() { return window; } -double platform_get_time() { - return glfwGetTime(); -} +double platform_get_time() { return glfwGetTime(); } WGPUSurface platform_create_wgpu_surface(WGPUInstance instance) { return glfwCreateWindowWGPUSurface(instance, window); -} +} \ No newline at end of file -- cgit v1.2.3