working flake

This commit is contained in:
Vinzenz Schroeter 2024-11-09 18:53:11 +01:00
parent c23f69ae14
commit 4ddec8eef2
6 changed files with 170 additions and 120 deletions

View file

@ -113,15 +113,14 @@ impl ApplicationHandler<AppEvents> for App<'_> {
self.window = Some(window);
let window = self.window.as_ref().unwrap();
let window_size = window.inner_size();
let pixels = PixelsBuilder::new(
size.width as u32,
size.height as u32,
SurfaceTexture::new(window_size.width, window_size.height, &window),
)
.render_texture_format(TextureFormat::Bgra8UnormSrgb)
.build()
.expect("could not create pixels");
let pixels = {
let window_size = window.inner_size();
let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window);
Pixels::new(
size.width as u32,
size.height as u32,
surface_texture).unwrap()
};
self.pixels = Some(pixels);
}