summaryrefslogtreecommitdiff
path: root/src/platform.h
AgeCommit message (Collapse)Author
42 hoursrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
3 daysfix(build): Add compatibility for older wgpu-native headersskal
- Added preprocessor definitions for 'WGPUOptionalBool_True' and 'WGPUOptionalBool_False' to ensure successful cross-compilation against the older wgpu-native headers used for the Windows build. - This resolves the build failures in the Windows CI/check script.
3 daysrefactor(build): Centralize generated files and clean up project layoutskal
- Task A: Centralized all generated code (assets, timeline) into a single directory to create a single source of truth. - Task A: Isolated test asset generation into a temporary build directory, preventing pollution of the main source tree. - Task B: Vertically compacted all C/C++ source files by removing superfluous newlines. - Task C: Created a top-level README.md with project overview and file descriptions. - Task D: Moved non-essential documentation into a directory to reduce root-level clutter.
3 daysrefactor(platform): Encapsulate state in PlatformState structskal
- Replaced all global static variables in the platform layer with a single PlatformState struct. - Updated all platform function signatures to accept a pointer to this struct, making the implementation stateless and more modular. - Refactored main.cc, tests, and tools to instantiate and pass the PlatformState struct. - This improves code organization and removes scattered global state.
3 daysfeat(platform): Fix high-DPI scaling and add resolution optionskal
- Fixed a 'squished' viewport bug on high-DPI (Retina) displays by querying the framebuffer size in pixels instead of using the window size in points. - Centralized window dimension management within the platform layer. - Added a '--resolution WxH' command-line option to allow specifying a custom window size at startup. This option is stripped in STRIP_ALL builds. - Updated all test and tool executables to use the new platform API.
5 daysclang-formatskal
6 daysChore: Add missing newlines at end of source filesskal
8 daysstyle: Add 3-line descriptive headers to all source filesskal
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.
9 daysfeat: Implement fullscreen, keyboard controls, and pulsating heptagonskal
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.
9 daysfeat: Implement spectool & specview; refactor coding style; update docsskal
This commit introduces new tools for spectrogram manipulation and visualization, establishes a consistent coding style, and updates project documentation. Key changes include: - **Spectrogram Tools: - : A command-line utility for analyzing WAV/MP3 files into custom spectrogram format and playing back these spectrograms via the synth engine. - : A command-line tool for visualizing spectrogram files as ASCII art in the console. - **Coding Style Enforcement: - Added a configuration file enforcing LLVM-based style with 2-space indentation, no tabs, and an 80-column line limit. - Renamed all C++ source files from to for project consistency. - Applied automatic formatting using exit across the entire codebase. - **Documentation & Workflow: - Created to define a commit policy requiring tests to pass before committing. - Updated with instructions for building and using and , and referenced . - Updated and to reflect the new tools, audio architecture decisions (real-time additive synthesis, double-buffering for dynamic updates, WAV/MP3 support), coding style, and development workflow. - **Build System: - Modified to: - Include new targets for and under the option. - Update source file extensions to . - Add a new end-to-end test for to the suite.
9 daysfeat(audio): Implement real-time spectrogram synthesizerskal
Adds a multi-voice, real-time audio synthesis engine that generates sound from spectrogram data using an Inverse Discrete Cosine Transform (IDCT). Key features: - A thread-safe, double-buffered system for dynamically updating spectrograms in real-time without interrupting audio playback. - Core DSP components: FDCT, IDCT, and Hamming window functions. - A simple sequencer in the main loop to demonstrate scripted audio events and dynamic updates. - Unit tests for the new synth engine and Hamming window, integrated with CTest. - A file documenting the build process, features, and how to run tests.
9 daysinitial commitskal