Struct solstice::buffer::Buffer [−][src]
pub struct Buffer { /* fields omitted */ }
Expand description
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]
pub fn new(
ctx: &mut Context,
size: usize,
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
[src]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]
pub fn with_data(
ctx: &mut Context,
data: &[u8],
buffer_type: BufferType,
usage: Usage
) -> Result<Self, GraphicsError>
[src]Constructs a buffer of the size and contents of the passed in the Vec.
pub fn handle(&self) -> BufferKey
[src]
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]
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]
pub fn buffer_type(&self) -> BufferType
[src]The buffer’s type.
Trait Implementations
impl Eq for Buffer
[src]
impl StructuralEq for Buffer
[src]
impl StructuralPartialEq for Buffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more