Most of the compute side is mocked up and compiling.

This commit is contained in:
2019-08-28 00:35:36 -07:00
parent 9b8d5cd828
commit a3607ebc7d
6 changed files with 211 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
use crate::canvas::Drawable;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct Sprite {
@@ -9,7 +10,7 @@ pub struct Sprite {
color: (f32, f32, f32, f32),
textured: bool,
texture_id: Option<String>,
texture_id: Option<Arc<u32>>,
}
@@ -41,7 +42,7 @@ impl Sprite {
}
}
pub fn new_with_texture(position: (f32, f32), size: (f32, f32), texture_id: String) -> Sprite {
pub fn new_with_texture(position: (f32, f32), size: (f32, f32), texture_id: Arc<u32>) -> Sprite {
let fsize = (size.0 as f32, size.1 as f32);
@@ -75,7 +76,7 @@ impl Drawable for Sprite {
self.color.clone()
}
fn get_texture_id(&self) -> Option<String> {
fn get_texture_handle(&self) -> Option<Arc<u32>> {
match self.textured {
true => {
self.texture_id.clone()
@@ -83,6 +84,10 @@ impl Drawable for Sprite {
false => None,
}
}
fn get_image_handle(&self) -> Option<Arc<u32>> {
None
}
}
/*