protected override void OnFrameStarted( object source, FrameEventArgs evt )
{
base.OnFrameStarted( source, evt );
if ( evt.StopRendering )
return;
// Limit user input update rate, to prevent math rounding errors from deltas too small
// Note: Slowing down input queries will speed up Frame Rates, not slow them down.
if ( ( inputTimer += evt.TimeSinceLastFrame ) >= inputInterval )
{
//e.TimeSinceLastFrame = this.inputTimer;
//base.OnFrameStarted(source, e); // do the normal demo frame processing first
input.Capture(); // Read Keyboard and Mouse inputs
RapidUpdate(); // Process rapid inputs, like camera motion or settings adjustments
// Process User Requested Mode Changes
if ( modeTimer > modeInterval )
{
ModeUpdate();
}
else
{
modeTimer += inputTimer;
} // only increment when below, to save CPU
// Update Performance Stats on Interval timer
if ( ( statsTimer += inputTimer ) > statsInterval )
{
UpdateStats();
}
inputTimer = 0f;
}
}