summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 10:34:15 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 10:34:15 +0100
commitc384515c8ea933757c97886c3bf1554e2fd62b04 (patch)
tree79f7047d10777210dfb31185adc9dda282d09387 /src/main.cc
parentf12b5ebc74825817df54677e261b92200bfac84a (diff)
feat(visuals): Add rotation, color shifts, and improved beat-sync
Implements a more dynamic and reactive visual system. - Updated synth.cc: Faster peak decay for better response. - Updated gpu.cc: Added time-based rotation and Hue shifting; implemented reactive clear-color flashes. - Updated main.cc: Corrected peak scaling (8x multiplier) and integrated time-based animation.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main.cc b/src/main.cc
index d564de0..5f74302 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -133,14 +133,11 @@ int main(int argc, char **argv) {
glfwGetFramebufferSize(platform_get_window(), &width, &height);
float aspect_ratio = (float)width / (float)height;
- // Stronger amplification for visuals
+ // Adjusted multiplier for visuals (preventing constant 1.0 saturation)
float raw_peak = synth_get_output_peak();
- float visual_peak = raw_peak * 150.0f;
-
- // Add a non-linear boost for loud peaks to make flashes pop
- if (visual_peak > 0.5f) visual_peak += (visual_peak - 0.5f) * 0.5f;
+ float visual_peak = fminf(raw_peak * 8.0f, 1.0f);
- gpu_draw(fminf(visual_peak, 1.0f), aspect_ratio);
+ gpu_draw(visual_peak, aspect_ratio, (float)current_time);
audio_update();
}
@@ -148,4 +145,4 @@ int main(int argc, char **argv) {
gpu_shutdown();
platform_shutdown();
return 0;
-}
+} \ No newline at end of file