1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

remove seconds_from_midnight from core egui input

It is only used by demo app, and so does not belong to egui proper.
Instead it is now passed as part of a DemoEnvironment
This commit is contained in:
Emil Ernerfeldt
2020-09-23 08:57:23 +02:00
parent b84642374b
commit b77151fb64
7 changed files with 63 additions and 45 deletions

View File

@@ -38,6 +38,10 @@ impl Backend for GliumBackend {
1.0 / self.frame_times.mean_time_interval().unwrap_or_default()
}
fn seconds_since_midnight(&self) -> Option<f64> {
Some(seconds_since_midnight())
}
fn quit(&mut self) {
self.quit = true;
}
@@ -90,7 +94,6 @@ pub fn run(title: &str, mut storage: FileStorage, mut app: impl App + 'static) -
let mut redraw = || {
let egui_start = Instant::now();
raw_input.time = start_time.elapsed().as_nanos() as f64 * 1e-9;
raw_input.seconds_since_midnight = Some(local_time_of_day());
let mut ui = ctx.begin_frame(raw_input.take());
app.ui(&mut ui, &mut runner);