//The "Game Loop" private void Loop() { //Update and render, unless if we're in the middle of exiting if (!_exiting) { GameTime time = _timer.Update(); //Accumulate the update to measure FPS UpdateFrameRate(time); if (!_window.IsMinimized) { _inputLayer.CheckTriggers(time); _renderer.CurrentCamera.Update(); } Update(time); Render(_renderer); } else { //Clean up and exit UnloadContent(); _host.Exit(); Engine.CleanUpResources(); } }
//During the update process, we check the triggers and process any input. Typically //this is done before updating the geometric state of your objects (e.g. calle Spatial.Update()), //since your input may change that state. protected override void OnUpdate(GameTime time) { input.CheckTriggers(time); }