Enum gfx::IndexBuffer [] [src]

pub enum IndexBuffer<R: Resources> {
    Auto,
    Index16(Buffer<R, u16>),
    Index32(Buffer<R, u32>),
}

Type of index-buffer used in a Slice.

The Auto variant represents a hypothetical index-buffer from 0 to infinity. In other words, all vertices get processed in order. Do note that the Slice' start and end restrictions still apply for this variant. To render every vertex in the VertexBuffer, you would set start to 0, and end to the VertexBuffer's length.

The Index* variants represent an actual Buffer with a list of vertex-indices. The numeric suffix specifies the amount of bits to use per index. Each of these also contains a base-vertex. This is the index of the first vertex in the VertexBuffer. This value will be added to every index in the index-buffer, effectively moving the start of the VertexBuffer to this base-vertex.

Construction & Handling

A IndexBuffer can be constructed using the IntoIndexBuffer trait, from either a slice or a Buffer of integers, using a factory.

An IndexBuffer is exclusively used to create Slices.

Variants

Represents a hypothetical index-buffer from 0 to infinity. In other words, all vertices get processed in order.

An index-buffer with unsigned 16 bit indices.

An index-buffer with unsigned 32 bit indices.

Trait Implementations

impl<R: Clone + Resources> Clone for IndexBuffer<R>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<R: Debug + Resources> Debug for IndexBuffer<R>
[src]

Formats the value using the given formatter.

impl<R: Eq + Resources> Eq for IndexBuffer<R>
[src]

impl<R: Hash + Resources> Hash for IndexBuffer<R>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<R: PartialEq + Resources> PartialEq for IndexBuffer<R>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<R: Resources> Default for IndexBuffer<R>
[src]

Returns the "default value" for a type. Read more

impl<R: Resources> IntoIndexBuffer<R> for IndexBuffer<R>
[src]

Turns self into an IndexBuffer.