Struct glin::buffer_object::BufferObjectImmutable [−][src]
pub struct BufferObjectImmutable<T> { /* fields omitted */ }
Inmmutable buffer object allocated with gl(Named)BufferStorage
Inmmutability here refers to the same concept OpenGL understands by it. The data in the buffer can still be modified but it can't be reallocated
Methods
impl<T: 'static> BufferObjectImmutable<T>
[src]
impl<T: 'static> BufferObjectImmutable<T>
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])>(
&self,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
pub fn map_write<F: Fn(&mut [T])>(
&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])>(
&self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
pub fn map_read_write<F: Fn(&mut [T])>(
&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, BufferObjectImmutable<T>, &BufferObjectImmutable<T>>
[src]
pub fn range<R: InputRange>(
&self,
range: R
) -> Range<T, BufferObjectImmutable<T>, &BufferObjectImmutable<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, BufferObjectImmutable<T>, &mut BufferObjectImmutable<T>>
[src]
pub fn range_mut<R: InputRange>(
&mut self,
range: R
) -> Range<T, BufferObjectImmutable<T>, &mut BufferObjectImmutable<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, BufferObjectImmutable<T>, BufferObjectImmutable<T>>
[src]
pub fn to_range<R: InputRange>(
self,
range: R
) -> Range<T, BufferObjectImmutable<T>, BufferObjectImmutable<T>>
Consumes the buffer into a range
Panics if the range is out of bounds
Trait Implementations
impl<T: Debug> Debug for BufferObjectImmutable<T>
[src]
impl<T: Debug> Debug for BufferObjectImmutable<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> PartialEq for BufferObjectImmutable<T>
[src]
impl<T> PartialEq for BufferObjectImmutable<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 BufferObjectImmutable<T>
[src]
impl<T> Eq for BufferObjectImmutable<T>
impl<T: 'static> TypedBufferObject<T> for BufferObjectImmutable<T>
[src]
impl<T: 'static> TypedBufferObject<T> for BufferObjectImmutable<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, B: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut B) where
Self: Sized,
[src]
fn copy_to<U, B: BufferRange<U> + WithBackendMut<T>>(&self, dst: &mut B) 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 BufferObjectImmutable<T>
[src]
impl<'a, T: 'static> TypedBufferObjectMut<T> for BufferObjectImmutable<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<T: 'static> BufferRange<T> for BufferObjectImmutable<T>
[src]
impl<T: 'static> BufferRange<T> for BufferObjectImmutable<T>
impl<T: 'static> BufferRangeMut<T> for BufferObjectImmutable<T>
[src]
impl<T: 'static> BufferRangeMut<T> for BufferObjectImmutable<T>
Auto Trait Implementations
impl<T> !Send for BufferObjectImmutable<T>
impl<T> !Send for BufferObjectImmutable<T>
impl<T> !Sync for BufferObjectImmutable<T>
impl<T> !Sync for BufferObjectImmutable<T>