[][src]Struct golem::Buffer

pub struct Buffer<T> { /* fields omitted */ }

A collection of values stored contiguously on the GPU, as either a VertexBuffer or an ElementBuffer

Buffers serve as input to draw calls, by passing the input to the ShaderProgram

Implementations

impl Buffer<f32>[src]

pub fn new(ctx: &Context) -> Result<Self, GolemError>[src]

Create a VertexBuffer to store the vertex values

impl Buffer<u32>[src]

pub fn new(ctx: &Context) -> Result<Self, GolemError>[src]

Create a ElementBuffer to store the index values

impl<T: Pod> Buffer<T>[src]

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

The current capacity of the buffer in bytes

pub fn set_data(&mut self, data: &[T])[src]

Set the data this buffer holds, resizing it if necessary

The conditions under which the buffer is reallocated are an implementation detail, and it's best not to rely on them.

pub fn set_sub_data(&self, start: usize, data: &[T])[src]

Set some range of the buffer, within the existing capacity

The range (the start to the end of the data) must fall within the existing buffer's capacity, or this method will panic.

Trait Implementations

impl<T> Drop for Buffer<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Buffer<T>

impl<T> !Send for Buffer<T>

impl<T> !Sync for Buffer<T>

impl<T> Unpin for Buffer<T> where
    T: Unpin

impl<T> !UnwindSafe for Buffer<T>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.