protected virtual void dispose( bool disposeManagedResources )
{
if ( !IsDisposed )
{
if ( disposeManagedResources )
{
if ( Engine != null )
{
// remove event handlers
Engine.FrameStarted -= Engine_FrameRenderingQueued;
}
if ( SceneManager != null )
{
SceneManager.RemoveAllCameras();
}
Camera = null;
if ( Root.Instance != null )
{
Root.Instance.RenderSystem.DetachRenderTarget( Window );
}
if ( Window != null )
{
WindowEventMonitor.Instance.UnregisterWindow( Window );
Window.Dispose();
}
if ( Engine != null )
{
Engine.Dispose();
}
}
// There are no unmanaged resources to release, but
// if we add them, they need to be released here.
}
IsDisposed = true;
}