pub unsafe trait Vertex {
type Projection: Projection + 'static;
const DEF: Define<VectorType>;
}
Expand description
The vertex type description.
§Safety
The fields of Define
must exactly match the actual struct fields.
To do this, the fields must be ordered, so the struct must have the #[repr(C)]
attribute and the fields must have the same order as specified in Define
.
§Deriving
Although the library tries to formalize the safety invariant, you still shouldn’t implement the vertex yourself. The most reliable and simple way to do this is to use a derive macro:
use dunge::Vertex;
#[repr(C)]
#[derive(Vertex)]
struct Vert {
pos: [f32; 2],
col: [f32; 3],
}
Required Associated Types§
type Projection: Projection + 'static
Required Associated Constants§
const DEF: Define<VectorType>
Object Safety§
This trait is not object safe.