fn advance_frame(&mut self) {
        trace!("Advancing frame (`Application::advance_frame`)");

        {
            let world = &mut self.world;
            let states = &mut self.states;
            #[cfg(feature = "profiler")]
            profile_scope!("handle_event");

            let events = world
                .read_resource::<EventChannel<Event>>()
                .read(&mut self.events_reader_id)
                .cloned()
                .collect::<Vec<_>>();

            for event in events {
                states.handle_event(StateData::new(world, &mut self.data), event.clone());
                if !self.ignore_window_close {
                    if cfg!(target_os = "ios") {
                        if let &Event::WindowEvent {
                            event: WindowEvent::Destroyed,
                            ..
                        } = &event
                        {
                            states.stop(StateData::new(world, &mut self.data));
                        }
                    } else {
                        if let &Event::WindowEvent {
                            event: WindowEvent::CloseRequested,
                            ..
                        } = &event
                        {
                            states.stop(StateData::new(world, &mut self.data));
                        }
                    }
                }
            }
        }
        {
            let do_fixed = {
                let time = self.world.write_resource::<Time>();
                time.last_fixed_update().elapsed() >= time.fixed_time()
            };
            #[cfg(feature = "profiler")]
            profile_scope!("fixed_update");
            if do_fixed {
                self.states
                    .fixed_update(StateData::new(&mut self.world, &mut self.data));
                self.world.write_resource::<Time>().finish_fixed_update();
            }

            #[cfg(feature = "profiler")]
            profile_scope!("update");
            self.states
                .update(StateData::new(&mut self.world, &mut self.data));
        }

        #[cfg(feature = "profiler")]
        profile_scope!("maintain");
        self.world.maintain();

        // TODO: replace this with a more customizable method.
        // TODO: effectively, the user should have more control over error handling here
        // TODO: because right now the app will just exit in case of an error.
        self.world.write_resource::<Errors>().print_and_exit();
    }
/// Advances the game world by one tick.
Advances the game world by one tick.
Advances the game world by one tick .
fn advance_frame(&mut self) {
        trace!("Advancing frame (`Application::advance_frame`)");
        {
            let world = &mut self.world;
            let states = &mut self.states;
            #[cfg(feature = "profiler")]
            profile_scope!("handle_event");
            let events = world
                .read_resource::<EventChannel<Event>>()
                .read(&mut self.events_reader_id)
                .cloned()
                .collect::<Vec<_>>();
            for event in events {
                states.handle_event(StateData::new(world, &mut self.data), event.clone());
                if !self.ignore_window_close {
                    if cfg!(target_os = "ios") {
                        if let &Event::WindowEvent {
                            event: WindowEvent::Destroyed,
                            ..
                        } = &event
                        {
                            states.stop(StateData::new(world, &mut self.data));
                        }
                    } else {
                        if let &Event::WindowEvent {
                            event: WindowEvent::CloseRequested,
                            ..
                        } = &event
                        {
                            states.stop(StateData::new(world, &mut self.data));
                        }
                    }
                }
            }
        }
        {
            let do_fixed = {
                let time = self.world.write_resource::<Time>();
                time.last_fixed_update().elapsed() >= time.fixed_time()
            };
            #[cfg(feature = "profiler")]
            profile_scope!("fixed_update");
            if do_fixed {
                self.states
                    .fixed_update(StateData::new(&mut self.world, &mut self.data));
                self.world.write_resource::<Time>().finish_fixed_update();
            }
            #[cfg(feature = "profiler")]
            profile_scope!("update");
            self.states
                .update(StateData::new(&mut self.world, &mut self.data));
        }
        #[cfg(feature = "profiler")]
        profile_scope!("maintain");
        self.world.maintain();
        // TODO: replace this with a more customizable method.
        // TODO: effectively, the user should have more control over error handling here
        // TODO: because right now the app will just exit in case of an error.
        self.world.write_resource::<Errors>().print_and_exit();
    }
fn advance_frame ( & mut self ) { trace ! ( " " ) ; { let world = & mut self . world ; let states = & mut self . states ; # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; let events = world . read_resource :: < EventChannel < Event > > ( ) . read ( & mut self . events_reader_id ) . cloned ( ) . collect :: < Vec < _ > > ( ) ; for event in events { states . handle_event ( StateData :: new ( world , & mut self . data ) , event . clone ( ) ) ; if ! self . ignore_window_close { if cfg ! ( target_os " " ) { if let & Event :: WindowEvent { event : WindowEvent :: Destroyed , .. } = & event { states . stop ( StateData :: new ( world , & mut self . data ) ) ; } } else { if let & Event :: WindowEvent { event : WindowEvent :: CloseRequested , .. } = & event { states . stop ( StateData :: new ( world , & mut self . data ) ) ; } } } } } { let do_fixed = { let time = self . world . write_resource :: < Time > ( ) ; time . last_fixed_update ( ) . elapsed ( ) >= time . fixed_time ( ) } ; # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; if do_fixed { self . states . fixed_update ( StateData :: new ( & mut self . world , & mut self . data ) ) ; self . world . write_resource :: < Time > ( ) . finish_fixed_update ( ) ; } # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; self . states . update ( StateData :: new ( & mut self . world , & mut self . data ) ) ; } # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; self . world . maintain ( ) ; // TODO: replace this with a more customizable method. // TODO: effectively, the user should have more control over error handling here // TODO: because right now the app will just exit in case of an error. self . world . write_resource :: < Errors > ( ) . print_and_exit ( ) ; }
Advances the game world by one tick.
Advances the game world by one tick .
&mut self
&mut self