Struct rin::gl::buffer_object::BufferObject [−][src]
pub struct BufferObject<T> { /* fields omitted */ }
A mutable buffer object allocated with gl(Named)BufferData
Methods
impl<T> BufferObject<T> where
T: 'static,
[src]
impl<T> BufferObject<T> where
T: 'static,
pub fn load(&mut self, data: &[T], usage: u32)
[src]
pub fn load(&mut self, data: &[T], usage: u32)
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>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: Fn(&[T]),
[src]
pub fn map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: Fn(&[T]),
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>(&mut self, flags: MapWriteFlags, f: F) -> Result<(), Error> where
F: Fn(&mut [T]),
[src]
pub fn map_write<F>(&mut self, flags: MapWriteFlags, f: F) -> Result<(), Error> where
F: Fn(&mut [T]),
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>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: Fn(&mut [T]),
[src]
pub fn map_read_write<F>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: Fn(&mut [T]),
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>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut<T>,
[src]
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut<T>,
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) -> u32
[src]
pub fn id(&self) -> u32
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>(&self, range: R) -> Range<T, BufferObject<T>, &BufferObject<T>> where
R: InputRange,
[src]
pub fn range<R>(&self, range: R) -> Range<T, BufferObject<T>, &BufferObject<T>> where
R: InputRange,
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>(
&mut self,
range: R
) -> Range<T, BufferObject<T>, &mut BufferObject<T>> where
R: InputRange,
[src]
pub fn range_mut<R>(
&mut self,
range: R
) -> Range<T, BufferObject<T>, &mut BufferObject<T>> where
R: InputRange,
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>(self, range: R) -> Range<T, BufferObject<T>, BufferObject<T>> where
R: InputRange,
[src]
pub fn to_range<R>(self, range: R) -> Range<T, BufferObject<T>, BufferObject<T>> where
R: InputRange,
Consumes the buffer into a range
Panics if the range is out of bounds
Trait Implementations
impl<'a, T> BufferRangeMut<T> for BufferObject<T> where
T: 'static,
[src]
impl<'a, T> BufferRangeMut<T> for BufferObject<T> where
T: 'static,
impl<'a, T> BufferRange<T> for BufferObject<T> where
T: 'static,
[src]
impl<'a, T> BufferRange<T> for BufferObject<T> where
T: 'static,
impl<'a, T> TypedBufferObjectMut<T> for BufferObject<T> where
T: 'static,
[src]
impl<'a, T> TypedBufferObjectMut<T> for BufferObject<T> where
T: 'static,
fn map_write<F>(&mut self, flags: MapWriteFlags, f: F) -> Result<(), Error> where
F: Fn(&mut [T]),
[src]
fn map_write<F>(&mut self, flags: MapWriteFlags, f: F) -> Result<(), Error> where
F: Fn(&mut [T]),
Maps a buffer object's data store Read more
fn map_read_write<F>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: Fn(&mut [T]),
[src]
fn map_read_write<F>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: Fn(&mut [T]),
Maps a buffer object's data store Read more
impl<'a, T> TypedBufferObject<T> for BufferObject<T> where
T: 'static,
[src]
impl<'a, T> TypedBufferObject<T> for BufferObject<T> where
T: 'static,
fn id(&self) -> u32
[src]
fn id(&self) -> u32
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>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: Fn(&[T]),
[src]
fn map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: Fn(&[T]),
Maps a buffer object's data store Read more
fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut<T>,
BufferObject<T>: Sized,
[src]
fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut<T>,
BufferObject<T>: 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<T> Send for BufferObject<T>
[src]
impl<T> Send for BufferObject<T>
impl<T> Debug for BufferObject<T> where
T: Debug,
[src]
impl<T> Debug for BufferObject<T> where
T: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> Eq for BufferObject<T>
[src]
impl<T> Eq for BufferObject<T>
impl<T> PartialEq<BufferObject<T>> for BufferObject<T>
[src]
impl<T> PartialEq<BufferObject<T>> for BufferObject<T>
Auto Trait Implementations
impl<T> !Sync for BufferObject<T>
impl<T> !Sync for BufferObject<T>