[][src]Struct specs_blit::PixelBuffer

pub struct PixelBuffer { /* fields omitted */ }

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));

Methods

impl PixelBuffer[src]

pub fn new(width: usize, height: usize) -> Self[src]

Create a new buffer filled with black pixels.

pub fn pixels(&self) -> &Vec<u32>[src]

Get the array of pixels.

pub fn width(&self) -> usize[src]

Get the width in pixels.

pub fn height(&self) -> usize[src]

Get the height in pixels.

pub fn clear(&mut self, color: u32)[src]

Set all the pixels to the passed color.

Trait Implementations

impl Default for PixelBuffer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> SetParameter for T

impl<T> TryDefault for T where
    T: Default
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.