Fix custom-shader example on macOS (#286)

- Fixes #258
This commit is contained in:
Jay Oster 2022-06-20 10:12:30 -07:00 committed by GitHub
parent af821c9e49
commit 46ddf4e3f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,14 +38,14 @@ fn main() -> Result<(), Error> {
.unwrap() .unwrap()
}; };
let window_size = window.inner_size();
let mut pixels = { let mut pixels = {
let window_size = window.inner_size();
let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window); let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window);
Pixels::new(WIDTH, HEIGHT, surface_texture)? Pixels::new(WIDTH, HEIGHT, surface_texture)?
}; };
let mut world = World::new(); let mut world = World::new();
let mut time = 0.0; 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| { event_loop.run(move |event, _, control_flow| {
// Draw the current frame // Draw the current frame