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§
Sourcefn get_primitive(&self) -> PrimitiveMode
fn get_primitive(&self) -> PrimitiveMode
Get the primitive mode of the mesh
Sourcefn get_vertex_buffer(&self) -> &Buffer
fn get_vertex_buffer(&self) -> &Buffer
Get the vertex buffer of the mesh
Sourcefn get_element_buffer(&self) -> Option<&Buffer>
fn get_element_buffer(&self) -> Option<&Buffer>
Get the element buffer of the mesh
Sourcefn get_element_type(&self) -> ElementType
fn get_element_type(&self) -> ElementType
Get the type of the element buffer
Sourcefn get_instance_buffer(&self) -> Option<&Buffer>
fn get_instance_buffer(&self) -> Option<&Buffer>
Get the instance buffer of the mesh
Sourcefn get_command_buffer(&self) -> Option<&Buffer>
fn get_command_buffer(&self) -> Option<&Buffer>
Get the draw command buffer of the mesh
Sourcefn get_vertex_stride(&self) -> usize
fn get_vertex_stride(&self) -> usize
Get the size of each vertex
Sourcefn get_instance_stride(&self) -> usize
fn get_instance_stride(&self) -> usize
Get the size of each instance
Sourcefn get_vertex_count(&self) -> usize
fn get_vertex_count(&self) -> usize
Get the number of vertices
Sourcefn get_element_count(&self) -> usize
fn get_element_count(&self) -> usize
Get the number of the elements
Sourcefn get_instance_count(&self) -> usize
fn get_instance_count(&self) -> usize
Get the number of the instances
Sourcefn get_command_count(&self) -> usize
fn get_command_count(&self) -> usize
Get the number of the draw commands
Provided Methods§
Sourcefn flush(&mut self) -> Result<(), GLCoreError>
fn flush(&mut self) -> Result<(), GLCoreError>
Flush the cache if the mesh has a caching system
Sourcefn bind_vertex_buffer<'a>(&'a self) -> Result<BufferBind<'a>, GLCoreError>
fn bind_vertex_buffer<'a>(&'a self) -> Result<BufferBind<'a>, GLCoreError>
Bind the vertex buffer
Sourcefn bind_element_buffer<'a>(
&'a self,
) -> Result<Option<BufferBind<'a>>, GLCoreError>
fn bind_element_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>
Bind the element buffer
Sourcefn bind_instance_buffer<'a>(
&'a self,
) -> Result<Option<BufferBind<'a>>, GLCoreError>
fn bind_instance_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>
Bind the instance buffer
Sourcefn bind_command_buffer<'a>(
&'a self,
) -> Result<Option<BufferBind<'a>>, GLCoreError>
fn bind_command_buffer<'a>( &'a self, ) -> Result<Option<BufferBind<'a>>, GLCoreError>
Bind the command buffer