pub struct BufferBuilder { /* private fields */ }
Expand description
A buffer is a block of memory that can be used to store data that can be accessed by the GPU. The buffer is created with a length, usage, and properties that determine how the buffer can be used.
Implementations§
Source§impl BufferBuilder
impl BufferBuilder
Sourcepub fn build_from_mesh(
mesh: &Mesh,
render_context: &mut RenderContext,
) -> Result<Buffer, &'static str>
pub fn build_from_mesh( mesh: &Mesh, render_context: &mut RenderContext, ) -> Result<Buffer, &'static str>
Builds a buffer from a given mesh and allocates it’s memory on to the GPU.
Sourcepub fn with_length(&mut self, size: usize) -> &mut Self
pub fn with_length(&mut self, size: usize) -> &mut Self
Sets the length of the buffer (In bytes).
Sourcepub fn with_buffer_type(&mut self, buffer_type: BufferType) -> &mut Self
pub fn with_buffer_type(&mut self, buffer_type: BufferType) -> &mut Self
Sets the type of buffer to create.
Sourcepub fn with_usage(&mut self, usage: Usage) -> &mut Self
pub fn with_usage(&mut self, usage: Usage) -> &mut Self
Sets the usage of the buffer.
Sourcepub fn with_properties(&mut self, properties: Properties) -> &mut Self
pub fn with_properties(&mut self, properties: Properties) -> &mut Self
Sets the properties of the buffer.
Auto Trait Implementations§
impl Freeze for BufferBuilder
impl RefUnwindSafe for BufferBuilder
impl Send for BufferBuilder
impl Sync for BufferBuilder
impl Unpin for BufferBuilder
impl UnwindSafe for BufferBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more