1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Add time as input to emigui to enable animations

This commit is contained in:
Emil Ernerfeldt
2020-04-21 14:46:42 +02:00
parent 11cd1bdca3
commit 0ed578341b
4 changed files with 18 additions and 0 deletions

View File

@@ -36,6 +36,9 @@ fn main() {
let mut quit = false;
// used to keep track of time for animations
let start_time = Instant::now();
let mut frame_start = Instant::now();
let mut example_app = ExampleApp::default();
@@ -50,6 +53,8 @@ fn main() {
frame_start = Instant::now();
}
raw_input.time = start_time.elapsed().as_nanos() as f64 * 1e-9;
events_loop.poll_events(|event| {
match event {
glutin::Event::WindowEvent { event, .. } => match event {