summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs
index 97c7615..03fb441 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -11,7 +11,7 @@ use engine::lighting::{LightSource, LightSourceBuilder};
use engine::material::Builder as MaterialBuilder;
use engine::renderer::Extension as RendererExtension;
use engine::shader::Program as ShaderProgram;
-use engine::texture::{Id as TextureId, Map as TextureMap, Texture};
+use engine::texture::{List as TextureList, Texture};
use engine::transform::Transform;
use engine::vector::{Vec2, Vec3};
use engine::vertex::Builder as VertexBuilder;
@@ -126,16 +126,17 @@ fn main() -> Result<(), Box<dyn Error>>
transform.set_position(Vec3 { x: 1.6, y: 0.0, z: 0.0 });
+ let texture = Texture::open(Path::new("vent.png"))?;
+
+ let texture_id = texture.id();
+
engine.spawn((
create_cube_mesh(cube_vertex_builder_cb),
- TextureMap::from_iter([(
- TextureId::new(0),
- Texture::open(Path::new("vent.png"))?,
- )]),
+ TextureList::from_iter([texture]),
MaterialBuilder::new()
- .ambient_map(TextureId::new(0))
- .diffuse_map(TextureId::new(0))
- .specular_map(TextureId::new(0))
+ .ambient_map(texture_id)
+ .diffuse_map(texture_id)
+ .specular_map(texture_id)
.build(),
transform,
ShaderProgram::new()?,