This commit is contained in:
2020-10-09 23:32:40 -07:00
parent c0b1c2e135
commit d1373fc061
4 changed files with 102 additions and 16 deletions

View File

@@ -26,7 +26,6 @@ pub struct EventSystem;
impl<'a> System<'a> for EventSystem {
type SystemData = (
Entities<'a>,
WriteStorage<'a, Position>,
WriteStorage<'a, Evented>,
Write<'a, PersistentState>,
Write<'a, VkProcessor>,
@@ -35,21 +34,19 @@ impl<'a> System<'a> for EventSystem {
fn run(&mut self, (
entity,
mut position_list,
mut evented_list,
mut state,
mut vk_processor,
event_stack
): Self::SystemData) {
for (position, evented) in (&mut position_list, &evented_list).join() {
for (evented) in (&evented_list).join() {
for event in &*event_stack {
match event {
TrEvent::WindowEvent { window_id, event } => {
match event {
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
if *state == ElementState::Pressed {
position.x += 100.0;
}
},
_ => {}

View File

@@ -148,7 +148,7 @@ pub fn main() {
compu_frame: CompuFrame::new((0, 0)),
});
/*
let mut g = Graph::new();
let mut matrix : Vec<Vec<NodeIndex<u32>>> = vec![vec![NodeIndex::new(1); 20]; 20];
@@ -158,7 +158,7 @@ pub fn main() {
}
}
for x in 0..20 {
for y in 0..20 {
@@ -176,10 +176,7 @@ pub fn main() {
(c, e, 1),
(e, f, 1),
(d, e, 1),
]);
]);*/
// and the thing that renders it
world.create_entity()