From c48b54f3fb7bbe9046915eb99eca02fa84dc55c9 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:22 +0100 Subject: feat(render): multithreaded texture loading also a bunch of supporting changes --- examples/render-bsp/src/main.rs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'examples/render-bsp/src/main.rs') diff --git a/examples/render-bsp/src/main.rs b/examples/render-bsp/src/main.rs index ec39b24..cf6f3f6 100644 --- a/examples/render-bsp/src/main.rs +++ b/examples/render-bsp/src/main.rs @@ -30,10 +30,10 @@ use stockton_contrib::delta_time::*; use stockton_contrib::flycam::*; use stockton_input::{Axis, InputManager, Mouse}; -use stockton_levels::{prelude::*, q3::Q3BSPFile}; +use stockton_levels::{prelude::*, q3::Q3BspFile}; use stockton_render::systems::*; -use stockton_render::{Renderer, UIState, WindowEvent}; +use stockton_render::{Renderer, UiState, WindowEvent}; use stockton_types::components::{CameraSettings, Transform}; use stockton_types::{Session, Vector3}; @@ -63,7 +63,7 @@ impl FlycamInput for MovementInputs { } #[system] -fn hello_world(#[resource] ui: &mut UIState) { +fn hello_world(#[resource] ui: &mut UiState) { let ui = ui.ui(); ui.heading("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); } @@ -88,13 +88,13 @@ fn main() { let data = include_bytes!("../data/newtest.bsp") .to_vec() .into_boxed_slice(); - let bsp: Result, stockton_levels::types::ParseError> = - Q3BSPFile::parse_file(&data); - let bsp: Q3BSPFile = bsp.unwrap(); - let bsp: Q3BSPFile = bsp.swizzle_to(); + let bsp: Result, stockton_levels::types::ParseError> = + Q3BspFile::parse_file(&data); + let bsp: Q3BspFile = bsp.unwrap(); + let bsp: Q3BspFile = bsp.swizzle_to(); // Create the renderer - let (renderer, tx) = Renderer::new(&window, &bsp); + let (renderer, tx) = Renderer::new(&window, bsp); let new_control_flow = renderer.update_control_flow.clone(); // Create the input manager @@ -117,9 +117,8 @@ fn main() { // Load everything into the session let mut session = Session::new( move |resources| { - resources.insert(UIState::new(&renderer)); + resources.insert(UiState::new(&renderer)); resources.insert(renderer); - resources.insert(bsp); resources.insert(manager); resources.insert(Timing::default()); resources.insert(Mouse::default()); @@ -127,13 +126,16 @@ fn main() { move |schedule| { schedule .add_system(update_deltatime_system()) - .add_system(process_window_events_system::()) + .add_system(process_window_events_system::< + MovementInputsManager, + Q3BspFile, + >()) .flush() .add_system(hello_world_system()) .add_system(flycam_move_system::()) .flush() - .add_system(calc_vp_matrix_system()) - .add_thread_local(do_render_system::>()); + .add_system(calc_vp_matrix_system::>()) + .add_thread_local(do_render_system::>()); }, ); -- cgit v1.2.3