[−][src]Struct solstice::buffer::Buffer
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]
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
Auto Trait Implementations
impl RefUnwindSafe for Buffer
[src]
impl Send for Buffer
[src]
impl Sync for Buffer
[src]
impl Unpin for Buffer
[src]
impl UnwindSafe for Buffer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[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.
pub 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>,