Struct glium::index::DrawCommandsIndicesBuffer [] [src]

pub struct DrawCommandsIndicesBuffer {
    // some fields omitted
}

A buffer containing a list of draw commands.

Methods

impl DrawCommandsIndicesBuffer

fn empty<F>(facade: &F, elements: usize) -> Result<DrawCommandsIndicesBuffer, BufferCreationError> where F: Facade

Builds an empty buffer.

The parameter indicates the number of elements.

fn empty_dynamic<F>(facade: &F, elements: usize) -> Result<DrawCommandsIndicesBuffer, BufferCreationError> where F: Facade

Builds an empty buffer.

The parameter indicates the number of elements.

fn empty_persistent<F>(facade: &F, elements: usize) -> Result<DrawCommandsIndicesBuffer, BufferCreationError> where F: Facade

Builds an empty buffer.

The parameter indicates the number of elements.

fn empty_immutable<F>(facade: &F, elements: usize) -> Result<DrawCommandsIndicesBuffer, BufferCreationError> where F: Facade

Builds an empty buffer.

The parameter indicates the number of elements.

fn with_index_buffer<'a, T>(&'a self, index_buffer: &'a IndexBuffer<T>) -> IndicesSource<'a> where T: Index

Builds an indices source from this buffer and a primitives type. This indices source can be passed to the draw() function.

Methods from Deref<Target=BufferView<[DrawCommandIndices]>>

fn new<F>(facade: &F, data: &T, ty: BufferType, mode: BufferMode) -> Result<BufferView<T>, BufferCreationError> where F: Facade

Builds a new buffer containing the given data. The size of the buffer is equal to the size of the data.

fn empty_unsized<F>(facade: &F, ty: BufferType, size: usize, mode: BufferMode) -> Result<BufferView<T>, BufferCreationError> where F: Facade

Builds a new buffer of the given size.

fn get_context(&self) -> &Rc<Context>

Returns the context corresponding to this buffer.

fn get_size(&self) -> usize

Returns the size in bytes of this buffer.

fn is_persistent(&self) -> bool

Returns true if this buffer uses persistent mapping.

fn write(&self, data: &T)

Uploads some data in this buffer.

Panic

Panics if the length of data is different from the length of this buffer.

fn invalidate(&self)

Invalidates the content of the buffer. The data becomes undefined.

You should call this if you only use parts of a buffer. For example if you want to use the first half of the buffer, you invalidate the whole buffer then write the first half.

This operation is a no-op if the backend doesn't support it.

fn read(&self) -> Result<T, ReadError>

Reads the content of the buffer.

fn map(&mut self) -> Mapping<T>

Maps the buffer in memory for both reading and writing.

fn map_read(&mut self) -> ReadMapping<T>

Maps the buffer in memory for reading.

fn map_write(&mut self) -> WriteMapping<T>

Maps the buffer in memory for writing only.

fn as_slice_any(&self) -> BufferViewAnySlice

Builds a slice-any containing the whole subbuffer.

fn empty<F>(facade: &F, ty: BufferType, mode: BufferMode) -> Result<BufferView<T>, BufferCreationError> where F: Facade

Builds a new buffer of the given size.

fn empty_array<F>(facade: &F, ty: BufferType, len: usize, mode: BufferMode) -> Result<BufferView<[T]>, BufferCreationError> where F: Facade

Builds a new buffer of the given size.

fn len(&self) -> usize

Returns the number of elements in this buffer.

fn slice(&self, range: Range<usize>) -> Option<BufferViewSlice<[T]>>

Builds a slice of this subbuffer. Returns None if out of range.

fn slice_mut(&mut self, range: Range<usize>) -> Option<BufferViewMutSlice<[T]>>

Builds a slice of this subbuffer. Returns None if out of range.

fn as_slice(&self) -> BufferViewSlice<[T]>

Builds a slice containing the whole subbuffer.

fn as_mut_slice(&mut self) -> BufferViewMutSlice<[T]>

Builds a slice containing the whole subbuffer.

fn read_as_texture_1d<S>(&self) -> Result<S, ReadError> where S: Texture1dDataSink<T>

Reads the content of the buffer.

Trait Implementations

impl Deref for DrawCommandsIndicesBuffer

type Target = BufferView<[DrawCommandIndices]>

fn deref(&self) -> &BufferView<[DrawCommandIndices]>

impl DerefMut for DrawCommandsIndicesBuffer

fn deref_mut(&mut self) -> &mut BufferView<[DrawCommandIndices]>