Struct glin::buffer_object::BufferObject [−][src]
pub struct BufferObject<T> { /* fields omitted */ }
A mutable buffer object allocated with gl(Named)BufferData
Methods
impl<T: 'static> BufferObject<T>
[src]
impl<T: 'static> BufferObject<T>
pub fn load(&mut self, data: &[T], usage: GLenum)
[src]
pub fn load(&mut self, data: &[T], usage: GLenum)
Loads the passed data into the buffer (re)allocating it
see: gl(Named)BufferData
pub fn update(&mut self, data: &[T])
[src]
pub fn update(&mut self, data: &[T])
Loads the passed data at the beginning of the buffer
Will panic if the buffer is not big enough or not allocated at all
see: gl(Named)BufferSubData
pub fn map_read<F: Fn(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
[src]
pub fn map_read<F: Fn(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
Maps a buffer object's data store
Pass a closure that receives the mapped buffer to access it
see glMapBuffer
pub fn map_write<F: Fn(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
pub fn map_write<F: Fn(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
Maps a buffer object's data store
Pass a closure that receives the mapped buffer to access it
see glMapBuffer
pub fn map_read_write<F: Fn(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
pub fn map_read_write<F: Fn(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
Maps a buffer object's data store
Pass a closure that receives the mapped buffer to access it
see glMapBuffer
pub fn copy_to<U, B: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut B)
[src]
pub fn copy_to<U, B: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut B)
Copy one buffer into another
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Number of elements on the last update
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
Allocated capacity of the buffer in number of elements
pub fn bytes(&self) -> usize
[src]
pub fn bytes(&self) -> usize
Total bytes on the last update
pub fn capacity_bytes(&self) -> usize
[src]
pub fn capacity_bytes(&self) -> usize
Total capcacity of the buffer in bytes
pub fn id(&self) -> GLuint
[src]
pub fn id(&self) -> GLuint
OpenGL id
pub fn stride(&self) -> usize
[src]
pub fn stride(&self) -> usize
Stride of the buffer type
Consume into a shared buffer
pub fn range<R: InputRange>(
&self,
range: R
) -> Range<T, BufferObject<T>, &BufferObject<T>>
[src]
pub fn range<R: InputRange>(
&self,
range: R
) -> Range<T, BufferObject<T>, &BufferObject<T>>
Get a range from the buffer
Useful to do operations on portions of the buffer
Panics if the range is out of bounds
pub fn range_mut<R: InputRange>(
&mut self,
range: R
) -> Range<T, BufferObject<T>, &mut BufferObject<T>>
[src]
pub fn range_mut<R: InputRange>(
&mut self,
range: R
) -> Range<T, BufferObject<T>, &mut BufferObject<T>>
Get a mutable range from the buffer
Useful to do operations on portions of the buffer
Panics if the range is out of bounds
pub fn to_range<R: InputRange>(
self,
range: R
) -> Range<T, BufferObject<T>, BufferObject<T>>
[src]
pub fn to_range<R: InputRange>(
self,
range: R
) -> Range<T, BufferObject<T>, BufferObject<T>>
Consumes the buffer into a range
Panics if the range is out of bounds
Trait Implementations
impl<T: Debug> Debug for BufferObject<T>
[src]
impl<T: Debug> Debug for BufferObject<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Send for BufferObject<T>
[src]
impl<T> Send for BufferObject<T>
impl<T> PartialEq for BufferObject<T>
[src]
impl<T> PartialEq for BufferObject<T>
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T> Eq for BufferObject<T>
[src]
impl<T> Eq for BufferObject<T>
impl<'a, T: 'static> TypedBufferObject<T> for BufferObject<T>
[src]
impl<'a, T: 'static> TypedBufferObject<T> for BufferObject<T>
fn id(&self) -> GLuint
[src]
fn id(&self) -> GLuint
OpenGL id
fn len(&self) -> usize
[src]
fn len(&self) -> usize
Number of elements on the last update
fn capacity(&self) -> usize
[src]
fn capacity(&self) -> usize
Allocated capacity of the buffer in number of elements
fn map_read<F: Fn(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
[src]
fn map_read<F: Fn(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
Maps a buffer object's data store Read more
fn copy_to<U, BB: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut BB) where
Self: Sized,
[src]
fn copy_to<U, BB: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut BB) where
Self: Sized,
Copy one buffer into another
fn bytes(&self) -> usize
[src]
fn bytes(&self) -> usize
Total bytes on the last update
fn capacity_bytes(&self) -> usize
[src]
fn capacity_bytes(&self) -> usize
Total capcacity of the buffer in bytes
fn stride(&self) -> usize
[src]
fn stride(&self) -> usize
Stride of the buffer type
impl<'a, T: 'static> TypedBufferObjectMut<T> for BufferObject<T>
[src]
impl<'a, T: 'static> TypedBufferObjectMut<T> for BufferObject<T>
fn map_write<F: Fn(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
fn map_write<F: Fn(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
Maps a buffer object's data store Read more
fn map_read_write<F: Fn(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
fn map_read_write<F: Fn(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
Maps a buffer object's data store Read more
impl<'a, T: 'static> BufferRange<T> for BufferObject<T>
[src]
impl<'a, T: 'static> BufferRange<T> for BufferObject<T>
impl<'a, T: 'static> BufferRangeMut<T> for BufferObject<T>
[src]
impl<'a, T: 'static> BufferRangeMut<T> for BufferObject<T>
Auto Trait Implementations
impl<T> !Sync for BufferObject<T>
impl<T> !Sync for BufferObject<T>