gilrs test
parent
fe95327ca8
commit
15c75d8baf
14
src/main.rs
14
src/main.rs
|
@ -3,6 +3,7 @@ use std::thread;
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
use egui_glow::EguiGlow;
|
||||
use gilrs::Gilrs;
|
||||
use glow::HasContext;
|
||||
|
||||
use bevy_ecs::prelude::*;
|
||||
|
@ -128,7 +129,7 @@ fn main() {
|
|||
gl.blend_func(glow::ONE, glow::ZERO);
|
||||
}
|
||||
|
||||
// TODO write bevy Init code here
|
||||
// NOTE bevy Init code here
|
||||
|
||||
let mut world = World::new();
|
||||
let mut schedule = Schedule::default();
|
||||
|
@ -142,9 +143,20 @@ fn main() {
|
|||
let _ = world.run_system(init_defaults);
|
||||
let _ = world.run_system(initialize_test);
|
||||
|
||||
// NOTE gilrs
|
||||
let mut gilrs = Gilrs::new().unwrap();
|
||||
|
||||
let _ = event_loop.run(move |event, _, control_flow| {
|
||||
// new_frame for Framerate Locking
|
||||
let new_frame = Instant::now() + Duration::from_secs_f32(1.0 / 60.0);
|
||||
|
||||
// NOTE process controllers
|
||||
// TESTING
|
||||
// TODO
|
||||
|
||||
while let Some(Event { id, event, time }) = gilrs.next_event() {
|
||||
println!("{:?} New Event from {}: {:?}", time, id, event);
|
||||
}
|
||||
match event {
|
||||
Event::WindowEvent { event, .. } => {
|
||||
if gui.passEvent(&event) == false {
|
||||
|
|
Loading…
Reference in New Issue