From a7bcf5e9cd6884d010b5cec0146293a0515242fc Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 28 Jan 2026 00:41:07 +0100 Subject: 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. --- scripts/project_init.bat | 17 +++++++++++++++++ scripts/project_init.sh | 15 +++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'scripts') diff --git a/scripts/project_init.bat b/scripts/project_init.bat index 01d9ba2..b2e8320 100644 --- a/scripts/project_init.bat +++ b/scripts/project_init.bat @@ -12,4 +12,21 @@ if not exist third_party\miniaudio.h ( echo miniaudio.h already present. ) +:: wgpu-native submodule +if not exist third_party\wgpu-native\.git ( + echo Fetching wgpu-native submodule... + git submodule update --init --recursive +) else ( + echo wgpu-native submodule already present. +) + +if not exist third_party\wgpu-native\target\release\wgpu_native.lib ( + echo Building wgpu-native static library... + pushd third_party\wgpu-native + cargo build --release :: Requires Rust toolchain and LLVM/Clang to be installed. + popd +) else ( + echo wgpu-native static library already built. +) + echo Done. diff --git a/scripts/project_init.sh b/scripts/project_init.sh index 40f9457..db24c8f 100755 --- a/scripts/project_init.sh +++ b/scripts/project_init.sh @@ -14,4 +14,19 @@ else echo "miniaudio.h already present." fi +# wgpu-native submodule +if [ ! -d third_party/wgpu-native ]; then + echo "Fetching wgpu-native submodule..." + git submodule update --init --recursive +else + echo "wgpu-native submodule already present." +fi + +if [ ! -f third_party/wgpu-native/target/release/libwgpu_native.a ]; then + echo "Building wgpu-native static library..." + (cd third_party/wgpu-native && make lib-native) +else + echo "wgpu-native static library already built." +fi + echo "Done." -- cgit v1.2.3