public static extern bool FrameEnded( Handle self, FrameEvent frameEvent);
public static extern bool FrameRenderingQueued( Handle self, FrameEvent frameEvent);
/// <summary> /// Updates the by event. /// </summary> /// <param name="frameEvent">The frame event.</param> public void UpdateByEvent(FrameEvent frameEvent) { Elapsed = TimeSpan.FromSeconds(frameEvent.TimeSinceLastFrame); FromLastEvent = TimeSpan.FromSeconds(frameEvent.TimeSinceLastEvent); }
protected virtual void UpdateScene(FrameEvent evt) { }
protected virtual bool OnFrameRenderingQueued(FrameEvent evt) { if (Window.IsClosed) return false; if (ShutDown) return false; try { ProcessInput(); UpdateScene(evt); CameraMan.UpdateCamera(evt.TimeSinceLastFrame); DebugOverlay.Update(evt.TimeSinceLastFrame); return true; } catch (ShutdownException) { ShutDown = true; return false; } }
/// <summary> /// Called when [frame rendering queued]. /// </summary> /// <param name="e">The e.</param> /// <returns></returns> private bool OnFrameRenderingQueued(FrameEvent e) { Game.Timer.UpdateByEvent(e); ApplyCustomLogic(); IGameState currentState = Game.StateMachine.Current; if (currentState == null) return false; currentState.Update(Game.Timer); return Game.IsRunning && !Game.Variables.Ogre.RenderWindow.IsClosed; }