Minor doc improvement

This commit is contained in:
Jay Oster 2019-11-02 23:15:06 -07:00
parent 703773f35d
commit f19740003f

View file

@ -236,10 +236,14 @@ impl Pixels {
/// .texture_format(TextureFormat::R8Unorm) /// .texture_format(TextureFormat::R8Unorm)
/// .build()?; /// .build()?;
/// ///
/// // Clear the pixel buffer
/// let frame = pixels.get_frame(); /// let frame = pixels.get_frame();
/// for pixel in frame { /// for pixel in frame {
/// *pixel = 0; /// *pixel = 0;
/// } /// }
///
/// // Draw it to the `SurfaceTexture`
/// pixels.render();
/// # Ok::<(), pixels::Error>(()) /// # Ok::<(), pixels::Error>(())
/// ``` /// ```
pub fn get_frame(&mut self) -> &mut [u8] { pub fn get_frame(&mut self) -> &mut [u8] {