diff options
| author | skal <pascal.massimino@gmail.com> | 2026-01-28 09:31:13 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-01-28 09:31:13 +0100 |
| commit | 302d883f34864bc66a5e04532ae27d7e89fd94e8 (patch) | |
| tree | 8f813865d5dc5b70ee8bf9ee4866546116859825 /src/platform.cc | |
| parent | f804dcb9740540b3735628ebf8c006235cc56fca (diff) | |
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.
Diffstat (limited to 'src/platform.cc')
| -rw-r--r-- | src/platform.cc | 22 |
1 files changed, 9 insertions, 13 deletions
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 |
