pub struct PixelBuffer { /* private fields */ }
Expand description
Array of pixels resource that can be written to from the RenderSystem
system.
use specs::prelude::*;
use specs_blit::PixelBuffer;
const WIDTH: usize = 800;
const HEIGHT: usize = 800;
// Setup the specs world
let mut world = World::new();
// Add the pixel buffer as a resource so it can be accessed from the RenderSystem later
world.insert(PixelBuffer::new(WIDTH, HEIGHT));
Implementations§
Source§impl PixelBuffer
impl PixelBuffer
Sourcepub fn pixels_mut(&mut self) -> &mut Vec<u32>
pub fn pixels_mut(&mut self) -> &mut Vec<u32>
Get the array so that it can be mutated manually.
Trait Implementations§
Source§impl Debug for PixelBuffer
impl Debug for PixelBuffer
Source§impl Default for PixelBuffer
impl Default for PixelBuffer
Source§fn default() -> PixelBuffer
fn default() -> PixelBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PixelBuffer
impl RefUnwindSafe for PixelBuffer
impl Send for PixelBuffer
impl Sync for PixelBuffer
impl Unpin for PixelBuffer
impl UnwindSafe for PixelBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
Source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
Source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.