diff options
| author | skal <pascal.massimino@gmail.com> | 2026-01-28 02:06:05 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-01-28 02:06:05 +0100 |
| commit | 5bbe2204f1d30e99ee442e287167ef14ad51af75 (patch) | |
| tree | ed4a30ef91ed9e928bda0af07f44c8ecd0a9d76a /src/gpu/gpu.h | |
| parent | 164c471fb9488f7013be0bcaef7f790020aee916 (diff) | |
fix(gpu): Add aspect ratio correction to shader
Implements aspect ratio correction to prevent the pulsating heptagon from being distorted when the window is resized.
- The main loop now queries the framebuffer size and calculates the aspect ratio each frame.
- This aspect ratio is passed to the GPU via an updated uniform buffer.
- The vertex shader in shader.wgsl now uses the aspect ratio to correctly scale the X coordinates of the vertices, ensuring the shape remains proportional.
Diffstat (limited to 'src/gpu/gpu.h')
| -rw-r--r-- | src/gpu/gpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index 127ca42..87d4b9b 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -2,5 +2,5 @@ struct GLFWwindow; void gpu_init(GLFWwindow *window); -void gpu_draw(float audio_peak); +void gpu_draw(float audio_peak, float aspect_ratio); void gpu_shutdown(); |
