From 54826d50a6d4ebb2501988ed90fc0c94942efc1e Mon Sep 17 00:00:00 2001 From: Lucas Schumacher Date: Mon, 13 May 2024 15:33:52 -0400 Subject: [PATCH] Fix texture offset using wrong dimension --- src/app/waterfall.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/waterfall.rs b/src/app/waterfall.rs index 76ce354..c093176 100644 --- a/src/app/waterfall.rs +++ b/src/app/waterfall.rs @@ -29,6 +29,7 @@ pub struct Waterfall { ebo: glow::Buffer, offset: usize, width: usize, + height: usize, fft_in: Receiver>, } @@ -82,8 +83,8 @@ impl Waterfall { glow::UNSIGNED_BYTE, PixelUnpackData::Slice(&fft), ); - check_for_gl_errors(&gl, "update texture"); - self.offset = (self.offset + 1) % self.width; + check_for_gl_errors(&gl, &format!("update texture with offset {}", self.offset)); + self.offset = (self.offset + 1) % self.height; } if let Some(uniform) = gl.get_uniform_location(self.program, "offset") { @@ -317,6 +318,7 @@ impl Waterfall { ebo, offset: 0_usize, width, + height, fft_in, } }