|
|
|
@ -236,7 +236,11 @@ pub fn main() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut canvas_frame = CanvasFrame::default();
|
|
|
|
|
canvas_frame.draw(&funky_sprite);
|
|
|
|
|
canvas_frame.draw(&compu_sprite1);
|
|
|
|
|
canvas_frame.draw(&slider);
|
|
|
|
|
|
|
|
|
|
// Events loop is borrowed from the surface
|
|
|
|
|
events_loop.run(move |event, _, control_flow| {
|
|
|
|
@ -263,11 +267,10 @@ pub fn main() {
|
|
|
|
|
Event::UserEvent(TrEvent::GamepadEvent { gil_event }) => {}
|
|
|
|
|
Event::DeviceEvent { event: DeviceEvent::Key(keyboard_input), .. } => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
match keyboard_input.virtual_keycode.unwrap() {
|
|
|
|
|
VirtualKeyCode::A => {
|
|
|
|
|
if keyboard_input.state == ElementState::Pressed {
|
|
|
|
|
// processor.save_edges_image();
|
|
|
|
|
funky_sprite.position.0 += 0.1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
VirtualKeyCode::P => {
|
|
|
|
@ -282,24 +285,7 @@ pub fn main() {
|
|
|
|
|
|
|
|
|
|
Event::MainEventsCleared => {
|
|
|
|
|
|
|
|
|
|
// while let true = processor.is_open() {
|
|
|
|
|
//
|
|
|
|
|
// // Take care of our timing
|
|
|
|
|
// {
|
|
|
|
|
// elapsed_time = timer.elap_time();
|
|
|
|
|
// delta_time = elapsed_time - current_time;
|
|
|
|
|
// current_time = elapsed_time;
|
|
|
|
|
// if delta_time > 0.02 {
|
|
|
|
|
// delta_time = 0.02;
|
|
|
|
|
// }
|
|
|
|
|
// accumulator_time += delta_time;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// while (accumulator_time - step_size) >= step_size {
|
|
|
|
|
// accumulator_time -= step_size;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
canvas_frame = CanvasFrame::default();
|
|
|
|
|
canvas_frame.draw(&funky_sprite);
|
|
|
|
|
canvas_frame.draw(&compu_sprite1);
|
|
|
|
|
canvas_frame.draw(&slider);
|
|
|
|
@ -355,9 +341,22 @@ pub fn click_test(event_loop_proxy: EventLoopProxy<TrEvent>, canvas_state: &Canv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// while let true = processor.is_open() {
|
|
|
|
|
//
|
|
|
|
|
// // Take care of our timing
|
|
|
|
|
// {
|
|
|
|
|
// elapsed_time = timer.elap_time();
|
|
|
|
|
// delta_time = elapsed_time - current_time;
|
|
|
|
|
// current_time = elapsed_time;
|
|
|
|
|
// if delta_time > 0.02 {
|
|
|
|
|
// delta_time = 0.02;
|
|
|
|
|
// }
|
|
|
|
|
// accumulator_time += delta_time;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// while (accumulator_time - step_size) >= step_size {
|
|
|
|
|
// accumulator_time -= step_size;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|