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
}
}