From f06880383420da3f8d14079817ff271e71791abb Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 19 May 2024 21:41:41 +0200 Subject: fix: use updated engine light API --- src/main.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 8346cbf..2a4f9e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use engine::file_format::wavefront::mtl::parse as parse_mtl; use engine::file_format::wavefront::obj::parse as parse_obj; use engine::input::Extension as InputExtension; use engine::lighting::{GlobalLight, LightSource}; -use engine::material::Builder as MaterialBuilder; +use engine::material::{Builder as MaterialBuilder, Flags as MaterialFlags}; use engine::renderer::Extension as RendererExtension; use engine::shader::Program as ShaderProgram; use engine::transform::Transform; @@ -82,15 +82,12 @@ fn main() -> Result<(), Box> .to_mesh()?, MaterialBuilder::new().ambient(YELLOW * 5.0).build(), ShaderProgram::new()?, + MaterialFlags::builder().use_ambient_color(true).build(), )); engine.spawn((Camera { current: true, ..Default::default() },)); - engine.add_sole( - GlobalLight::builder() - .ambient_offset(-Color::WHITE_F32) - .build(), - )?; + engine.add_sole(GlobalLight::default())?; engine.register_system(StartEvent, prepare_window); -- cgit v1.2.3-18-g5258