Radegast.Rendering.SceneWindow.Application_Idle C# (CSharp) Method

Application_Idle() private method

private Application_Idle ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        void Application_Idle(object sender, EventArgs e)
        {
            if (RenderingEnabled && glControl != null && !glControl.IsDisposed)
            {
                try
                {
                    while (RenderingEnabled && glControl != null && glControl.IsIdle)
                    {
                        MainRenderLoop();
                        if (instance.MonoRuntime)
                        {
                            Application.DoEvents();
                        }
                    }
                }
                catch (ObjectDisposedException)
                { }
            #if !DEBUG
                catch (NullReferenceException)
                { }
                catch (Exception ex)
                {
                    RenderingEnabled = false;
                    Logger.Log("Crash of the 3D scene viewer:\n" + ex.ToString(), Helpers.LogLevel.Error);
                    Dispose();
                }
            #endif
            }
        }
SceneWindow