Struct gfx::render::mesh::Mesh [] [src]

pub struct Mesh<R: Resources> {
    pub num_vertices: VertexCount,
    pub attributes: Vec<Attribute<R>>,
}

Describes geometry to render.

Fields

num_vertices

Number of vertices in the mesh.

attributes

Vertex attributes to use.

Methods

impl<R: Resources> Mesh<R>

fn new(nv: VertexCount) -> Mesh<R>

Create a new mesh, which is a TriangleList with no attributes and nv vertices.

fn from_format<V: VertexFormat>(buf: Buffer<R, V>, nv: VertexCount) -> Mesh<R>

Create a new Mesh from a struct that implements VertexFormat and a buffer.

fn from_format_instanced<V: VertexFormat, U: VertexFormat>(buf: Buffer<R, V>, nv: VertexCount, inst: Buffer<R, U>) -> Mesh<R>

Create a new intanced Mesh given a vertex buffer and an instance buffer.

Trait Implementations

impl<R: Resources> ToSlice<R> for Mesh<R>

fn to_slice(&self, ty: PrimitiveType) -> Slice<R>

Derived Implementations

impl<R: PartialEq + Resources> PartialEq for Mesh<R> where R: PartialEq

fn eq(&self, __arg_0: &Mesh<R>) -> bool

fn ne(&self, __arg_0: &Mesh<R>) -> bool

impl<R: Hash + Resources> Hash for Mesh<R> where R: Hash

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<R: Eq + Resources> Eq for Mesh<R> where R: Eq

impl<R: Debug + Resources> Debug for Mesh<R> where R: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<R: Clone + Resources> Clone for Mesh<R> where R: Clone

fn clone(&self) -> Mesh<R>

fn clone_from(&mut self, source: &Self)