Got the vertex definition into the load function. Which is something
This commit is contained in:
@@ -53,20 +53,44 @@ impl CanvasFrame {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct Pair<T> {
|
||||
x: T,
|
||||
y: T,
|
||||
}
|
||||
|
||||
impl Pair<Vertex3D> {
|
||||
fn new(x: Vertex3D, y: Vertex3D) -> Self {
|
||||
Self {
|
||||
x,
|
||||
y,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Pair<GlyphInstance> {
|
||||
fn new(x: GlyphInstance, y: GlyphInstance) -> Self {
|
||||
Self {
|
||||
x,
|
||||
y,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct GenericCanvasFrame<H, V, In> {
|
||||
frame_data: HashMap<H, Vec<(Vec<V>, Vec<In>)>>
|
||||
}
|
||||
|
||||
impl<H, V, In> GenericCanvasFrame<H, V, In> {
|
||||
impl<V, In> GenericCanvasFrame<Vertex3D, V, In> {
|
||||
|
||||
/// Creates a bare canvas frame with empty accumulators
|
||||
pub fn new() -> GenericCanvasFrame<H, V, In> where H: Eq + Hash {
|
||||
pub fn new() -> GenericCanvasFrame<Vertex3D, V, In> {
|
||||
GenericCanvasFrame {
|
||||
frame_data: Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn draw(&mut self, drawable: &dyn DrawableTest<V, H, In>) where H: Eq + Hash + Clone {
|
||||
pub fn draw(&mut self, drawable: &dyn DrawableTest<V, Vertex3D, In>) {
|
||||
self.frame_data
|
||||
.entry(drawable.get_handle().clone())
|
||||
.or_insert(Vec::new())
|
||||
|
||||
Reference in New Issue
Block a user