pub struct VertexBuffer {
pub vertex_count: usize,
pub layout: VertexLayout,
/* private fields */
}Expand description
An interleaved vertex buffer (pos + normal + UV).
Fields§
§vertex_count: usizeNumber of vertices.
layout: VertexLayoutVertex layout.
Implementations§
Source§impl VertexBuffer
impl VertexBuffer
Sourcepub fn new(layout: VertexLayout) -> Self
pub fn new(layout: VertexLayout) -> Self
Create an empty vertex buffer.
Sourcepub fn upload_f32(&mut self, vertices: &[[f32; 8]])
pub fn upload_f32(&mut self, vertices: &[[f32; 8]])
Upload vertices from a slice of f32 arrays \[px, py, pz, nx, ny, nz, u, v\].
Trait Implementations§
Source§impl Clone for VertexBuffer
impl Clone for VertexBuffer
Source§fn clone(&self) -> VertexBuffer
fn clone(&self) -> VertexBuffer
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 VertexBuffer
impl RefUnwindSafe for VertexBuffer
impl Send for VertexBuffer
impl Sync for VertexBuffer
impl Unpin for VertexBuffer
impl UnsafeUnpin for VertexBuffer
impl UnwindSafe for VertexBuffer
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