Commit Graph

36 Commits

Author SHA1 Message Date
tyler 3a8f20b783 refactor: split spectrogram.c into per-concern modules
spectrogram.c was ~2950 lines holding everything. Break it into cohesive
translation units; spectrogram.c keeps only globals + the main frame loop.

New modules:
- spectrogram_types.h  shared types, constants, extern globals, inline math
- fft.c/.h             FFT, bit-reverse, twiddle (standalone, no app deps)
- stft.c/.h            STFT compute, adaptive resolution, FFT-size LRU cache
- audio.c/.h           WAV/ffmpeg load, FreeSignal, bandpass, playback
- render.c/.h          UI scaling, colormaps, texture gen, on-screen drawing
- ui.c/.h              file browser, sidebar, sliders, PNG export

Also:
- utils.c now includes utils.h instead of re-typedef'ing AudioSignal/
  SignalStats (they had to be hand-synced before).
- Remove dead code: ApplyHannWindow and ComputeSTFTHighResRange were never
  called (the live high-res path is ComputeNextHighResChunk).
- Delete the unused raylib-template main.c.
- rspektrum.make: build the new units. premake5.lua: glob src/**.c so a
  future regen stays correct.

Pure code movement otherwise; no behavior change. Builds clean (-Wshadow).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 01:15:51 -07:00
tyler b6942d8577 Refactor: extract platform abstraction for subprocess spawning
Move all Unix-specific syscalls (fork, execvp, waitpid, strerror, /tmp)
into a platform layer so the same spectrogram.c can target Windows
(CreateProcess) and WebAssembly (stubs). Key changes:

- src/platform.h: public API with spawn handle, error codes, path helpers
- src/platform_linux.c: fork/execvp implementation, /tmp, strerror
- src/platform_win32.c: CreateProcess implementation, temp dir lookup
- src/platform_web.c: stub implementations (no subprocess support on web)
- src/spectrogram.c: consume only platform.h; replace pid_t/fork/execvp
  with Platform_SpawnChild/WaitForChild; use Platform_GetTempDir() for
  /tmp path; replace strdup with malloc/memcpy for portability
- Build: add platform_*.c to gmake, Premake, and build_web.sh
2026-05-14 18:16:21 -07:00
tyler c5234d5799 Add spectrogram viewer with FFT bandpass filter, file browser, zoom/pan controls
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 21:56:47 -07:00
Jeffery Myers b32f9edd5f use correct software define 2026-03-23 15:45:13 -07:00
Jeffery Myers cd3340ce57 build in the root, so that vscode can find the files 2026-02-25 13:54:12 -08:00
Jeffery Myers 759d3ff61a better filters for game and app resources 2026-01-07 18:49:51 -08:00
Peter0x44 a6c1b96d0a Add support for generating compile_commands.json
- Integrate premake-ecc module for generating compile_commands.json
- Add .clangd config pointing to build/ directory
- Add 'Generate compile_commands.json' task
- Run compile_commands generation automatically on build
2025-12-03 05:16:23 +00:00
Jeffery Myers acc91fd5a8 update windows premake to support visual studio 2026 2025-11-27 15:11:21 -08:00
staruwos 371927cb86 Add generate step for Wayland protocols 2025-11-20 20:28:53 -03:00
staruwos feeb6e5975 Split X11 and Wayland compiler flags 2025-11-20 20:27:59 -03:00
Jeffery Myers 0083bfbb1b Fixed case mismatch (#33) 2025-11-20 08:51:14 -08:00
Jeffery Myers f5a70d55de Merge branch 'main' of github.com:raylib-extras/raylib-quickstart 2025-11-18 09:13:52 -08:00
Jeffery Myers fa62bf5df2 don't include the external folder in the include dirs for the game app. 2025-11-18 09:13:38 -08:00
Jeffery Myers 7f8f6dd48b add support for wayland 2025-11-05 20:00:58 -08:00
Mohammed Saad 4c2696b69c fixed tiny typo 2025-10-24 13:11:10 +02:00
Jeffery Myers b2dc71485f Add support for Win32 backend and software rendering 2025-10-23 08:33:09 -07:00
Jeffery Myers c8fd6040ac add option to link static 2025-10-21 08:45:16 -07:00
Jeffery Myers f72253b545 Split glfw/rgfw into a new option, not two configs of the base option, should reduce target confusion.
Enable LTO on MSVC release builds.
2025-10-01 16:01:35 -07:00
Isaiah Weidl b49422d9ce Fix VS SLN Typos 2025-07-21 09:40:09 +10:00
Jeffery Myers 284a5f8b42 update to premake5 beta 7
replace gmake2 with gmake
2025-07-14 11:14:09 -07:00
Jeffery Myers 79e6155231 remove res build from mingw 2025-05-26 15:53:34 -07:00
Jeffery Myers eee8b1e8ce whitespace 2025-05-18 09:05:17 -07:00
Jeffery Myers 44d2afafff Build a resource file on windows 2025-05-18 09:01:50 -07:00
poyoyuoh 74faad82bf config rgfw build in premake 2025-01-18 15:37:09 +01:00
Jeff Myers eacc8b4060 update premake bins 2025-01-16 10:15:04 -08:00
Jeffery Myers 771f002318 Update both C and C++ to 17, and make them consistent across targets 2025-01-14 16:21:54 -08:00
Jeffery Myers 59addb2272 add option to use single external raylib 2024-12-18 08:08:43 -08:00
Jeffery Myers d99a10f973 allow OpenGL ES2/3 in options 2024-12-04 08:16:31 -08:00
Jeffery Myers 049e919a49 correctly handle release mode console hiding for mingw-w64 2024-11-25 09:50:12 -08:00
Jeffery Myers d36778c104 add platform for RGFW 2024-11-18 09:07:12 -08:00
Jeffery Myers ebb45a6501 use c99 and c++17 2024-10-15 19:47:15 -07:00
Jeffery Myers cffb49be3a Turn on shadow warnings for everyone. 2024-09-23 09:04:07 -07:00
Peter0x44 2c14de3d07 Give premake5 and premake5.osx execute permissions.
This means users don't have to manually `chmod +x` them.
2024-09-03 17:14:12 +01:00
Jeffery Myers 8d0485eafc use a single script file.
autogenerate the extern folder
2024-08-20 16:16:17 -07:00
Jeffery Myers 439b53c74d vscode 2024-08-14 18:01:58 -07:00
Jeff Myers 3f023baa2f inital code drop. 2024-08-14 17:09:43 -07:00