Struct mallumo_gls::buffer::MutableBuffer
[−]
[src]
pub struct MutableBuffer { /* fields omitted */ }
Methods
impl MutableBuffer
[src]
pub fn new<T>(data: &[T]) -> Result<MutableBuffer, Error>
[src]
Creates new buffer and copies data
to its memory on GPU
Errors
- GL_OUT_OF_MEMORY - if the buffer cannot be created
pub fn new_empty(size: usize) -> Result<MutableBuffer, Error>
[src]
Creates new empty buffer
Errors
- BufferCreationError(GL_OUT_OF_MEMORY) - if the buffer cannot be created
pub fn new_zeroed(size: usize) -> Result<MutableBuffer, Error>
[src]
pub fn set_data<T>(&mut self, data: &[T]) -> Result<(), Error>
[src]
pub fn set_sub_data<T>(
&mut self,
data: &[T],
offset: usize
) -> Result<(), Error>
[src]
&mut self,
data: &[T],
offset: usize
) -> Result<(), Error>
Replaces part of memory with data
Errors
- BufferSetSubDataError(GL_INVALID_VALUE) - if size of
data
+ offset > buffer size
pub fn clear_data(&mut self) -> Result<(), Error>
[src]
pub fn copy_to(
&mut self,
other: &mut MutableBuffer,
read_offset: usize,
write_offset: usize,
size: usize
) -> Result<(), Error>
[src]
&mut self,
other: &mut MutableBuffer,
read_offset: usize,
write_offset: usize,
size: usize
) -> Result<(), Error>
pub fn get<T>(&self, size: usize, offset: usize) -> Result<Vec<T>, Error>
[src]
pub fn resize(&mut self, size: usize) -> Result<(), Error>
[src]
Trait Implementations
impl Debug for MutableBuffer
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Buffer for MutableBuffer
[src]
fn get_id(&self) -> BufferId
[src]
fn bind_base(&self, target: BufferBaseTarget, index: usize) -> Result<(), Error>
[src]
fn bind_range(
&self,
target: BufferBaseTarget,
index: usize,
offset: usize,
size: usize
) -> Result<(), Error>
[src]
&self,
target: BufferBaseTarget,
index: usize,
offset: usize,
size: usize
) -> Result<(), Error>