protected void Dispose(bool disposing) { if (mDisposed) { return; } if (disposing) { PositionBuffer?.Dispose(); NormalBuffer?.Dispose(); TangentBuffer?.Dispose(); TexCoord0Buffer?.Dispose(); TexCoord1Buffer?.Dispose(); Color0Buffer?.Dispose(); foreach (var subMesh in SubMeshes) { subMesh.Dispose(); } } GL.DeleteVertexArray(VertexArrayId); GL.Finish(); mDisposed = true; }
private void OnDisable() { Tribuffer.Release(); Tribuffer.Dispose(); PosBuffer.Release(); PosBuffer.Dispose(); NormalBuffer.Release(); NormalBuffer.Dispose(); IndexBuffer.Release(); IndexBuffer.Dispose(); CountBuffer.Release(); CountBuffer.Dispose(); }
private bool mDisposed = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!mDisposed) { if (disposing) { PositionBuffer.Dispose(); NormalBuffer?.Dispose(); TextureCoordinateChannel0Buffer?.Dispose(); ElementBuffer.Dispose(); GL.DeleteVertexArray(Id); } mDisposed = true; } }
protected void Dispose(bool disposing) { if (disposing) { PositionBuffer?.Dispose(); NormalBuffer?.Dispose(); TangentBuffer?.Dispose(); TexCoordBuffer?.Dispose(); TexCoord2Buffer?.Dispose(); ColorBuffer?.Dispose(); foreach (var indexTable in IndexTables) { indexTable.Dispose(); } } GL.DeleteVertexArray(VertexArrayID); }
public void Dispose() { VertexBuffer.Dispose(); NormalBuffer.Dispose(); IndexBuffer.Dispose(); }