From 113ffafceda648f6f12f20383375169e60551b7e Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Thu, 31 Oct 2019 20:35:54 -0700 Subject: [PATCH] Use TextureFormat to show the example iterates one-byte-per-pixel --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4d42c7a..23fe23c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -227,10 +227,15 @@ impl Pixels { /// # Example /// /// ```no_run - /// # use pixels::Pixels; + /// use pixels::PixelsBuilder; + /// use pixels::wgpu::TextureFormat; + /// /// # let surface = wgpu::Surface::create(&pixels_mocks::RWH); /// # let surface_texture = pixels::SurfaceTexture::new(1024, 768, surface); - /// let mut pixels = Pixels::new(320, 240, surface_texture)?; + /// let mut pixels = PixelsBuilder::new(320, 240, surface_texture) + /// .texture_format(TextureFormat::R8Unorm) + /// .build()?; + /// /// let frame = pixels.get_frame(); /// for pixel in frame { /// *pixel = 0;