feat: implemented a Camera2D component that works with the Renderer2D

Renders with only one camera (the first by ID) rn but should work
This commit is contained in:
lisk77 2025-03-07 23:42:12 +01:00
parent e6df3dba91
commit 8b439cb0e8
4 changed files with 178 additions and 45 deletions

View file

@ -24,6 +24,7 @@ use winit_input_helper::WinitInputHelper;
use comet_input::input_handler::InputHandler;
use comet_input::keyboard::Key;
use comet_renderer::renderer::Renderer;
use comet_structs::ComponentSet;
use crate::GameState;
pub enum ApplicationType {
@ -187,6 +188,10 @@ impl App {
self.world.get_component_mut::<C>(entity_id)
}
pub fn get_entities_with(&self, components: ComponentSet) -> Vec<usize> {
self.world.get_entities_with(components)
}
pub fn quit(&mut self) {
self.should_quit = true;
}