Crates.io | main_loop |
lib.rs | main_loop |
version | 0.3.3 |
source | src |
created_at | 2017-11-26 21:22:07.606996 |
updated_at | 2018-11-24 17:26:02.684489 |
description | main loop for real time applications |
homepage | https://gitlab.com/nathanfaucett/rs-main_loop |
repository | https://gitlab.com/nathanfaucett/rs-main_loop.git |
max_upload_size | |
id | 40660 |
size | 13,592 |
main loop for real time applications
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
});
}
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
});
}
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
});
}