fix some issues caused by the rebase
This commit is contained in:
parent
7063f57a7b
commit
d51e783a50
|
@ -13,7 +13,7 @@ use tracing_subscriber::{
|
||||||
|
|
||||||
use winit::{window::{WindowBuilder, Window}, event::{Event, WindowEvent, KeyboardInput, ElementState, VirtualKeyCode}, event_loop::{EventLoop, ControlFlow}};
|
use winit::{window::{WindowBuilder, Window}, event::{Event, WindowEvent, KeyboardInput, ElementState, VirtualKeyCode}, event_loop::{EventLoop, ControlFlow}};
|
||||||
|
|
||||||
use crate::{render::{renderer::{Renderer, BasicRenderer}, render_job::RenderJob}, input_event::InputEvent, ecs::components::{mesh::MeshComponent, transform::TransformComponent}};
|
use crate::{render::{renderer::{Renderer, BasicRenderer}, render_job::RenderJob}, input_event::InputEvent, ecs::{components::{mesh::MeshComponent, transform::TransformComponent}, SystemFnExecutor, SimpleSystem}};
|
||||||
|
|
||||||
struct TickCounter {
|
struct TickCounter {
|
||||||
counter: u32,
|
counter: u32,
|
||||||
|
|
|
@ -358,6 +358,14 @@ impl Renderer for BasicRenderer {
|
||||||
self.buffer_storage.insert(entity, buffers);
|
self.buffer_storage.insert(entity, buffers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the active camera
|
||||||
|
if let Some((_e, (camera,))) = main_world.query_mut::<(&mut CameraComponent,)>().into_iter().next() {
|
||||||
|
let view_proj = self.inuse_camera.update_view_projection(camera);
|
||||||
|
self.queue.write_buffer(&self.camera_buffer, 0, bytemuck::cast_slice(&[view_proj.clone()]));
|
||||||
|
} else {
|
||||||
|
warn!("Missing camera!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
|
async fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
|
||||||
|
|
Loading…
Reference in New Issue