[][src]Macro processing::implement_vertex

macro_rules! implement_vertex {
    ( $ struct_name : ident , $ ( $ field_name : ident ) , + ) => { ... };
    (
$ struct_name : ident , $ (
$ field_name : ident normalize ( $ should_normalize : expr ) ) , + ) => { ... };
    ( $ struct_name : ident , $ ( $ field_name : ident ) , + , ) => { ... };
}

Implements the glium::vertex::Vertex trait for the given type.

The parameters must be the name of the struct and the names of its fields.

Example

#[derive(Copy, Clone)]
struct Vertex {
    position: [f32; 3],
    tex_coords: [f32; 2],
}

implement_vertex!(Vertex, position, tex_coords);