private void Dispose(bool disposing) { if (!_isDisposed) { if (disposing) { if (_sig != null) { _sig.Dispose(); _sig = null; } if (_layoutMap != null) { foreach (KeyValuePair <int, D3D.InputLayout> kv in _layoutMap) { if (kv.Value != null) { kv.Value.Dispose(); } } _layoutMap.Clear(); _layoutMap = null; } } } _isDisposed = true; }
public InputLayoutMap(D3D10Renderer renderer, D3DC.ShaderSignature shaderSignature) { _device = renderer.GraphicsDevice; _sig = shaderSignature; _layoutMap = new Dictionary <int, D3D.InputLayout>(); _semanticIndexCount = new int[Enum.GetValues(typeof(VertexSemantic)).Length]; _isDisposed = false; renderer.Disposing += new EventHandler(delegate(object o, EventArgs args) { Dispose(); }); }