Struct meshopt::VertexStream
source · pub struct VertexStream<'a> {
pub data: *const u8,
pub stride: usize,
pub size: usize,
/* private fields */
}
Expand description
Vertex attribute stream, similar to glVertexPointer
Each element takes size bytes, with stride controlling the spacing between successive elements.
Fields§
§data: *const u8
Pointer to buffer which contains vertex data.
stride: usize
Space between vertices inside the buffer (in bytes).
size: usize
The size in bytes of the vertex attribute this Stream is representing.
Implementations§
source§impl<'a> VertexStream<'a>
impl<'a> VertexStream<'a>
sourcepub fn new<T>(ptr: *const T) -> VertexStream<'a>
pub fn new<T>(ptr: *const T) -> VertexStream<'a>
Create a VertexStream
for a buffer consisting only of elements of type T
.
sourcepub fn new_with_stride<T, VertexType>(
ptr: *const VertexType,
stride: usize
) -> VertexStream<'a>
pub fn new_with_stride<T, VertexType>( ptr: *const VertexType, stride: usize ) -> VertexStream<'a>
Create a VertexStream
for a buffer that contains elements of type VertexType
.
The buffer pointed to by ptr
starts with one value of T
, the next value of T
is *(ptr + stride)
.
(The VertexType
does not need to be a concrete type,
it is only used here to avoid casts on the caller side).
Trait Implementations§
source§impl<'a> Clone for VertexStream<'a>
impl<'a> Clone for VertexStream<'a>
source§fn clone(&self) -> VertexStream<'a>
fn clone(&self) -> VertexStream<'a>
Returns a copy 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 moresource§impl<'a> Debug for VertexStream<'a>
impl<'a> Debug for VertexStream<'a>
impl<'a> Copy for VertexStream<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for VertexStream<'a>
impl<'a> !Send for VertexStream<'a>
impl<'a> !Sync for VertexStream<'a>
impl<'a> Unpin for VertexStream<'a>
impl<'a> UnwindSafe for VertexStream<'a>
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