Macro glium::implement_vertex
source · 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),+,) => { ... }; }
Expand description
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.
Safety
You must not use this macro on any struct with fields that cannot be zeroed.
Example
#[derive(Copy, Clone)]
struct Vertex {
position: [f32; 3],
tex_coords: [f32; 2],
}
implement_vertex!(Vertex, position, tex_coords);