Enum gfx::render::mesh::SliceKind [] [src]

pub enum SliceKind<R: Resources> {
    Vertex,
    Index8(IndexBuffer<R, u8>, VertexCount),
    Index16(IndexBuffer<R, u16>, VertexCount),
    Index32(IndexBuffer<R, u32>, VertexCount),
}

Source of vertex ordering for a slice

Variants

Vertex

Render vertex data directly from the Mesh's buffer.

Index8

The Index* buffer contains a list of indices into the Mesh data, so every vertex attribute does not need to be duplicated, only its position in the Mesh. The base index is added to this index before fetching the vertex from the buffer. For example, when drawing a square, two triangles are needed. Using only Vertex, one would need 6 separate vertices, 3 for each triangle. However, two of the vertices will be identical, wasting space for the duplicated attributes. Instead, the Mesh can store 4 vertices and an Index8 can be used instead.

Index16

As Index8 but with u16 indices

Index32

As Index8 but with u32 indices

Trait Implementations

Derived Implementations

impl<R: PartialEq + Resources> PartialEq for SliceKind<R> where R: PartialEq, R: PartialEq, R: PartialEq

fn eq(&self, __arg_0: &SliceKind<R>) -> bool

fn ne(&self, __arg_0: &SliceKind<R>) -> bool

impl<R: Debug + Resources> Debug for SliceKind<R> where R: Debug, R: Debug, R: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<R: Clone + Resources> Clone for SliceKind<R> where R: Clone, R: Clone, R: Clone

fn clone(&self) -> SliceKind<R>

fn clone_from(&mut self, source: &Self)