protected virtual void Dispose( bool disposing ) { if( disposing ) { if( this._data != null ) { Console.WriteLine( "~Image, bytes[{0}]", this._data.Length ); this._data = null; if( this.resource != null ) { this.resource.Dispose(); this.resource = null; } Console.WriteLine( "~Image done" ); } } }
protected virtual void Dispose( bool disposing ) { if( disposing ) { if( this.isValid ) { Console.WriteLine( "~Material {0}", this.name ); this.isValid = false; foreach( var texture in this.texturesList ) { if( texture.Value.resource != null ) { texture.Value.resource.Dec(); } } if( this.resource != null ) { this.resource.Dispose(); this.resource = null; if( this.shader != null ) { this.shader.Dec(); } this.shader = null; } Console.WriteLine( "~Material {0} done", this.name ); } } }
protected virtual void Dispose( bool disposing ) { if( disposing ) { if( this.descriptor != 0 ) { Console.WriteLine( "~Texture {0}", this.name ); GL.DeleteTexture( this.descriptor ); this._descriptor = 0; if( this.resource != null ) { this.resource.Dispose(); this.resource = null; } Console.WriteLine( "~Texture {0} done", this.name ); } } }
protected virtual void Dispose( bool disposing ) { if( disposing ) { if( this.isValid ) { Console.WriteLine( "~Model {0}", this.name ); this.isValid = false; if( this.resource != null ) { this.resource.Dispose(); this.resource = null; if( this.mesh != null ) { this.mesh.Dec(); } this.mesh = null; if( this.material != null ) { this.material.Dec(); } this.material = null; } Console.WriteLine( "~Model {0} done", this.name ); } } }
protected virtual void Dispose( bool disposing ) { if( disposing ) { if( this.vertices != null ) { Console.WriteLine( "~Mesh {0}", this.name ); this._vertices = null; this._colors = null; this._texCoords = null; this._normals = null; this._indices = null; if( this.resource != null ) { this.resource.Dispose(); this.resource = null; } Console.WriteLine( "~Mesh {0} done", this.name ); } } }