Trait GenericMesh

Source
pub trait GenericMesh: Debug {
Show 17 methods // Required methods fn get_primitive(&self) -> PrimitiveMode; fn get_vertex_buffer(&self) -> &Buffer; fn get_element_buffer(&self) -> Option<&Buffer>; fn get_element_type(&self) -> ElementType; fn get_instance_buffer(&self) -> Option<&Buffer>; fn get_command_buffer(&self) -> Option<&Buffer>; fn get_vertex_stride(&self) -> usize; fn get_instance_stride(&self) -> usize; fn get_vertex_count(&self) -> usize; fn get_element_count(&self) -> usize; fn get_instance_count(&self) -> usize; fn get_command_count(&self) -> usize; // Provided methods fn flush(&mut self) -> Result<(), GLCoreError> { ... } fn bind_vertex_buffer<'a>(&'a self) -> Result<BufferBind<'a>, GLCoreError> { ... } fn bind_element_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError> { ... } fn bind_instance_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError> { ... } fn bind_command_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError> { ... }
}
Expand description

The GenericMesh trait helps the Mesh struct to be able to turn into an object

Required Methods§

Source

fn get_primitive(&self) -> PrimitiveMode

Get the primitive mode of the mesh

Source

fn get_vertex_buffer(&self) -> &Buffer

Get the vertex buffer of the mesh

Source

fn get_element_buffer(&self) -> Option<&Buffer>

Get the element buffer of the mesh

Source

fn get_element_type(&self) -> ElementType

Get the type of the element buffer

Source

fn get_instance_buffer(&self) -> Option<&Buffer>

Get the instance buffer of the mesh

Source

fn get_command_buffer(&self) -> Option<&Buffer>

Get the draw command buffer of the mesh

Source

fn get_vertex_stride(&self) -> usize

Get the size of each vertex

Source

fn get_instance_stride(&self) -> usize

Get the size of each instance

Source

fn get_vertex_count(&self) -> usize

Get the number of vertices

Source

fn get_element_count(&self) -> usize

Get the number of the elements

Source

fn get_instance_count(&self) -> usize

Get the number of the instances

Source

fn get_command_count(&self) -> usize

Get the number of the draw commands

Provided Methods§

Source

fn flush(&mut self) -> Result<(), GLCoreError>

Flush the cache if the mesh has a caching system

Source

fn bind_vertex_buffer<'a>(&'a self) -> Result<BufferBind<'a>, GLCoreError>

Bind the vertex buffer

Source

fn bind_element_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>

Bind the element buffer

Source

fn bind_instance_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>

Bind the instance buffer

Source

fn bind_command_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>

Bind the command buffer

Implementors§

Source§

impl<BV, V, BE, E, BI, I, BC, C> GenericMesh for Mesh<BV, V, BE, E, BI, I, BC, C>
where BV: BufferVec<V>, BE: BufferVec<E>, BI: BufferVec<I>, BC: BufferVec<C>, V: BufferVecItem, E: BufferVecItem, I: BufferVecItem, C: BufferVecItem,

Source§

impl<M: GenericMesh, Mat: Material> GenericMesh for MeshWithMaterial<M, Mat>