Trait glitter::vertex_buffer::ContextVertexBufferExt [] [src]

pub trait ContextVertexBufferExt: AContext {
    fn new_vertex_buffer<V: VertexData>(&self) -> VertexBuffer<V> { ... }
fn buffer_vertices<T>(
        &self,
        gl_vbo: &mut VertexBufferBinding<T>,
        vertices: &[T],
        usage: BufferDataUsage
    )
    where
        T: VertexData,
        [T]: VertexBytes
, { ... }
fn buffer_indices<T>(
        &self,
        gl_ibo: &mut IndexBufferBinding<T>,
        indices: &[T],
        usage: BufferDataUsage
    )
    where
        T: IndexDatum,
        [T]: IndexData
, { ... }
fn draw_arrays_range_vbo<V>(
        &self,
        gl_vbo: &VertexBufferBinding<V>,
        mode: DrawingMode,
        start: u32,
        length: usize
    )
    where
        V: VertexData
, { ... }
fn draw_arrays_vbo<V>(
        &self,
        gl_vbo: &VertexBufferBinding<V>,
        mode: DrawingMode
    )
    where
        V: VertexData
, { ... }
fn draw_n_elements_buffered_vbo<V, I>(
        &self,
        gl_vbo: &VertexBufferBinding<V>,
        gl_ibo: &IndexBufferBinding<I>,
        mode: DrawingMode,
        length: usize
    )
    where
        V: VertexData,
        I: IndexDatum
, { ... }
fn draw_elements_buffered_vbo<V, I>(
        &self,
        gl_vbo: &VertexBufferBinding<V>,
        gl_ibo: &IndexBufferBinding<I>,
        mode: DrawingMode
    )
    where
        V: VertexData,
        I: IndexDatum
, { ... }
fn draw_n_elements_vbo<V, I>(
        &self,
        gl_vbo: &VertexBufferBinding<V>,
        mode: DrawingMode,
        count: usize,
        indices: &[I]
    )
    where
        V: VertexData,
        I: IndexDatum,
        [I]: IndexData
, { ... }
fn draw_elements_vbo<V, I>(
        &mut self,
        gl_vbo: &VertexBufferBinding<V>,
        mode: DrawingMode,
        indices: &[I]
    )
    where
        V: VertexData,
        I: IndexDatum,
        [I]: IndexData
, { ... } }

An extension trait that adds vertex buffer and index buffer-related methods to OpenGL contexts.

Provided Methods

Create a new, empty vertex buffer.

Send data to a vertex buffer. Note that this will replace the buffer's current contents, if any.

Send data to an index buffer. Note that this will replace the buffer's current contents, if any.

Use the data from the provided vertex buffer binding to render primitives.

  • gl_vbo: The binding of the vertex buffer to read vertices from.
  • mode: The type of primitives to draw.
  • start: The index of the first vertex to draw.
  • length: The number of vertices to draw.

Panics

This function will panic if the start and length are out of bounds of the currently-buffered data.

Use the data from the provided vertex buffer binding to render primitives. This function will use the full range of vertices that have been buffered.

  • gl_vbo: The binding of the vertex buffer to read vertices from.
  • mode: The type of primitives to draw.

Draw primitives using the provided index buffer as the indices into the provided vertex buffer.

  • gl_vbo: The binding of the buffer that contains the vertex data.
  • gl_ibo: The binding of the buffer that contains the index data.
  • mode: The type of primitives to draw.
  • length: The number of indices to read.

Draw primitives using the provided index buffer as the indices into the provided vertex buffer. All buffered indices will be used.

  • gl_vbo: The binding of the buffer that contains the vertex data.
  • gl_ibo: The binding of the buffer that contains the index data.
  • mode: The type of primitives to draw.

Draw primitives specified by the provided index array, treated as indices into the provided vertex buffer.

  • gl_vbo: The binding of the buffer that contains the vertex data.
  • mode: The type of primitives to draw.
  • count: The number of indices to read.
  • indices: The index array to use.

Draw primitives specified by the provided index array, treated as indices into the provided vertex buffer.

  • gl_vbo: The binding of the buffer that contains the vertex data.
  • mode: The type of primitives to draw.
  • indices: The index array to use.

Implementors