pub struct IndexBuffer {
pub index_count: usize,
pub wide: bool,
pub topology: IndexTopology,
/* private fields */
}Expand description
An index buffer supporting u16 or u32 indices.
Fields§
§index_count: usizeNumber of indices stored.
wide: boolWhether indices are 32-bit (true) or 16-bit (false).
topology: IndexTopologyPrimitive topology.
Implementations§
Source§impl IndexBuffer
impl IndexBuffer
Sourcepub fn new_u32(topology: IndexTopology) -> Self
pub fn new_u32(topology: IndexTopology) -> Self
Create an empty u32 triangle index buffer.
Sourcepub fn new_u16(topology: IndexTopology) -> Self
pub fn new_u16(topology: IndexTopology) -> Self
Create an empty u16 triangle index buffer.
Sourcepub fn upload_u32(&mut self, indices: &[u32])
pub fn upload_u32(&mut self, indices: &[u32])
Upload u32 indices.
Sourcepub fn upload_u16(&mut self, indices: &[u16])
pub fn upload_u16(&mut self, indices: &[u16])
Upload u16 indices.
Trait Implementations§
Source§impl Clone for IndexBuffer
impl Clone for IndexBuffer
Source§fn clone(&self) -> IndexBuffer
fn clone(&self) -> IndexBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IndexBuffer
impl RefUnwindSafe for IndexBuffer
impl Send for IndexBuffer
impl Sync for IndexBuffer
impl Unpin for IndexBuffer
impl UnsafeUnpin for IndexBuffer
impl UnwindSafe for IndexBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more