diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-05 21:28:53 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-05 21:29:02 +0200 |
commit | c9d5bbfe490aa4aab0e9de02b67bf8fee6dca5a2 (patch) | |
tree | 03210fe1672f84bed6834a01f087b032bc35fc17 /engine/src/renderer/mod.rs | |
parent | 9530d22cf5369ceba369487fff1b85376da64657 (diff) |
refactor(engine): make Material hold textures
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index af91257..fbb86f7 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -37,7 +37,7 @@ use crate::opengl::vertex_array::{ use crate::opengl::{clear_buffers, enable, BufferClearMask, Capability}; use crate::projection::{new_perspective_matrix, Projection}; use crate::shader::Program as ShaderProgram; -use crate::texture::{Id as TextureId, List as TextureMap, Texture}; +use crate::texture::{Id as TextureId, Texture}; use crate::transform::Transform; use crate::vector::{Vec2, Vec3}; use crate::vertex::{AttributeComponentType, Vertex}; @@ -91,7 +91,7 @@ fn initialize(window: Single<Window>) } fn render( - query: Query<(Mesh, TextureMap, ShaderProgram, Material, Transform)>, + query: Query<(Mesh, ShaderProgram, Material, Transform)>, light_source_query: Query<(LightSource, Transform)>, camera_query: Query<(Camera,)>, window: Single<Window>, @@ -124,7 +124,7 @@ fn render( clear_buffers(BufferClearMask::COLOR | BufferClearMask::DEPTH); - for (mesh, texture_list, shader_program, material, transform) in &query { + for (mesh, shader_program, material, transform) in &query { let shader_program = gl_shader_programs .entry(shader_program.u64_hash()) .or_insert_with(|| create_gl_shader_program(&shader_program).unwrap()); @@ -147,7 +147,7 @@ fn render( &camera, ); - for texture in &texture_list.list { + for texture in material.textures() { let gl_texture = gl_textures .entry(texture.id()) .or_insert_with(|| create_gl_texture(texture)); |