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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user