/// <summary> /// Internal constructor. This class cannot be instantiated externally. /// </summary> /// <remarks> /// Protected internal because this singleton will actually hold the instance of a subclass /// created by a render system plugin. /// </remarks> protected internal TextureManager() : base() { if ( instance == null ) { instance = this; ResourceType = "Texture"; LoadingOrder = 75.0f; } else throw new AxiomException( "Cannot create another instance of {0}. Use Instance property instead", this.GetType().Name ); }
/// <summary> /// Internal constructor. This class cannot be instantiated externally. /// </summary> /// <remarks> /// Protected internal because this singleton will actually hold the instance of a subclass /// created by a render system plugin. /// </remarks> protected internal TextureManager() { if (instance == null) { instance = this; } }
/// <summary> /// Called when the engine is shutting down. /// </summary> public override void Dispose() { base.Dispose(); if (this == instance) { instance = null; } }
/// <summary> /// Called when the engine is shutting down. /// </summary> protected override void dispose( bool disposeManagedResources ) { if ( !IsDisposed ) { if ( disposeManagedResources ) { if ( this == instance ) { instance = null; } foreach ( Texture texture in Resources ) { if ( !texture.IsDisposed ) { texture.Dispose(); } } } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); }