summaryrefslogtreecommitdiff
path: root/src/platform.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 00:41:07 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 00:41:07 +0100
commita7bcf5e9cd6884d010b5cec0146293a0515242fc (patch)
treebcc07dd93e19c7b429363c8cac1e9866762f6e6e /src/platform.h
parent9dcf94ab01269311b4e5d39be23c95560904c626 (diff)
feat: Implement fullscreen, keyboard controls, and pulsating heptagon
This commit fulfills tasks 1 and 2, and adds a synchronized visual effect. - **Fullscreen Mode**: Added '--fullscreen' command-line argument and dynamic toggling via 'F' key. - **Keyboard Controls**: Implemented 'Esc' to exit and 'F' to toggle fullscreen in 'src/platform.cc'. - **Synchronized Visuals**: Added a pulsating heptagon effect in 'src/gpu/gpu.cc' and 'src/gpu/shader.wgsl' that scales and changes color based on the real-time audio peak from the synth. - **Refactor**: Abstracted platform-specific WebGPU surface creation into 'src/platform.cc' to keep 'src/gpu/gpu.cc' cross-platform. - **Build System**: Corrected 'CMakeLists.txt' to properly link 'wgpu-native' and platform frameworks, and updated 'project_init.sh' to build the submodule. - **Documentation**: Updated 'HOWTO.md' and 'PROJECT_CONTEXT.md' with new features and decisions.
Diffstat (limited to 'src/platform.h')
-rw-r--r--src/platform.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/platform.h b/src/platform.h
index 4d9a1f9..2146e10 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -1,9 +1,15 @@
#pragma once
+#include <webgpu.h>
+
struct GLFWwindow;
-void platform_init();
+void platform_init_window(bool fullscreen);
void platform_shutdown();
void platform_poll();
bool platform_should_close();
+void platform_toggle_fullscreen();
GLFWwindow *platform_get_window();
double platform_get_time();
+
+// Creates a WebGPU surface for the current platform window.
+WGPUSurface platform_create_wgpu_surface(WGPUInstance instance);