public virtual void Dispose() { m_Materials.Clear(); if (!VertexLayout.Disposed) { VertexLayout.Dispose(); } if (!VertexBuffer.Disposed) { VertexBuffer.Dispose(); } if (!IndexBuffer.Disposed) { IndexBuffer.Dispose(); } if (m_IsCommonEffectManager) { EffectManager = null; } else { EffectManager.Dispose(); } Device = null; }
public void SetDrawablePmx(ICommonContents common, BackgroundWorker worker) { if (VertexLayout != null) { VertexLayout.Dispose(); } if (VertexBuffer != null) { VertexBuffer.Dispose(); } if (IndexBuffer != null) { IndexBuffer.Dispose(); } if (EffectManager != null) { EffectManager.Dispose(); } Device = common.Effect.Device; SetEffectManager(new EffectManager11(common.Effect), false); initVertexLayout(Device, common.Effect); initVertexBuffer(Device, worker); initIndexBuffer(Device, worker); m_Materials.Clear(); int indexOffset = 0; foreach (var ipxMaterial in Pmx.Material) { var tmpMaterial = new DrawableMaterial(ipxMaterial, indexOffset); tmpMaterial.SetTextures(common); m_Materials.Add(tmpMaterial); indexOffset += ipxMaterial.Faces.Count * 3; } }
protected override void CreateVertexLayout() { VertexLayout?.Dispose(); VertexLayout = new InputLayout( Device, UsingEffectPass.Description.Signature, new TVertex().VertexElements.Concat(new TInstanceData().VertexElements).ToArray() ); }
protected virtual void CreateVertexLayout() { VertexLayout?.Dispose(); VertexLayout = new InputLayout( Device, UsingEffectPass.Description.Signature, new TVertex().VertexElements ); }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: マネージド状態を破棄します (マネージド オブジェクト) VertexLayout?.Dispose(); VertexBuffer?.Dispose(); IndexBuffer?.Dispose(); } // TODO: アンマネージド リソース (アンマネージド オブジェクト) を解放し、ファイナライザーをオーバーライドします // TODO: 大きなフィールドを null に設定します disposedValue = true; } }
public void Dispose() { VertexLayout.Dispose(); VertexLayout = null; }