pub enum IndexBuffer<R: Resources> {
Auto,
Index16(Buffer<R, u16>),
Index32(Buffer<R, u32>),
}
Expand description
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
’s 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 Slice
s.
Variants§
Auto
Represents a hypothetical index-buffer from 0 to infinity. In other words, all vertices get processed in order.
Index16(Buffer<R, u16>)
An index-buffer with unsigned 16 bit indices.
Index32(Buffer<R, u32>)
An index-buffer with unsigned 32 bit indices.
Trait Implementations§
Source§impl<R: Clone + Resources> Clone for IndexBuffer<R>
impl<R: Clone + Resources> Clone for IndexBuffer<R>
Source§fn clone(&self) -> IndexBuffer<R>
fn clone(&self) -> IndexBuffer<R>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<R: Resources> Default for IndexBuffer<R>
impl<R: Resources> Default for IndexBuffer<R>
Source§impl<R: Resources> IntoIndexBuffer<R> for IndexBuffer<R>
impl<R: Resources> IntoIndexBuffer<R> for IndexBuffer<R>
Source§fn into_index_buffer<F: Factory<R> + ?Sized>(self, _: &mut F) -> IndexBuffer<R>
fn into_index_buffer<F: Factory<R> + ?Sized>(self, _: &mut F) -> IndexBuffer<R>
IndexBuffer
.