[−][src]Struct specs_blit::PixelBuffer
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]
fn default() -> PixelBuffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for PixelBuffer
impl Send for PixelBuffer
impl Sync for PixelBuffer
impl Unpin for PixelBuffer
impl UnwindSafe for PixelBuffer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> TryDefault for T where
T: Default,
[src]
T: Default,
fn try_default() -> Result<T, String>
[src]
fn unwrap_default() -> Self
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,