From 46ddf4e3f045e0b4adbc01e3441d248a08b8d10d Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Mon, 20 Jun 2022 10:12:30 -0700 Subject: [PATCH] Fix custom-shader example on macOS (#286) - Fixes #258 --- examples/custom-shader/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/custom-shader/src/main.rs b/examples/custom-shader/src/main.rs index 12938e5..537e89b 100644 --- a/examples/custom-shader/src/main.rs +++ b/examples/custom-shader/src/main.rs @@ -38,14 +38,14 @@ fn main() -> Result<(), Error> { .unwrap() }; + let window_size = window.inner_size(); let mut pixels = { - let window_size = window.inner_size(); let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window); Pixels::new(WIDTH, HEIGHT, surface_texture)? }; let mut world = World::new(); let mut time = 0.0; - let mut noise_renderer = NoiseRenderer::new(&pixels, WIDTH, HEIGHT); + let mut noise_renderer = NoiseRenderer::new(&pixels, window_size.width, window_size.height); event_loop.run(move |event, _, control_flow| { // Draw the current frame