fix some issues caused by the rebase

This commit is contained in:
SeanOMik 2023-06-07 00:53:33 -04:00
parent 35eb2842fb
commit 74e21a083b
2 changed files with 9 additions and 1 deletions

View File

@ -13,7 +13,7 @@ use tracing_subscriber::{
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 {
counter: u32,

View File

@ -358,6 +358,14 @@ impl Renderer for BasicRenderer {
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> {