Struct lambda::render::buffer::BufferBuilder
source · 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.