main_loop-0.3.3 doesn't have any documentation.
main_loop
main loop for real time applications
No Default features
main_loop = { version = "0.3", default-features = false }
extern crate main_loop;
use main_loop::ControlFlow;
fn main() {
main_loop::run(|ms| {
println!("{:?}ms since start", ms);
ControlFlow::Continue
});
}
glutin
main_loop = { version = "0.3" }
extern crate glutin;
extern crate main_loop;
use main_loop::ControlFlow;
fn main() {
let mut events_loop = glutin::EventsLoop::new();
let window = glutin::WindowBuilder::new()
.with_title("Glutin")
.with_dimensions(512, 512);
let context = glutin::ContextBuilder::new();
let _gl_window = glutin::GlWindow::new(window, context, &events_loop).unwrap();
main_loop::glutin::run(&mut events_loop, |events, ms| {
println!("{:?}ms since start", ms);
for event in events {
println!("{:?}", event);
}
ControlFlow::Continue
});
}
winit
main_loop = { version = "0.3" }
extern crate main_loop;
extern crate winit;
use main_loop::ControlFlow;
use winit::{EventsLoop, Window};
fn main() {
let mut events_loop = EventsLoop::new();
let _window = Window::new(&events_loop).unwrap();
main_loop::winit::run(&mut events_loop, |events, ms| {
println!("{:?}ms since start", ms);
for event in events {
println!("{:?}", event);
}
ControlFlow::Continue
});
}