Struct ExampleVertices

Source
pub struct ExampleVertices<'buffers, R: Renderable> { /* private fields */ }
Expand description

This structure provides for creating example objects, particularly with regard to their vertices

It uses arrays of [Pin]ned data structures so that the data can be safely self-referential

Implementations§

Source§

impl<'a, R: Renderable> ExampleVertices<'a, R>

Source

pub fn new() -> Self

Create a new ExampleVertices

This should probably not be Pin<Box<>>

Source

pub fn push_byte_buffer(&mut self, buffer: Box<dyn ByteBuffer>) -> usize

Push a new ByteBuffer implementation and return its index

Source

pub fn push_index_accessor( &mut self, data: usize, num: u32, et: BufferElementType, ofs: u32, ) -> usize

Create a new [BufferAccessor] on a particular ByteBuffer instance that has already been pushed

Source

pub fn push_data_accessor( &mut self, data: usize, num: u32, et: BufferElementType, ofs: u32, stride: u32, ) -> usize

Create a new [BufferAccessor] on a particular ByteBuffer instance that has already been pushed

Source

pub fn push_vertices( &mut self, indices: Option<usize>, positions: usize, attrs: &[(VertexAttr, usize)], ) -> ShortIndex

Create a new Vertices using a set of indices and positions

This extends the life of the BufferAccessor to that of the ExampleVertices

This is safe as the BufferAccessor’s are in the Vec for ExampleVertices

Source

pub fn borrow_vertices(&self, vertices: ShortIndex) -> &Vertices<'_, R>

Borrow a set of vertices; this would allow (if mut!) the vertices to have attributes added

Trait Implementations§

Source§

impl<'a, R: Renderable> Default for ExampleVertices<'a, R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'buffers, R> !Freeze for ExampleVertices<'buffers, R>

§

impl<'buffers, R> !RefUnwindSafe for ExampleVertices<'buffers, R>

§

impl<'buffers, R> !Send for ExampleVertices<'buffers, R>

§

impl<'buffers, R> !Sync for ExampleVertices<'buffers, R>

§

impl<'buffers, R> Unpin for ExampleVertices<'buffers, R>
where <R as Renderable>::Vertices: Unpin,

§

impl<'buffers, R> !UnwindSafe for ExampleVertices<'buffers, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.