Struct solstice::buffer::Buffer [−][src]
pub struct Buffer { /* fields omitted */ }
A memory map between a CPU and GPU buffer.
This implementation, while safe, only operates on bytes to better mirror GPU buffers. It is best
used through a Mesh
to provide information on how the data is laid out
internally and allow the use of more types and structures.
This buffer is not resizable. All operations are sized in bytes.
Implementations
impl Buffer
[src]
impl Buffer
[src]pub fn new(
ctx: &mut Context,
size: usize,
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
[src]
ctx: &mut Context,
size: usize,
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
Constructs an empty buffer of size
bytes.
pub fn with_data(
ctx: &mut Context,
data: &[u8],
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
[src]
ctx: &mut Context,
data: &[u8],
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
Constructs a buffer of the size and contents of the passed in the Vec.
pub fn handle(&self) -> BufferKey
[src]
Returns an identifier that can be used with the graphics context to retrieve the raw GPU buffer handle.
pub fn size(&self) -> usize
[src]
The buffer’s capacity/size. Since it’s not resizable these concepts are the same.
pub fn buffer_type(&self) -> BufferType
[src]
The buffer’s type.
pub fn usage(&self) -> Usage
[src]
The buffer’s usage.
Trait Implementations
impl StructuralPartialEq for Buffer
[src]
impl StructuralPartialEq for Buffer
[src]Auto Trait Implementations
impl RefUnwindSafe for Buffer
impl RefUnwindSafe for Buffer
impl UnwindSafe for Buffer
impl UnwindSafe for Buffer