Beispiel #1
0
        /// <summary>
        /// Called when the frame rate is changed.
        /// </summary>
        /// <param name="o">The object.</param>
        /// <param name="args">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnFrameRateChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
        {
            //  Get the control.
            OpenGLControlExt me = o as OpenGLControlExt;

            //  If we have the timer, set the time.
            if (me.timer != null)
            {
                //  Stop the timer.
                me.timer.Stop();

                //  Set the timer.
                me.timer.Interval = new TimeSpan(0, 0, 0, 0, (int)(1000f / me.FrameRate));

                //  Start the timer.
                me.timer.Start();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Called when [render context type changed].
 /// </summary>
 /// <param name="o">The o.</param>
 /// <param name="args">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
 private static void OnRenderContextTypeChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
 {
     OpenGLControlExt me = o as OpenGLControlExt;
 }