summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index ef48f21..e46468f 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -3,7 +3,9 @@
#include "gpu/gpu.h"
#include "platform.h"
#include "util/math.h"
+#include <GLFW/glfw3.h>
#include <math.h>
+#include <stdio.h>
#include <string.h>
#define DEMO_BPM 120.0f
@@ -75,7 +77,12 @@ int main(int argc, char **argv) {
}
}
- gpu_draw(synth_get_output_peak());
+ int width, height;
+ glfwGetFramebufferSize(platform_get_window(), &width, &height);
+ float aspect_ratio = (float)width / (float)height;
+
+ float visual_peak = fminf(synth_get_output_peak() * 80.0f, 1.0f);
+ gpu_draw(visual_peak, aspect_ratio);
audio_update();
}