In the demo, handle events before updating the scene
@@ -184,12 +184,12 @@ impl<W> DemoApp<W> where W: Window {
}
pub fn prepare_frame(&mut self, events: Vec<Event>) -> u32 {
- // Update the scene.
- self.build_scene();
-
// Handle events.
let ui_events = self.handle_events(events);
+ // Update the scene.
+ self.build_scene();
+
// Get the render message, and determine how many scenes it contains.
let render_msg = self.scene_thread_proxy.receiver.recv().unwrap();
let render_scene_count = render_msg.render_scenes.len() as u32;
