oh my god it compiles. A month of brainstorming comes out to a single enum

This commit is contained in:
2020-02-06 23:38:28 -08:00
parent 1597f0e380
commit cd0c1e6052
4 changed files with 148 additions and 56 deletions

View File

@@ -25,7 +25,7 @@ use crate::util::load_raw;
use crate::sprite::{Poly, Text, TextHandle, TextVertex, TextInstance};
use vulkano::instance::debug::DebugCallback;
use crate::compute::compu_frame::CompuFrame;
use crate::canvas::canvas_frame::{CanvasFrame, DrawableTestee, CanvasFrameTest, ImplVertexData};
use crate::canvas::canvas_frame::{CanvasFrame, CanvasFrameTest};
use crate::compute::managed::compu_sprite::CompuSprite;
use std::sync::Arc;
use crate::canvas::managed::handles::CanvasTextureHandle;
@@ -55,6 +55,23 @@ pub mod compute;
*/
pub struct ImplVertexData1 {
pub x: i32,
pub y: i32,
}
pub struct ImplVertexData2 {
pub x: i32,
pub y: i32,
}
impl ImplVertexData1 {}
impl ImplVertexData2 {}
enum VertexTypes {
VType1(ImplVertexData1),
VType2(ImplVertexData2),
}
pub fn main() {
hprof::start_frame();
@@ -182,12 +199,14 @@ pub fn main() {
break;
}
let dt = DrawableTestee{
vertices: vec![ImplVertexData{ x: 0, y: 0 }],
handle: Arc::new(Default::default())
};
let mut cft :CanvasFrameTest<ImplVertexData, CanvasTextureHandle>= CanvasFrameTest{ map: Default::default() };
cft.draw(&dt);
// let dt = DrawableTestee{
// vertices: vec![ImplVertexData{ x: 0, y: 0 }],
// handle: Arc::new(CanvasTextureHandle{ handle: 0 })
// };
let mut cft : CanvasFrameTest<VertexTypes> =
CanvasFrameTest{ map: Default::default() };
// cft.draw(&dt);
let mut compu_frame = CompuFrame::new();
// compu_frame.add(compute_buffer.clone(), compute_kernel.clone());