/// <summary>
        /// Performs the OpenGl rendering when this control is visible
        /// </summary>
        /// <param name="sender">The object that sent the event</param>
        /// <param name="args">The event arguments about this event</param>
        private void CompositionTargetOnRendering(object sender, EventArgs args)
        {
            DateTime now = DateTime.Now;

            if ((_continuous && now > _nextRenderTime) || ManualRepaintEvent.WaitOne(0))
            {
                ManualRepaintEvent.Reset();
                _nextRenderTime = now + Render();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Performs the OpenGl rendering when this control is visible
        /// </summary>
        /// <param name="sender">The object that sent the event</param>
        /// <param name="args">The event arguments about this event</param>
        private void CompositionTargetOnRendering(object sender, EventArgs args)
        {
#if DEBUG
            //We needn't call render() for avoiding crash by calling OpenGL API methods.
            if (IsDesignMode())
            {
                return;
            }
#endif

            DateTime now = DateTime.Now;
            if ((_continuous && now > _nextRenderTime) || ManualRepaintEvent.WaitOne(0))
            {
                ManualRepaintEvent.Reset();
                _nextRenderTime = now + Render();
            }
        }