Trait luminance::tess::HasTess
[−]
[src]
pub trait HasTess: HasBuffer { type Tess; fn new_tess<T>(mode: Mode,
vertices: &[T],
indices: Option<&[u32]>)
-> Self::Tess where T: Vertex; fn destroy_tess(tessellation: &mut Self::Tess); fn attributeless(mode: Mode, vert_nb: usize) -> Self::Tess; fn vertex_format(tessellation: &Self::Tess) -> &VertexFormat; fn get_vertex_buffer_ref_mut(tessellation: &mut Self::Tess)
-> Option<(&mut Self::ABuffer, usize)>; }
Trait to implement to provide tessellation features.
Associated Types
type Tess
A type representing tessellation on GPU.
Required Methods
fn new_tess<T>(mode: Mode,
vertices: &[T],
indices: Option<&[u32]>)
-> Self::Tess where T: Vertex
vertices: &[T],
indices: Option<&[u32]>)
-> Self::Tess where T: Vertex
Create a tessellation from its vertices and a Mode
.
If indices == None
, the vertices
represent an array of vertices that are connected to each
others in the order they appear. If you want to connect them in another way, you can index
them with Some(indices)
.
fn destroy_tess(tessellation: &mut Self::Tess)
Destroy a tessellation.
fn attributeless(mode: Mode, vert_nb: usize) -> Self::Tess
Create a tessellation that will procedurally generate its vertices (i.e. attribute-less).
You just have to give the Mode
to use and the number of vertices the tessellation must
have. You’ll be handed back a tessellation object that doesn’t actually hold anything. You
will have to generate the vertices on the fly in your shaders.
fn vertex_format(tessellation: &Self::Tess) -> &VertexFormat
Retrieve the vertex format the tessellation was created with.
fn get_vertex_buffer_ref_mut(tessellation: &mut Self::Tess)
-> Option<(&mut Self::ABuffer, usize)>
-> Option<(&mut Self::ABuffer, usize)>
Get a reference to the vertex buffer and the number of elements in it.