draw() is a nicer name
This commit is contained in:
parent
36c16d053e
commit
65bb4d4897
@ -34,16 +34,16 @@ pub enum Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Geometry {
|
impl Geometry {
|
||||||
pub fn greet(&self) {
|
pub fn draw(&self) {
|
||||||
match self {
|
match self {
|
||||||
Geometry::Sphere(_) => {
|
Geometry::Sphere(_) => {
|
||||||
println!("Sphere!");
|
println!("Drawing Sphere!");
|
||||||
}
|
}
|
||||||
Geometry::Line(_) => {
|
Geometry::Line(_) => {
|
||||||
println!("Line!");
|
println!("Drawing Line!");
|
||||||
}
|
}
|
||||||
Geometry::Plane(_) => {
|
Geometry::Plane(_) => {
|
||||||
println!("Plane!");
|
println!("Drawing Plane!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ fn main() {
|
|||||||
let tex = Rc::new(Texture::load_texture());
|
let tex = Rc::new(Texture::load_texture());
|
||||||
|
|
||||||
let sphere = Geometry::Sphere(Sphere::new(Point3::new(0.0, 0.0, 0.0), 1.0));
|
let sphere = Geometry::Sphere(Sphere::new(Point3::new(0.0, 0.0, 0.0), 1.0));
|
||||||
sphere.greet();
|
sphere.draw();
|
||||||
|
|
||||||
let geo1 = RenderableGeometry::new(
|
let geo1 = RenderableGeometry::new(
|
||||||
Mat4x4::ident(),
|
Mat4x4::ident(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user